Skip to content

feat(mobile): copy fork and quote thread content - #385

Merged
nixuuu merged 1 commit into
feat/mobile-viewers-2from
feat/mobile-viewers-3
Nov 9, 2026
Merged

nixuuu merged 1 commit into
feat/mobile-viewers-2from
feat/mobile-viewers-3

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Adds the remaining thread-content actions on mobile: copy messages and the last answer, fork after an ended turn, quote passages with comments, and open sent file attachments. It completes the image and full-output viewers in the preceding stack layers.

Behavior

  • Copy is available for user and agent messages, code, outputs, diffs, sanitized error details and the turn's last answer. Fork uses the same owner-scoped CreateThread request and eligibility as web, then opens the new thread. Web does not show a fork confirmation.
  • Quote passages from answers, reasoning, code, outputs and diffs. Edit or remove draft quotes, send quotes without additional text, and inspect sent quotes and their source. Source reads use a targeted history page, including sources outside the loaded timeline window. Limits match the gateway.
  • Sent attachment badges open image/text viewers or file export. Every image attachment also has a thumbnail, including attachments placed in message text. Inherited images and output blobs use their source thread for authorization and home routing.
  • Full diffs and Markdown diff/patch fences reuse timeline layout/color/whitespace/wrap preferences. Large text uses bounded virtualized chunks; each chunk can be quoted. Image decode failures offer retry/export, screen readers can adjust zoom, and full-screen modals own their safe areas.

Validation

Passed locally on the integrated top branch: bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check, bun run check:tmp, and bun run --filter @canopy/web build. The foreground full suite completed with 1871 pass, 161 skip, 0 fail across 331 files; check:tmp reported nothing left in the test temp directory. No load-related test reruns were needed. Final viewer-only adjustments were checked with mobile typecheck, lint and formatting. The stack remains draft.

Focused gateway checks: attachments (20 pass), owner-scoped linked-home content blobs (2 pass), quotes (4 pass), gateway UI including fork-from-turn (17 pass). No UI tests were added or run. No proto, dependency, native or runtime configuration changes.

Production fingerprints generated with bunx [email protected] fingerprint:generate --platform <ios|android> --build-profile production --json --non-interactive before and after this layer:

  • iOS: 2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3 → unchanged.
  • Android: c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d → unchanged.

Manual device checks (pending)

Installed simulator clients cannot execute this checkout, and native builds were excluded. Run these with a compatible client on iOS and Android, in light/dark mode, with reduced motion, phone/tablet widths, and short/typical/very long names and text:

  1. Open transcript/tool images, placed and loose message images, and composer thumbnails before/during/after upload. Pinch, pan, dismiss by swipe/close/back, and use screen-reader zoom. Export an image whose transcript preview format differs from its original extension. Retry an unavailable or unreadable image.
  2. Open long inline output, stored command/tool/background output and stored diffs, including a single huge line, Unicode near chunk boundaries, and the 8 MiB limit. Scroll to later chunks, copy and quote them; inspect both diff layouts, palettes and wrapping.
  3. Copy a user message, an agent message and the last answer. Fork completed/failed/interrupted started turns, including inherited turns. Confirm the new thread's history/settings and verify that running/unstarted/Grok/bot turns offer no fork.
  4. Quote prose, reasoning, code, output and diff; edit/comment/remove, send quote-only messages, steer into a running turn, and inspect the sent source after paging it out of the timeline. Retry after a failed send, both unchanged and after editing a quote.
  5. Open UTF-8 and binary attachments, export/cancel/retry, then repeat image/blob/source reads through a linked computer and inherited fork history. Check long header truncation, keyboard/safe-area edges, scroll containment and fixed action positions.

Copy audit (§8)

  • Missing message/footer actions → Copy message, Copy answer, Copy error details, Fork from here: direct verbs and existing glossary terms.
  • Missing quote flow → Quote passage, Add quote, Save quote, Remove quote, Show source: each label names one action; optional comments are explicitly labeled.
  • Inert attachment badges → actionable viewers with Save file / Share file. Size limits name the bound and ask for a smaller file/section. Load/export/fork errors say what failed and how to retry; provider errors and credentials are not surfaced.
  • No humor, new glossary terms, color-only instructions or repeated status facts. Long strings use wrapping/truncation and fixed icon slots. Source/layout inspection completed; device visual and accessibility checks remain pending as listed above.

Remaining differences and limits

  • Native selected-text menus cannot gain a custom Quote action with the installed JS-only APIs. The editable passage flow provides quoting without a native module; large output chunks allow excerpts beyond the first 20,000 characters.
  • TeX remains source text. Web uses KaTeX HTML/MathML; no installed mobile typesetter or WebView can render that output. Non-diff code remains plain monospace because web's syntax-highlighting engine is not a mobile dependency. This task excludes dependency/native changes.
  • Image export uses the iOS share sheet and Android directory selection. Direct photo-library saving and Android binary sharing need a native capability not provided by the installed share API. No permissions/modules were added. Cancelling Android directory selection may show the retry message.
  • PDF/office/binary files are exported for another app, matching web's download behavior. Text viewing is limited to 8 MiB; image/file reads to 20 MiB (transcript blobs also obey the gateway's 8 MiB bound).

This stack remains draft. Interactions/approvals/question formats and management screens are handled separately.

@nixuuu
nixuuu added this pull request to stack #379 November 9, 2026 08:54
@nixuuu
nixuuu force-pushed the feat/mobile-viewers-3 branch 4 times, most recently from edfa945 to a58b6d9 Compare November 9, 2026 09:22
@nixuuu
nixuuu force-pushed the feat/mobile-viewers-3 branch from a58b6d9 to 4f30a32 Compare November 9, 2026 09:31
@nixuuu
nixuuu marked this pull request as ready for review November 9, 2026 09:33
@nixuuu
nixuuu merged commit 9196c8e into dev Nov 9, 2026
17 of 19 checks passed
@nixuuu
nixuuu deleted the feat/mobile-viewers-3 branch November 9, 2026 09:44
nixuuu added a commit that referenced this pull request Nov 9, 2026
Normal thread work is available from mobile: one shared action sheet
opens from the header or sidebar long press, queued messages can move or
steer immediately, and thread details expose usage, paths, grants,
schedules, worktrees and background tasks.

The action sheet respects confirmation preferences and uses the existing
lifecycle RPCs. Thread and queued-message deletion provide an 8-second
Undo; deleting an open thread or its parent navigates away and Undo can
reopen it. Queue ordering preserves platform turns and leaves the
default steer/queue preference unchanged.

Details show own-turn token/cost totals, label partial totals as “loaded
turns”, show the latest reported context window, and copy
directory/worktree paths with expo-clipboard. Schedule links filter the
existing editor to this thread. The worktree link opens the current
worktree without bulk cleanup controls. Paged snapshots retain
background task items outside the loaded turn window, so the list
survives reopening.

Validation:
- Gateway history integration: 7 passing tests, including background
task retention outside the tail page, reopening and page deduplication.
- Full gate passes on the rebased top branch: install, gen:check,
typecheck, lint, format:check, check:tmp and web build. The full run
finished with 1,890 pass, 161 skip, zero failures and clean temp
cleanup. No UI tests or native builds.
- Production fingerprints before/after, EAS CLI 27.4.1: iOS
`2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3`; Android
`c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d`. Both unchanged; no
dependencies or native configuration changed.

Copy audit — docs/copy.md §8:
- Before: queue edit/delete and “Steer now”. After: “Move up”, “Move
down”, “Move to top”, “Move to bottom” and “Undo” name the added
actions. Existing “Steer now” and “Move to a computer” wording is
preserved.
- “Delete thread?” repeats its verb in “Delete thread”; its description
explains side threads, stopped work, cancelled schedules and Undo.
“Usage · loaded turns” avoids claiming complete totals.
- Empty states and errors are short, actionable and use existing terms.
Long text wraps or truncates with full paths selectable; state also has
words. Static copy review completed; the visual matrix remains manual.

Manual checks after a compatible OTA is available:
1. Check 360/390 dp phone and 600/768 dp Fold widths, light/dark,
reduced motion, 1/30/160-character titles and 240-character paths. Check
overlays, scrolling, clipping and reserved control space.
2. Open actions from both entry points. Pin/unpin, regenerate, rename,
read/unread, archive/unarchive and delete; vary all three confirmation
preferences. Delete an open child through its parent and Undo. Confirm
the active goal has no duplicate menu control. Open “Move to a computer”
for a local thread and verify the existing preview/placement flow.
3. Queue four own messages with an intervening platform message. Move
each direction and to both ends; steer text and a message with files
during a running turn. Delete/Undo and edit a queued message, then
verify the delivery default still matches Settings. Send files with both
delivery choices and check the delivery note from a home that cannot
steer attachments. Open the landed image/text attachment previews.
4. Copy both paths and open schedules/current worktree. Check thread
scoping, add/edit/pause/resume/cancel a schedule, and verify worktree
status/removal still requires the existing safety confirmation.
5. Start background work, finish its foreground turn and reopen a long
thread. Stop the task from details and use “Show full output”; the
shared full-screen viewer reads inline or blob output and offers
Copy/Quote. Close it to return to details. Compare usage before/after
loading earlier turns.

The final rebase includes #377–#378 and #385. Background tasks now reuse
the landed TextViewer; there is no timeline-link fallback or separate
output viewer. Existing quote and send behavior is preserved.

