Skip to content

Retire Targeting in favor of shared Design comments - #2159

Merged
max-sixty merged 11 commits into
mainfrom
codex/retained-quote-reading
Oct 9, 2026
Merged

max-sixty merged 11 commits into
mainfrom
codex/retained-quote-reading

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

The Code comparison used a separate Targeting workbench for feedback that Leaf’s standard Design comments already carry. Replace it with Design comments on the reader and heading, using stable authored ids. Retire the Targeting package, gallery, structural-reference API and duplicated editor/state, and update registrations, documentation, eval fixture and corpus. Remove Web Awesome imports with no remaining caller. The user approved implementation and rollout after reviewing the visual proposals.

Direct presses and the keyboard/touch picker now share Design target interpretation for controls, editable/focusable regions and named pictures. Authored ids take precedence; visible labels and stable quote context locate anonymous controls where both browser and file readings agree. Unnamed, hidden, repeated or generated faces without sufficient evidence keep honest owner fallbacks. Exact native-control quotations seat the editor and sent thread beside their verified face. Hints remain outside the controls and capture only the chosen passage. Editing values never become automatic control identity or quote context. Native textarea defaults are value initialization, so both passage readings exclude them from spoken context, associated labels and quotations. Reachability’s borrowed tab stops remain mechanical, so scrollable code still supports native selection and comment-mark activation.

Passage capture grows context to the existing semantic fences, including native editing boundaries, and browser search/resolution agrees with file resolution. Ambiguous native selections record detached: true; admission, transcripts and both resolvers retain that fact across revisions. A native Range can still seat a writable editor without claiming semantic ownership. If it disappears, the same draft stays reachable through Resume writing. Cross-cell native selections send their actual quote while remaining unlocated. The shared Not located classification describes current placement without claiming historical removal.

Validation includes pointer/keyboard Design comments, control editor/sent-card placement, generated-tab fallback, named and unnamed regions/pictures, ordinary editing after revision, mutable neighbour and SVG file/browser agreement, code selection/mark reopening, detached draft lifecycle/recovery, four corpus passage-shape sweeps, 73 file-anchor cases, 275 runtime cases, and 11 Mac thread snapshots. Independent source and native-interface review cover the complete shared boundary change and its final corrections. Combined catalog previews were refreshed after integrating main. On committed final source against main 70a7296, the served Code comparison loads 248 → 245 requests and 4,820,714 → 4,595,360 bytes by presentation (225,354 fewer bytes); both Design-comment journeys pass, and the measured pre-upgrade layout shifts are unchanged.

This was written by Codex on behalf of max-sixty

A surviving element destination cannot show old words after a rewrite or data replacement. Use the resolved passage contract to offer local reading only when the compact quote actually clips text. Keep expansion with the retained card and remove the disabled-button treatment from detached quotations.
A native projection retained its subject while replacing its quoted text, exposing an exact-resolution claim for words no longer there. Resolve that case as an element fallback, derive Changed in the thread reading, and preserve local expansion across label changes. Preserve the original gallery log bytes and append only the new fixture events.
…reading

# Conflicts:
#	README.md
#	docs/examples.html
#	leaf-assets.json
Replace the separate Targeting editor and workbench with standard Design comments
on authored reader identities. Remove the package, target-reference API and unused
Web Awesome controls; update examples, corpus, docs and fixtures together.

Keep direct and keyboard/touch targeting on the same lazy reading of native
controls and their visible label faces. Capture resolves the actual selected span
through real passage fences, while ambiguous capture records detached: true so a
later identical survivor cannot inherit the original comment. The native Range
owns placement independently; retiring it keeps the same draft recoverable.

Expose control parts and honest uncertainty in composer/transcript labels and
Not located filtering. Spoken context shares bounded, language-aware excerpts
with search, retaining the exact stored anchor windows.

Validation: native Design and detached/attached editor lifecycle journeys,
file/admission/revision/transcript contrasts, corpus,275runtime tests, startup
comparison and independent source/native review.

@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.

The new Design target reader drops controls classified as regions. designPress() still claims [contenteditable] and focusable regions through WORKS, but DESIGN_CONTROLS = PRESSES makes designTargetAt() fall back to their shared authored owner, and the picker gives those regions no separate hints. For example, pressing either of two unnamed editable regions inside one section now opens the same section comment, so the user cannot identify which editor they meant. Keep the target reading aligned with the shared WORKS control vocabulary, including its region selectors, for both direct presses and picker inventory.

Capture visible file-modelled words for unique as well as repeated native control names. Accessibility-name uniqueness is not durable identity; unsupported generated faces retain the existing owner fallback. Exact part quotations sharing one pressable face now supply that face as the shared placement target for editors and sent threads, while ordinary prose still clears its block.

Update label/input equivalence to compare chosen captures rather than bare lazy inventory coordinates. Cover pointer and keyboard capture, file agreement, actual revision, local editor and sent-card geometry, and generated tab fallback.
Use one candidate reading for Design interception, direct target capture and the picker. Named regions and pictures retain honest identity; mutable editing values never become automatic names or neighbouring quote context.

