Skip to content

[M4] TextFrame: scrollTo focused node when selection changes externally #41

Description

@Korede-TA

Goal

When a node is focused via click in SemanticFrame, MapFrame, Timeline etc., the TextFrame should automatically scroll to that node's text position — both in normal mode and in pinned comparison mode.

What to do

  • Add data-node-id attributes to each rendered chunk/annotation span in TextFrame
  • On selectionStore.focused change: document.querySelector([data-node-id="${focused}"])?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
  • For documents (parent nodes): scroll to the document heading
  • Smooth scroll, not instant jump
  • If the focused node is not in the current TextFrame's scope (e.g. wrong pinned doc), do nothing

Acceptance criteria

  • Clicking a chunk on the map scrolls TextFrame to that chunk's text
  • Works in both pinned and unpinned mode
  • No jarring instant jumps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions