Repository navigation
Make mobile card moves direct and reversible - #450
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
At phone width the neighbouring column is now a 16px sliver, and that removes the only pointer route for moving a card between columns: the drop target is off screen, and the board is never auto-scrolled during a drag. #sortable in skills/leaf/packages/default/widgets/lf-board.js passes scroll: scrollerFor(this), which is the page or thread-panel scroller — scrollerFor in skills/leaf/assets/runtime/navigation.js answers inChrome(el) ? threadsBox : pageScroller — and Sortable's autoscroll bubbles upward from that element, so the board's own inline scroller is never in the chain.
Measured on SQUEEZED_BOARD_PAGE at 390×900, pressing #sq-card-0's grip and dragging to the board's right edge: on the merge base the card lands in sq-col-1; on this head it stays in sq-col-0 and the board's scrollLeft stays 0. The move is still reachable if the reader first parks the board mid-column — from scrollLeft 160 the same drag lands in sq-col-1 — but the added proximity snap works against exactly that resting position: 80 snapped back to 0 and 240 forward to 326.
The new test's docstring says pointer dragging keeps the same meaning at every width. The direction does; the reach does not, and nothing in the suite covers it.
So this trades reading a column against moving a card, on the one width where the keyboard route isn't available. If that's the intended trade, the docstring is the place to say so; if it isn't, the board has to be the scroller Sortable drives on this path.
leaf-agent
left a comment
There was a problem hiding this comment.
The destination row answers the reach problem, and the earlier finding is closed: at 390×900 with touch, #sq-card-0 reaches sq-col-1 by press, and the new case covers it. Two things the phone route does not carry, though.
It replaces the grip rather than joining it, and it cannot make every move the grip could. lf-card .lf-grip { display: none; } inside the new @media screen and (max-width: 640px) and (pointer: coarse) block takes the Sortable handle and the keyboard grab away together, and the destination row does not cover what they did. Reordering inside a column has no route left: #names hides the card's own column (button.hidden = button.dataset.lfBoardTarget === col.id), and each destination press places at this.#cards(column).length, so a phone reader can only append a card to the end of some other column. Sharper on a board with one column — #destinations returns before building anything when columns.length < 2 — so there is no pointer route and no keyboard route at all. Measured on TALL_BOARD_PAGE (one column, eight cards) at 390×900 with has_touch: getComputedStyle(grip).display is "none" and the card carries no .lf-board-destination. At the merge base the same reader could press-hold the grip and drag; "so touch works" is the phrase this commit deletes from the module header.
The registry entry still says cards "move between columns or reorder within one", and #send still distinguishes "Reordered in" from "Moved to". If giving up ordering on phones is the intended trade, those are the places that should say so; if it isn't, the grip can stand beside the destination row instead of being replaced by it.
"Return to queue" drops the reader's focus to <body>. #render hides the button that was just pressed (button.hidden = !event) and nothing takes the focus it held, so a keyboard reader returning a card lands back at the top of the document and has to Tab in again before the next one — on what this PR makes the deck's primary reversal path. Measured on SWIPE_PAGE: focus the Return button on #swipe-a, press it, and document.activeElement is BODY. The returned card is the destination that fits — #render already gives it tabIndex = 0 as the new active card.
Test selection run against this head
tests/test_render_widgets.py -k "board or card" (18 passed), -k "phone_board or swipe" (15 passed), tests/test_render_projection.py (103 passed), and tests/test_render_export.py -k "stands_on_its_own or copy" (21 passed) — all green, so neither finding is something the suite states today.
Add an experimental, untested App Server launcher and observer so Leaf can show live Codex activity and wake later turns through the same task queue. Keep the observer read-only, constrain endpoints to local transports, preserve the durable fallback queue, and stop offline adapters instead of spinning after their page server is gone.
leaf-agent
left a comment
There was a problem hiding this comment.
The deck's Return now restores focus, but the phone board's destination press still drops it. #names() sets button.hidden on the button the reader just pressed — after the move it is the one naming the card's own column — and the browser sends focus to <body>. The same press also leaves the card it moved almost entirely off screen: #destinations calls #place with no fourth argument, so neither the grip.focus() nor the card.scrollIntoView that #place runs for the keyboard route fires.
Measured on SQUEEZED_BOARD_PAGE at 390×900 with touch, pressing "Move Perch 0 to Lane 1": document.activeElement is BODY, the board's scrollLeft stays 0, and the 300px card ends with 7px of itself inside the board's box. The reader's only confirmation is the "Moved to Lane 1 — sent" notice; the card, and the "Move to Lane 0" button that would reverse the move, are both off screen and reachable only by scrolling the board by hand.
The new case does not state this, because Playwright scrolls a tap target into view before pressing it — to_lane_0.tap() performs the reveal the widget skipped.
Passing the card's grip — visible again on phones after this head's theme change — into #place's existing fourth argument covers both halves. With it, focus lands on the moved card's grip ("Move: Perch 0 — Lane 1"), scrollLeft becomes 326, and the card is fully on screen.
Test selection run against this head
tests/test_render_widgets.py -k "board or swipe or card or suggestion" (37 passed) and tests/test_render_projection.py (103 passed), both green unmodified — so nothing in the suite states the focus or the reveal today. With the suggested line applied, -k "board or swipe or card" stays green (29 passed).
…1219) Undo. The server's view of each revision now emits the final list of gestures that document can take back, and the browser applies no rule of its own: `z` takes the head, a widget's Undo filters it to its own entries. The view drops an approval of another stamp, an action whose widget and verb the document (or frozen thread markup) does not hold, and a page action a later revision restated. `z` no longer requires an action to have been made on the shown revision, the rule #450 stated for both paths and #666 dropped from the widget path so carried decisions stay undoable; a later revision's markup placing the unit is refused at the door (`absorbed`), and the restated case is now the view's. `z`, the widget undo branch, and reactions withdraw through one `withdraw(event)` door, and the controller no longer restates the candidate lookup. Behaviour that moved: - `z` takes back a decision carried into a later revision, as the widget's own Undo already could. - `z` takes back a thread widget's action even while its element is not rendered, instead of skipping to an older gesture. - A reaction chip withdraws a standing reaction while an unrelated gesture is sending or a reading is being applied; like a widget's Undo, it waits (with the same notice) only while another accepted action awaits presentation or the reaction itself is unsent. The `z` walk alone needs the page settled, since its target is whatever is newest. - A widget undo the page refuses now says why. Server view. The publisher resolves the shown revision's view once, as `effective.view` less its transport basis, replacing `effective.updates`, `publishedAt`, and `lifecycle`. `runtime.view`, updates.js, the undo walk, and projection coverage read it. Semantic news now reads page obligations from the shown revision rather than the active one, so an Ask a waiting activation adds becomes news when a revision holding it is presented. state-application's `stale()` is the publisher's `overtaken(state)`, which `adoptable()` also uses. Watchers. `watchAsks` is now `watchProjection` with its own reading, as `watchUpdates` and `watchHistory` already were: first call on the next microtask, coalesced per microtask, nothing while the owner is disconnected. It no longer calls synchronously, and it may repeat an unchanged set. packages.md, projection-watch.js, and updates.js state that. `COLLAPSE` lives in runtime/collapse.js, which passages.js, the composing modules, and projection/model.js import; the Python parity test reads it there. passages.py's comment still names leaf.js as its home; that file is held by another change. Checks run locally: `npm run check:browser`, `npm run test:browser`, `npm run test:runtime`, pre-commit, `tests/test_interact_server.py`, `tests/test_interact_contract.py`, the everyday browser files this touches (`test_render_semantic_news.py`, `test_render_application_boundary.py`), and the nightly undo, watcher, and version selections (`test_render_outbox.py`, `test_render_reactions.py`, and `-k` selections of projection, widgets, margin, options, navigation). > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
On phones, boards give one column most of the available width and expose direct destination buttons on each card, so moving to an offscreen column does not depend on dragging. Swipe decks keep their left/right classification gesture and add a Return to queue button to each classified row. Returning the finishing card reopens a completed deck. Narrow desktop windows retain the existing drag and keyboard controls.