8000 The Current Finding · Issue #38 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

The Current Finding #38

Closed
Closed

Description

@kiran-brahma

Parent

#34 — the Obelus v1.2 spec (docs/specs/obelus-v1.2.md). Covers stories 173–175.

Blocked by #35 — the rail restructures FindingsSidebar. Build on its shape.

What to build

applyResolution in src/useDocument.ts hands the Editor the intervals of every open Finding, and
they all draw the same .obelus-highlight. Selecting a Finding — by click or by j/k — changes a
row in the sidebar and nothing else. On any Document longer than a screen the Writer is handed a
quotation and left to find it.

Selecting a Finding must scroll the Editor to the text it concerns, and the Current Finding's
Highlight must be distinguished from the others.

Reuse jumpRequest. It already carries a block index and a nonce, is consumed in DocumentEditor
(lines 93–107), and is how the Outline jumps to a Section — do not introduce a second way to move the
Editor. The nonce is load-bearing: re-selecting the same Finding must move the Editor again.

The distinguished Highlight is a second class beside .obelus-highlight, not a replacement. Keep the
existing rule that a Finding which has left the queue draws no Highlight at all.

Where

  • src/useDocument.ts — carry which interval is current alongside highlights.
  • src/App.tsx — raise a jumpRequest when the queue selection changes.
  • src/editor/highlight.ts, src/index.css — the distinguished class.
  • src/core/anchor.ts — the pure block-index lookup, if one is not already there.

Acceptance criteria

  • Selecting a Finding scrolls the Editor to the text it concerns. (story 173)
  • The Current Finding's Highlight is visually distinguished from the other open Findings.
    (story 174)
  • Stepping the queue with j and k moves the prose too. (story 175)
  • Re-selecting the Finding already current moves the Editor again (the nonce).
  • An Orphaned Finding — one whose quote can no longer be found — selects without crashing and
    without scrolling anywhere misleading.
  • A Finding that has left the queue still draws no Highlight.
  • CONTEXT.md's Current Finding entry is the term used in code, tests and commits.

Verification

A pure test for the interval → block-index derivation, including an interval that spans a block
boundary and an Orphaned Anchor. Assert through the existing entry points, not module internals.

No DOM layer. State the observable checks you ran for the scroll and the Highlight.

Constitution

Unchanged. A Highlight is the rendering of an Anchor; nothing here inserts model-derived text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentSpec is ready for an agent to implement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0