8000 A Document containing only a list has no paragraph-scope Target · Issue #55 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

A Document containing only a list has no paragraph-scope Target #55

Closed

Description

@kiran-brahma

What

A Document that contains only a list has no paragraph-scope Target, so every paragraph Pass silently
cannot run.

  • src/core/passContext.ts:24 — passContext returns null when canonicalBlocks(tree) contains no
    block of type paragraph.
  • src/core/passContext.ts — targetForPass returns that null for scope: "paragraph".
  • The shell then refuses the Run with the scope's empty message (Core's scopeVocab), which for
    paragraph scope reads "Add a paragraph before running a local Pass."

Impact

The message is honest but the situation is not: a writer who has drafted a piece as a bulleted list,
or a document whose only prose sits inside list items, cannot use the paragraph Passes at all — and
the remedy the message offers ("add a paragraph") is not the only reasonable one. A list item does
contain a paragraph, nested under the list.

Fix

Resolve a paragraph-scope Target to a Paragraph inside a list item, the same way the renderer already
descends into lists. This is a Core change in passContext.ts (and nearestParagraphIndex), with
the Target's interval still expressed in the one canonical string so Containment is unaffected.

Origin

Found by the Thermos review (code-review Spec axis, edge cases).

Activity

  1. added a commit that references this issue on Sep 26, 2026
    a8256f0
  2. kiran-brahma commented on Sep 26, 2026

    @kiran-brahma
    OwnerAuthor

    Fixed in #75 (merged into v1.3): a paragraph-scope Target now resolves to a Paragraph inside a list item, with the interval over the prose only.

    Known limitation: the Editor reports only the top-level block under the cursor, so a cursor anywhere in a list resolves to the list's first Paragraph. Choosing the item under the cursor needs a finer cursor position from the Editor — a follow-up ticket if wanted.


    Generated by Claude Code

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

    bugSomething isn't workingready-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

      2BEC
      0