Repository navigation
feat(mobile): right-align folded steps, generic tool glyph, pinch-zoom image previews - #659
Merged
Merged
Conversation
…-zoom previews Three follow-ups on the folded step line, plus zoomable image previews. Folded step line: - The tool count is a wrench, not the terminal it started as: the count now covers every tool kind (run/read/write/edit), and a shell prompt claimed they were all commands. - The glyph sits flush against its count — "wrench x5" reads as one token — while the kinds stay spaced apart around their separator. Preview: - Image previews pinch to zoom (up to 6x) and drag to pan, built on RN's own PanResponder/Animated: the app ships no gesture stack, and adding one plus its native build config is a lot of dependency for one interaction. Panning is limited to the overhang the zoom created, so the picture cannot be dragged out of view; releasing below 1.05x springs back to fit.
huichen
enabled auto-merge (squash)
September 16, 2026 08:11
This was referenced Sep 16, 2026
huichen
added a commit
that referenced
this pull request
Sep 16, 2026
… their own line (#671) Two things had to be true at once, and the last change bought the second by giving up the first: a revealed file name needs the row's leftover width, and a row that shrinks to a right-rail badge has no leftover width to claim. Inline, the target's `flex: 1` therefore resolved to zero inside the badge — the file name was invisible — so #668 parked every row in the left reading column and left the revealed target inline. Put the target on its own line below the header and the conflict disappears. The header goes back to a one-liner with nothing to wrap, so the row can shrink-wrap again, and the target gets the full width at its own indent: names wrap instead of being clipped, and the chevron stops landing mid-sentence between the label and the path. Shell commands already worked this way; file targets now use the same line, which also removes the separate `inlineToolTarget` style. With the geometry free again, the rails from #659/#660 come back: a row is a badge on the right rail while nothing of it is revealed, and falls into the reading column once it — or the run around it — is open. The run summary keeps its rail when it opens, so the line under the user's finger does not move while the rows it revealed appear below it on the left. `opened` is a required prop again, so no call site can pick a rail by accident. Tests: the rail assertions from #660 are restored (folded summary and lone rows on the rail; opened rows and their detail off it), together with #668's no-truncation assertions, plus a check that the revealed target is a line of its own rather than a cell beside the label.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second round of feedback on the folded step line (#656, #657), plus a preview improvement.
Folded step line
Everything a run owns now hangs off the right edge — the summary line, the rows it opens, and the detail those rows open in turn — so the left edge of the transcript belongs to the prose alone. That was the point of folding the apparatus away.
The summary carries no wording — a glyph and a count per bucket — because the line has to survive in a phone's margin. The wording is not lost: it is the row's accessibility label (
Tool calls 5× · Thought 3×), which is also where a failure is named, since the alert glyph is told apart by shape and never by colour.One tool bucket. Run/read/write/edit all count as "tool calls": at this altitude the question is how much work happened, and four separate counts read as a list of numbers nobody parses (the original Chinese feedback: "已运行5次已思考三次,已写入一次,这种文案太啰嗦,合并一下"). Which tool it was is what the expanded rows are for.
The tool glyph is a wrench, not a terminal — the count stopped being about shell commands the moment it covered read/write/edit too.
The glyph sits flush against its count (
🖥×5is one token); only the kinds are spaced apart, around their·.Failed and still-running calls keep the behaviour from #657: a failure folds and counts as a tool call while the summary flags it; a call still in flight stays on screen, since folding live progress would hide it.
Image previews pinch to zoom
PreviewModal's image branch now renders aZoomableImage: pinch to zoom (1×–6×), drag to pan while zoomed.PanResponder/Animated. The app ships no gesture stack, and addingreact-native-gesture-handler+reanimated(and their native build config) is a lot of dependency for one interaction.(scale-1)/2frames per side — so the picture can never be dragged out of view and lost.onStartShouldSetPanResponderis false), so the surrounding UI keeps its touches.The arithmetic that carries the behaviour (zoom bounds, pan limits, pinch distance) lives in exported helpers and is unit-tested directly rather than by synthesizing native touch histories.
Tests
TimelineCard.test.ts(16 cases): folds into one icon/count line; the spoken form stays complete; expanded rows keep icon + words; four tool kinds merge into one count; zero buckets are omitted; a failure folds, counts and is flagged without colour; glyph flush against count; every level right-aligned; streaming tail never folded.zoomableImage.test.ts(3 cases): pinch distance, zoom clamping, pan clamping to the overhang.Local (mobile-scoped, after merging
origin/main):npm run typecheck✅ ·npm run lint✅ ·npm test— 97 suites / 1355 tests ✅