Browser and file passage cells fence native editing boundaries consistently, and browser search and resolution share that fence rule. Reach declares its borrowed tab stops so keyboard reachability cannot turn prose into a working region. Preserve authored focus and ownership transfer when returning those stops.

Keep native cross-cell quotations writable and send their actual detached evidence. The corpus sweep now requires independent file refusal before accepting a non-exact mark, rather than forcing an exact highlight across unreadable seams. Cover native code selection, mark reopening, region/picture routes and source agreement.
leaf-agent
leaf-agent previously approved these changes Oct 9, 2026
Textarea child markup initializes its value, rather than supplying document passage words. Exclude that markup in both browser and file readings so stale defaults cannot enter Design names or surrounding quote context after native editing.

Retain honest element and section fallback targets, visible labels, ordinary prose quotations and native typing. Exercise canonical before/after capture, browser/file agreement and a real Design comment followed by normal editing.
leaf-agent
leaf-agent previously approved these changes Oct 9, 2026

@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.

The changed Design instruction in skills/leaf/assets/registry.json leaves the recorded contract snapshot stale. The test job failed test_each_case_of_an_event_is_told_what_the_snapshot_shows: its diff is the old Design wording versus this PR's new wording. Updating tests/_regtest_outputs/test_interact_contract.test_each_case_of_an_event_is_told_what_the_snapshot_shows__0/snapshot.yaml to reflect the new instruction should clear this failure. I can push that mechanical snapshot update if you want.

@leaf-agent
leaf-agent dismissed their stale review October 9, 2026 15:51

CI failed: the Design instruction snapshot is stale.

@max-sixty
max-sixty merged commit b91b966 into main Oct 9, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex/retained-quote-reading branch October 9, 2026 16:28
leaf-agent added a commit that referenced this pull request Oct 10, 2026
A native selection across option cells cannot claim one exact mark after #2159. Keep the exact prose and visual target checks, and check the cross-cell quote in its composer.
max-sixty pushed a commit that referenced this pull request Oct 10, 2026
The detached draft behavior introduced by #2159 keeps an open editor
available when a new revision removes its passage. The older browser
test still expected the editor to close, so main's nightly test failed.
This updates the test to require the draft and its original quote to
remain visible while the rewritten passage has no pending mark; it also
keeps the check that the draft returns to its passage when that version
is reopened. The test failed on main before this change and passes with
the corrected expectation.

Verified with `uv run pytest -q
tests/test_render_outbox.py::test_a_draft_that_outlives_its_passage_returns_with_that_passage
-x -n0`.

Closes #2205 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 10, 2026
The touch “Select element” command remains available in Design mode
because [#2159](#2159) made the
picker and direct Design presses share one target reading. The browser
check still expected it to be disabled in both Design and Draw modes.
Assert availability in Design, while retaining the disabled checks for
Draw mode and a covering Threads panel, plus the text-search checks in
both modes.

The focused browser case failed on `main` before this change and passed
afterward: `uv run pytest
tests/test_render_semantic_selection.py::test_select_element_obeys_covering_surfaces_and_pointer_modes
-q -n0`.

This addresses one failure in [main CI run
38013241865](https://github.com/max-sixty/leaf/actions/runs/38013241865).

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 10, 2026
[#2159](#2159) moved Design target
hints outside the controls they name and removed ancestry indentation.
Two browser checks still expected the nested child hint to step right.
Check that both hints stand outside their targets without overlapping,
and that the child hint follows its target when layout moves while
keeping the same offset.

Both focused cases failed on `main` before this change and passed
afterward: `uv run pytest
tests/test_render_semantic_selection.py::test_nested_target_hints_show_containment_without_covering_each_other
tests/test_render_semantic_selection.py::test_a_nested_target_hint_follows_when_the_nesting_changes
-q -n0`.

This addresses two failures in [main CI run
38013241865](https://github.com/max-sixty/leaf/actions/runs/38013241865).

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 13, 2026
…gets (#2718)

The target picker's chips once stepped right inside each target, one
step per enclosing member (db2dd20), so a group's chip and its
members' chips read as an outline. #2159 moved every chip outside its
target to stop it covering the member's icon and first words, and the
step went with it: nested targets sharing a left edge, such as an
`lf-options` group and its options, put their chips in one flush column.

A before seat now steps out once per level of nesting it has below the
deepest before seat in its own tree, the targets its outermost enclosing
target holds (`nestOutsets`, `hints.js`). The deepest chips stand where
they did, each container's chip stands a step left of its members', no
chip crosses into its own target, and a target in no nest keeps its chip
beside it. The step is 10px and narrows to fit the outermost chips in
the gutter, down to 4px; a chip the window already clamps does not
narrow it. Only the target picker seats chips before their targets, so
the Go-to map is unchanged.

Where the gutter is narrower than about 24px, the window edge still
clamps every level together, as before. Seating stays a pure fold over
rectangles already read; on a synthetic 300-hint map the whole fold runs
in 3 ms against 9 ms before, because stepped chips collide less.

The containment test now asserts the child's chip stands right of its
container's, which it never did while its name claimed it.

> _This was written by Claude Code on behalf of max-sixty_

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