Layer 2 of 3. Rebased onto dev at `8fb894e4`: preserves #393 attachment
steering, #398 previews and #388–#390 bot/settings parity, including the
local thread move action. Existing bases and ready-for-review states are
preserved.
nixuuu added a commit that referenced this pull request Nov 10, 2026
Finished mobile answers showed Copy message/Quote passage above a second
Copy answer/Fork/time row. They now have one row: Copy answer, Quote
passage, Fork from here, elapsed time. Copy and Fork keep their relative
web order; Quote uses the existing passage editor and preserves the
answer item's source.

Interim and final agent messages share a long-press Message actions
sheet with Copy message and Quote passage, also exposed through
accessibilityActions. User messages had only Copy; that action moves
into the same long-press sheet, including folded agent-authored input
bubbles. Read-only history keeps copying and the existing quote/fork
restrictions.

The answer controls have real 48 dp cells, align their first icon with
the prose, and remove the extra completed-answer/footer gap. Copy
retains the existing check icon and Copied accessibility announcement.
The shared picker handles presentation and reduced motion; quoting waits
for its native modal to dismiss. No native dependencies or configuration
changed. docs/mobile.md describes the new behavior.

### Verification

- Passed bun install, bun run typecheck, bun run lint, bun run
format:check, and git diff --check. No UI tests added or run; web code
is unchanged, so no web build was needed for this change. CI remains the
full gate.
- Ran bunx [email protected] fingerprint:generate --platform ios
--build-profile production --json --non-interactive and the Android
equivalent before/after. Complete JSON outputs compare equal. iOS:
6ddec9ef559ee0095ac33e94ff9418a942053b17. Android:
5f6eae3ab278f1cd543e9ed763f923a319b65ec9.
- Inspected web AgentMessageView and TurnDetails and checked the
existing synthetic timeline in a real browser on a disposable private
stack at 390×844 and 1280×800, light and dark. One Copy answer per turn;
no extra message action row or horizontal page overflow. The preview
cannot emulate pointer hardware, so existing hover:none/pointer:coarse
CSS rules were forced in the browser for this layout check. Web needs no
duplication fix.
- Native devices are unavailable. Expo web is explicitly unsupported by
apps/mobile/AGENTS.md. Mobile layout, source IDs,
streaming/empty/read-only cases, fold behavior, and modal handoff were
reviewed in code; native long-press and VoiceOver/TalkBack behavior
remain unverified. Screenshots cover web only and are kept outside the
repository.

### Copy audit (docs/copy.md §8)

- Before: two icon rows with Copy message and Copy answer for the same
response. After: one answer row with Copy answer, Quote passage, Fork
from here, and duration; the long-press sheet reuses Message actions,
Copy message, and Quote passage. Existing glossary terms, sentence case,
and verb-first action labels are retained.
- Icons remain compact to avoid crowding the phone-width row. Each has
an explicit accessibility label; the message gesture has the existing
Long press for message actions hint and a named screen-reader action.
The sheet provides text labels; copying retains the existing
check/Copied confirmation without changing control size. No extra toast
or persistent labels were added.
- No new error, empty-state, confirmation, jargon, glossary term,
repeated fact, or expressive sentence. Short labels and long message
bodies were reviewed against the shared picker/typography rules; actual
native wrapping and assistive technology behavior require a device
check. Web short/long fixture content and title truncation were checked
at phone and desktop widths in both themes.

Related: #385
nixuuu added a commit that referenced this pull request Nov 15, 2026
## Change

With a long passage, the mobile quote editor could leave the comment and
save action below the keyboard. Give the passage its own bounded,
scrollable preview and a separate **Edit passage** mode. The comment and
full-width **Add quote** / **Save quote** action stay in a fixed footer
that becomes compact when the available space above the keyboard shrinks
and uses a side-by-side layout in landscape.

Render explicitly marked Markdown, preserve plain text and code
formatting, and place source details and actions before the passage.
Keep the 20,000-character notice inside the preview and hide it after
shortening. Update the implemented behavior and status in
`docs/mobile.md`.

## Verification

- Local mobile typecheck: `bun run --filter @canopy/mobile typecheck`.
- Oxlint and oxfmt on the three edited quote components; `git diff
--check`.
- Native Android development client: light/dark themes, 320×568 dp with
enlarged interface text, portrait/landscape, short and long passages,
code, long PR metadata and the 20,000-character limit. Checked passage
editing, saving/reopening a comment, and the save/remove row layout.
- iOS device verification remains unavailable. Full repository checks,
tests and builds are left to GitHub CI.

## Copy audit

Pass, with no failed items. Replace the instructional banner with the
concrete **Edit passage** action. Replace “Quotes can contain up to
20,000 characters. Keep a shorter passage.” with “This quote includes
only the first 20,000 characters. Edit the passage to shorten it.” to
explain the included text and the next action. New action labels use
verb-first sentence case; the remove icon keeps the accessible label
**Remove citation**. Checked short and long content at narrow and wide
native viewports.

Fixes: #385
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.

1 participant