Skip to content

Decide withdrawn cards by the one keeping rule, in the list's reading - #2498

Merged
max-sixty merged 7 commits into
mainfrom
fix/keeping-withdrawals
Oct 12, 2026
Merged

max-sixty merged 7 commits into
mainfrom
fix/keeping-withdrawals

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Lit follow-up review, item 24: #2387 held a withdrawn thread's allocation in the panel with its own copy of keeping's conditions (same intent, reading continuity, shown and not folding, no gesture of the user's, visible when open and growth seen otherwise), and spliced the allocation into each reading the list painted, so commit() had to rebuild a parallel committed row list from the drawn rows. Every later change to when a card may leave the list would have had to land twice.

Now one rule, #keeping in thread-list-view.js, decides when any card leaves, and the model builder asks it about both kinds of departure while it builds the reading (rowModel in thread-list.js): keeping(thread, intent) for a card the narrowing stops admitting, and withdrawal(row, intent) for a committed card whose root the log no longer has. A kept withdrawal is placed among its neighbours in the reading itself, so it is an ordinary row of the committed model: #committedRows, #withWithdrawals and the retaining branch in willUpdate are gone, and rollback repaints the committed reading as it stands. The one condition that differs is a parameter: a withdrawn root passes words: false, since its controls disconnect with it and there is no draft left to hold for. Whether a card is the open one is read from the row the list last showed open, one fact for cards and withdrawn allocations alike. The module header records the rule and the rejected copy.

Behaviour that changed: none for the case #2387 fixed (another actor withdrawing the selected thread keeps its room, shows "Thread withdrawn" with Dismiss, and opens no fallback conversation). Three edges follow the shared rule:

  • A card held only for the user's words ("draft") that another actor withdraws now leaves at once, as any card a turn of the user's own released does, rather than standing as a Dismiss notice. No words are lost by this: a withdrawn root's notice never held an editor, so under Keep withdrawn threads in place and preserve native state in Lit moves #2387 too the reply editor ends with the root and the words leave the screen, while drafts.js keeps them under reply:<thread> for a return of the thread. The scrolled case of test_an_external_withdrawal_keeps_the_readers_allocation asserts exactly that (the words-left-the-screen report, then loadDraft('reply:first-thread') still returning the typed text), and it covers a selected card holding a draft, which the shared rule still keeps as a notice. (Keep withdrawn threads in place and preserve native state in Lit moves #2387's copy also skipped a card while the user's gesture on it stood, and a gesture is how a card comes to be kept for its words, so the two differ only once that gesture has passed.)
  • A resolved card already folding out when its root is withdrawn now finishes leaving rather than freezing at its partial height as a notice. The old copy read descriptor.folding, which the model always sets false, so its folding test never fired.
  • The withdrawal decision is made when the reading is built, as keeping's always was, so a retry after a failed paint draws the reading it retries rather than deciding again mid-paint.

Choosing another card still releases a withdrawn allocation at once, as #2387 chose, outside the geometry rule; the header now says so rather than calling it a gesture on the withdrawn thread. The dead descriptor.folding read in the list's eligibility (always false in the reading) is gone.

Source lines (hand-written, excluding tests): +94 −99.
Test lines: +2 −10. test_an_external_withdrawal_keeps_the_readers_allocation now asserts the frozen widget is gone from the page instead of reading a captured node's isConnected, and drops a node-identity check that its position and focus assertions already cover.

Focused browser runs: the withdrawal test (closed, selected, scrolled, scaled), the failed-candidate rollback test, and the held-news panel tests (test_a_settlement_from_elsewhere_moves_nothing_in_a_short_panel_thread, test_an_external_resolution_keeps_a_panel_reply_until_it_is_sent, test_reaching_news_a_card_holds_keeps_the_view, test_a_rewrite_in_a_card_news_kept_goes_with_its_thread, test_resolving_an_early_thread_keeps_the_rest_in_place, test_a_thread_resolved_while_its_reply_is_written_keeps_the_user_on_it).

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

max-sixty and others added 7 commits October 11, 2026 22:24
#2387 held a withdrawn root's allocation with its own copy of `keeping`'s
conditions. Both now go through `#keeping`: the same intent, reading
continuity, shown-and-not-folding, gesture and seen-geometry tests, with the
open card read from the row the list last showed open. A withdrawn root passes
`words: false`, since its controls disconnect and nothing is left to hold for
a draft.

Behaviour: unchanged for the cases #2387 fixed. A card kept only for the
user's words ("draft") that another actor withdraws now leaves at once rather
than holding a Dismiss notice, as any card the user's own turn released does.

The withdrawal test now asserts the frozen widget is gone from the page rather
than a captured node's isConnected, and drops a node-identity check its
position and focus assertions already cover.

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

`#keeping` now refuses any row that is neither a thread card nor a withdrawn
allocation by kind, rather than by system and empty rows happening to have no
node. Between two uncommitted readings, a withdrawn allocation whose committed
row is still the thread consults the user's gesture on that thread again, as
the rule does for any card.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The model builder now asks the list, for each committed row whose root the
log no longer has, whether it keeps the room (`withdrawal`, by the same
`#keeping` rule), and places the allocation among its neighbours in the
reading itself. A withdrawn allocation is therefore an ordinary row of the
committed reading: `commit()` no longer rebuilds a parallel committed row
list from the drawn rows, rollback repaints the committed reading as is, and
`willUpdate` paints `model.rows` without splicing.

Behaviour: the withdrawal decision is made when the reading is built, as
`keeping`'s always was, so a retry after a failed paint draws the reading it
retries rather than deciding again mid-paint.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…op a dead folding read

The thread list's eligibility read descriptor.folding, which threadReading
always sets false; the header now records that choosing another card
releases a withdrawn allocation outside the geometry rule, as #2387 chose.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit bb47f5f into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the fix/keeping-withdrawals branch October 12, 2026 06:09
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