Skip to content

Read where the user stands from one owner, so an Ask and its thread are one target - #1222

Merged
max-sixty merged 10 commits into
mainfrom
ask-thread-focus
Sep 26, 2026
Merged

max-sixty merged 10 commits into
mainfrom
ask-thread-focus

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

An Ask and the thread about it are now one standing target (glossary, Standing target): a onto an Ask whose thread the card shows, then c, continues that thread instead of starting a second one; t onto an Ask's thread keeps the Ask's ring, and its digits 1–9 answer it. Before, each feature that asked "where does the user stand?" climbed from focus its own way, and only some of them translated a card, a margin control, or a Threads-panel thread back to the page element it is about.

One owner for where the user stands

runtime/standing-target.js is new and owns the answer. placeOf(node) is the page node a focused node stands at: a node on the page, or inside any Ask (a reply's frozen Ask included), stands at itself; chrome stands at the page target its owner declares through declareSide (the margin for its cluster controls, the card and Threads-panel threads, the Asks tray for its rows); a side's answer that is itself chrome outside any Ask, like the toggle of an lf-shot in a reply, stands nowhere. standingPlace() adds the caret, and heldAsk() is the Ask holding the place.

Every reader now takes that place and applies its own rule:

  • The Ask view (asks/view.js): askAt is askHolding(asks, placeOf(node)), and askPosition reads standingPlace(). askPlace, walkPlace, standsAt, holdingAsk, and the view's own heldAsk are gone.
  • standingElement (composing/standing.js), which c and e address, reads the same place and drops the projectionTarget plumbing. A thread drawn in the chrome still has no element, so e from a card reacts as before.
  • From a page element, c (composing/surface.js) continues the shown thread only when its target lies within the held Ask or the standing element, so on an Ask nested in a commented task, c starts a thread on the Ask instead of replying to the task's.
  • t (navigation.js) steps from standingPlace() by document position, as a does; pagePlace is gone.
  • heldThread in thread/focus.js replaces focusedThreadOf, standingThreadOf, landing's local heldThread, and focusedAnchorThreadId.
  • The Escape floor (keyboard/page.js) imports heldAsk and heldThread directly.

Behavior that moves

  • c or e from an Asks tray row acts on that row's Ask rather than the page, and t starts from it.
  • A caret left by a click counts as a place for t. Two threads tests used a body click to mean "nowhere"; they now clear focus and selection instead.
  • An answered Ask frozen into a reply is where a user back on its option stands, so a digit there does not answer the page Ask the thread is about.

Tests

tests/test_render_navigation.py adds test_an_ask_and_its_thread_are_one_standing_target (a then c into the Ask's thread, t/Shift+t across an Ask with no thread, a nested Ask in a commented task, and a digit from the Threads panel) and test_an_ask_in_a_reply_is_where_the_user_stands_once_answered (the frozen reply Ask, and a from a reply lf-shot's margin toggle), and test_a_resolved_thread_still_stands_at_its_ask (a resolved thread's row in Threads keeps its Ask's ring and digits, since threadTarget reads the thread's placement rather than the open-thread inventory). Bug-backs on the side declaration, the in-Ask containment rule, the c target rule, and the chrome guard each turn a test red.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

max-sixty and others added 9 commits September 25, 2026 21:06
The block comment over the walk said it wraps at both ends; askStep clamps,
its own comment says so, and the navigation tests pin a clamped walk.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/assets/leaf.js
#	skills/leaf/assets/runtime/composing/surface.js
#	skills/leaf/assets/runtime/margin-projection.js
#	skills/leaf/assets/runtime/navigation.js
An Ask and its thread are one standing target (glossary). Building on
#1204's `threadHere`, the runtime now reads it from the thread's side too:

- `standingTargetAt` (margin-projection.js) gives the page target a card,
  cluster control, or Threads-panel thread stands for. The Ask view and
  `standingElement` read it, so `t` onto an Ask's thread rings the Ask and
  its 1–9 answer it; `a` steps from that Ask. An Ask frozen into a reply
  still wins by containment, and an answered Ask stands only on its review
  route, so a digit in its thread cannot re-answer it.
- `c` continues the thread the user is at only where that thread is about
  the element they stand on or something inside it. On an Ask nested in a
  commented task, the card still shows the task's thread, and `c` now
  starts a thread on the Ask instead of replying there.
- `t` from a page place at no thread measures document position against
  each thread's target, as `a` does, in page order: a caret a click leaves
  counts. Two threads tests used a body click to mean "nowhere"; they now
  clear focus and selection instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rget

Review follow-ups to the standing-target change:

- `askAt` consults the place chrome stands for only when the focused node
  is inside no Ask at all. An answered Ask frozen into a reply is where a
  user back on its option stands; it no longer hands its ring and digits
  to the page Ask its thread is about.
- `standingElement` keeps reading margin controls only, so `e` from a
  card or panel thread reacts as before.
- `c` continues the thread the user is at when its target lies within the
  Ask holding focus, answered or not, else within the standing element, so
  a chosen option of an answered Ask continues the Ask's own thread.
- `t`'s page place falls back to the caret when focused chrome stands for
  nothing, as `a` does.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Every feature that asked where the user stands climbed from focus its own way,
each translating a different part of the chrome. `standing-target.js` now owns
the answer: `placeOf(node)` is the page node a focused node stands at. A node
on the page, or inside any Ask, stands at itself; chrome stands at the target
its owner declares through `declareSide` (the margin for its cluster, the
card, and Threads-panel threads; the Ask view for tray rows), and a side's
answer drawn in the chrome itself stands only where an Ask holds it; other
chrome stands nowhere. `standingPlace()` adds the caret, and `heldAsk()` is
the Ask holding the place.

- The Ask view's `askAt` is `askHolding(asks, placeOf(node))`; `askPlace`,
  `walkPlace`, `holdingAsk` and `heldAsk` go, and `askPosition` reads
  `standingPlace()`.
- `standingElement` reads the same place and drops the `projectionTarget`
  plumbing. A thread drawn in the chrome, its card controls included, still
  has no element.
- `pagePlace` in navigation goes; the `t` walk reads `standingPlace()`.
- `heldThread` in `thread/focus.js` replaces `focusedThreadOf`,
  `standingThreadOf`, landing's `heldThread`, and `focusedAnchorThreadId`;
  it climbs from the inner focus, so a seat staged in a shadow tree counts.
- The Escape floor imports `heldAsk` and `heldThread` directly.

Behavior that moves: `c` or `e` from an Asks tray row acts on that row's Ask
rather than on the page, and `t` starts from it; a caret inside a card or
panel thread places `t` at the thread's target; an inline margin control
inside a thread no longer names the widget frozen there as its element.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
placeOf drops a side's answer that lands in chrome outside any Ask, so `a`
from the toggle of an lf-shot in a reply starts at the reading position
rather than behind every Ask on the page. The reply-Ask test now carries a
before/after shot and presses `a` from its toggle; with the guard removed,
the first Ask is not reached.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
thread/placement.js exports `inPageOrder(threads, placedAt)`, which sorts
threads by where they sit on the page. The predicate this branch added to
narrowing.js shared that name while answering a different question: does
the Threads list show page order? It is `listedInPageOrder` now.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A resolved thread in the Threads panel loses the Ask it is about as its standing target, so its Ask ring and digit actions disappear. threadTarget searches the Page Map inventory, but collectEntries excludes resolved threads. I reproduced this with a resolved thread anchored to cache-ask: focusing its panel summary left data-lf-ask absent. The anchor placement already retains resolved threads; the inline suggestion reads that placement directly.

threadTarget read the Page Map inventory, which leaves resolved threads out,
so a resolved thread's row in Threads stood nowhere: its Ask lost the ring
and its digits. It now reads the thread's placement, which anchor painting
records for every lifecycle state and which is the element the inventory
groups an open thread under. A thread a widget outlet claims gains its
anchored element as its target the same way.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 5813197 into main Sep 26, 2026
6 checks passed
@max-sixty
max-sixty deleted the ask-thread-focus branch September 26, 2026 17:23
max-sixty added a commit that referenced this pull request Sep 26, 2026
…scope (#1231)

Five callers rebuilt the landing band from its top inset alone, and the
Ask view wrote `aria-keyshortcuts` beside the scope register's own
writer. This settles both from the concept survey, plus two small items.

**Landing band.** The page step (`d`/`u`, `navigation.js`), anchor
travel's centring and readable check (`anchor-travel.js`), an Ask
arrival's room and framing (`asks/view.js`) and lf-toc's visible window
now read `landingBand` whole (lf-toc reads both `landingInsets` edges,
since it works in scroll coordinates). `reading-place.js` still reads
the top inset only; it is left for open PR #1218.

The survey's inferred page-step gap does not reproduce: in Chrome at
1280×900 a `d` step moves 508px against a 790px landing band, so a line
just above the foot band lands about 340px down, nowhere near the
banner. The Ask arrival did have a real gap. A region that fit the
window below the banner could leave the ask's foot under the shortcut
bar, and the new test in `test_render_widgets.py` fails on the base with
the foot 28px into a 56px foot band.

**Ask shortcuts.** `projectCommandScope(control, projector, capability)`
now keeps projected scopes as a list per element, keyed by the
projecting owner (margin entries and the Ask view). The Ask projects a
run-less row naming the digit and the command's own bindings that still
reach the control. No row runs, so dispatch, the shortcut bar and the
command reference ignore it. `keyboard/scopes.js` is now the attribute's
only writer, and it paints the union of each scope's live bindings. The
save/restore in `asks/view.js` is gone.

**Also.** `askStep` steps within the list through `clampedRow`.
`passages.py` comments name the runtime's `passages.js` and
`collapse.js` instead of `leaf.js`, and drop the `restsOn` browser
function that no longer exists. The stale "wraps at both ends" comment
was already fixed on main by #1222.

Behaviour that moved:
- `d`/`u` step 60% of the landing band, about 34px less per step on a
desktop window.
- An Ask arrival's region has to fit above the foot band.
- Centred travel centres in the landing band. In the thread panel a
widget sits half the list's heading room lower.
- While the user stands in an Ask, a decision control's
`aria-keyshortcuts` keeps its own scope's bindings, which the Ask view
used to strip. Two scopes on one element that name the same press are
merged rather than refused, and tokens appear in scope order.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Sep 27, 2026
After #1222, `a` onto an Ask shows a thread anchored on the `lf-ask` but
not one on its options or on a phrase in its heading, because the card
shows the threads of the innermost target holding focus and nothing below
it. That is the definition, not a gap: a thread is about exactly its
anchor's target, reached from anywhere inside it. The glossary's Standing
target entry now says so, and `threadEntryAt` notes that treating an Ask as
one target for its threads would belong where a thread's target is decided
(anchor-paint's placement), so that every reader keeps one definition.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants