Skip to content

refactor: unify preview scroll/location into one OO scroll_to(location) primitive #24

Description

@ben-dev-au

Goal

A fuller OO redesign of the preview scroll / location subsystem, building on the PreviewScrollController landed in PR #22.

PR #22 centralised scroll-to-match and added a locate() / scroll_to_location() read-counterpart with a ViewportLocation value object. The logic is still split between preview_scroll.py (controller + strategies) and app.py (mount / dispatch / swap / finalize). A SOTA pass would unify these further.

Direction (to refine in a brainstorm)

  • Polymorphic location/target value objects (e.g. MatchLocation, ViewportLocation, LineLocation), each resolving itself to a scroll target.
  • One scroll_to(location) that the match-scroll also routes through, so there is a single scroll primitive instead of bespoke paths.
  • Strategy per preview kind; a Facade controller; Memento for capture/restore.
  • Reduce duplication and the app.py/preview_scroll.py split; eliminate remaining code smells.

Process

Run as its own brainstorm → spec → plan effort (not folded into a feature PR). Deferred from PR #22 by design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions