Skip to content

Open pasted text in structured chats - #35636

Merged
brennanb2025 merged 73 commits into
mainfrom
brennanb2025/chat-pasted-text-viewer
Nov 3, 2026
Merged

brennanb2025 merged 73 commits into
mainfrom
brennanb2025/chat-pasted-text-viewer

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2699 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2684
Prod 76 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3311 $\color{#cf222e}{\Huge{\mathbf{−}}}$​539 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2772

Problem

Large pastes become compact attachments in structured chats, but users cannot open the pill or inspect the original text from a sent message, another computer or a phone.

User-facing change

Open pasted text and committed text attachments from a draft, a sent structured message or an expanded structured-chat goal objective. Desktop opens a large centered modal with Copy contents and Save file. The header and actions stay visible while the reader scrolls inside the modal. The phone opens the existing file-preview screen. Both use a scrolling reader, including for huge files and single-line text. Copy and Save export the original source exactly, within their existing limits.

The viewer reads from the owning host, including paired clients. Missing files, changed sources and older hosts explain the limitation in the preview. Opening uses the existing attachment store and does not change attachment lifetime. One bounded reader RPC and its advertised capability let independently updated clients use the reader when the host supports it. Terminal-backed chats retain their existing behavior.

Temporary

Full phone Copy above the released bridge frame and phone Save remain disabled with an explanation. Phone paste folding and explicit paste-as-text, including Mod+Shift+V, arrive in follow-up F2, tracked in #32355. Full phone export above the bridge frame belongs to that same F2 cut.

Intended differences from the common pattern

The desktop reader uses a large centered modal at Brennan’s explicit request. It reuses the existing Dialog primitive, bounded by the window with an internally scrolling reader. This presentation is intended; source ownership, export limits and phone presentation are unchanged.

Saved, imported, recalled and older-peer message representations reopen the original source, so identity comes from the original tokens without adding durable attachment metadata. The reader fetches bounded byte ranges and displays short segments for very long lines, retaining access to the complete supported source. Export remains separate from the displayed portion. Copy retains the existing 16 MiB clipboard limit; inspection and desktop Save support the attachment store's 50 MiB limit. Independently updated paired hosts retain capability and owner checks. Undo and removal retain existing attachment-aware behavior.

Editable fields keep the platform's normal text size and the web minimum that prevents focus zoom, including larger theme sizes and pinch zoom. The shared typography token keeps that policy consistent across the existing fields.

The scroll track scales only where needed to stay within browser geometry limits. Width learned from a source stays available while previously read text leaves the cache. Retry uses the existing preview recovery control. These support remote and phone reads without truncating the attachment or adding a pager.

Existing performance issues in main remain tracked in STA-12852 and STA-13152. They affect repeated repository and workspace-owner lookups across many retained chats. The performance tests report that existing work separately while keeping the original limits on this PR's work.

Verification

CI on reviewed/pushed 68182662dde8fbf61f772f018849d91bf1615cc3 completed with 37 successful checks and 21 conditional skips, with no failed or pending checks. Mobile verify, compiler/static analysis, the shipping mobile bundle, both package jobs and all three WSL distro checks passed. The primitive style-role errors from the first modal commit are repaired without changing reader behavior or weakening a gate. The earlier Mobile timeout remains repaired by the finite 15-second budget for the existing composite case, retaining its full callback and all 46 assertions. The audited main merges remain ddb7d98805cb40338e4d33062bb02011abf81c01 and 4bddac07f6f09f6a4de3007a0945dfb8d7f8b7c6. Independent log inspection confirmed the full changed-code-quality gate and compiler ran successfully, the desktop Dialog composite and both companion tests passed, and the complete installed mobile renderer case passed in 5.929 seconds. The normal shipping verifier reproduced the accepted 181-asset web bundle without relaxing its limits.

The requested desktop modal revision has focused renderer tests of the actual Dialog’s focus entry, Escape, Close and existing reader/export paths (2 files, 3 tests passed). A quick component-fixture run rendered the production component at actual 1440×1000 and 800×600 viewports: the modal is centered, uses 88% of window height, keeps at least 16px margins and leaves the header and Copy/Save controls visible while the reader scrolls internally to End. The subsequent style-role markup repair retains those visual constraints. Independent review accepted the screenshots at 8849970fb5fe5f9cde2a3aec3948b0c435ae6f36 and their carry across the behavior-preserving markup repair 68182662dde8fbf61f772f018849d91bf1615cc3; no pixel-identity or new screenshot capture at the later commit is claimed. These are presentation checks, with no new phone or provider run.

Retained checks for unchanged source, export and agent flows on desktop and native iOS Simulator used build 0a77155. Independent review confirmed that the later CI repairs preserve the exercised behavior; the changed phone scrolling geometry has its own tests and targeted shipping check below. On each surface, Claude and Codex were sent a message through the real UI, returned real replies, and their actual sent attachments opened and scrolled. Desktop also exercised folding and opening before Send; the phone exercised Files upload and opening before Send. Copy on both surfaces matched the complete 98,304-byte fixture exactly. Large 25 MiB display checks used diagnostic saved attachments; they are display evidence, not upload or Send evidence.

Earlier desktop End/Home, resize, horizontal continuity and wheel handling evidence remains valid for the unchanged reader; those old sidebar screenshots do not demonstrate the new modal layout. Phone whitespace, horizontal continuity and orientation were checked. On the iOS Simulator, an ordinary drag after an extra fling at End could leave the ending text visible. The complete bounded trace established that row lookup used a position bounded by the modeled track, while placement used raw overscroll, allowing rendered text to enlarge the scrolling area. The repair uses the same valid coordinate throughout the reader and contains the existing phone track. The targeted shipping check at ddb7d98 used the exact 98,304-byte fixture: after reaching End, one extra fling and a quiet interval, one drag moved End off screen and earlier rows filled the view. Back, title, actions and status remained visible at release and settlement. The earlier loss of header/status presentation was not reproduced; its separate cause remains unknown. Independent review accepted this bounded observed result and found no concrete introduced native failure requiring another run; the current native shell itself was not executed.

That targeted check used the explicitly admitted existing Release native shell installed on its own new simulator and the current production web assets, all byte-verified against the normal shipping build. It did not dispatch new provider turns. It proves this interaction on that shell, not a physical device, universal one-to-one gesture tracking, exact row distance or full 50 MiB native traversal.

Save's exact bytes, completed export and cancellation paths are covered by tests. Native chooser completion and a saved-file disk hash were not exercised. Font measurement and anchor changes are covered by renderer tests and screenshots; the app font shortcut was not exercised successfully. This is Release-build iOS Simulator evidence, not a physical-device claim, and does not claim universal one-to-one gesture tracking.

The test reduction retained observable regression and transport contracts and removed obsolete pager scenarios and duplicate matrices. The current generated size summary above is the authoritative PR count.

Current desktop modal, rendered from the production component in headless Chromium at the actual window sizes shown. These screenshots cover presentation and internal scrolling; retained agent evidence below covers unchanged Send and source/export flows.

Large desktop window — 1440×1000 Small desktop window at End — 800×600
Large centered text modal Small centered text modal with internally scrolled reader
Phone draft reader Phone sent attachment at End
Phone draft reader Phone sent attachment at End
Phone at End before the extra fling Phone after the single drag, released Phone after settlement
Phone reader at End Earlier rows and full phone header after drag Earlier rows and full phone header after settlement

Retained real replies after UI Send, for unchanged agent flows: desktop Claude, desktop Codex, phone Claude, phone Codex.

The source Mac genuinely lacks the declared react-test-renderer package. Nothing was installed or borrowed to work around it; installed renderer verification runs in CI.

Historical QA disclosure: an earlier desktop setup unintentionally dispatched two real Claude turns in the disposable home, and its lead made a read-only screenshot probe outside the designated driver before the checked flow. Neither counted as agent QA. That superseded pager run used qa-drive for its checked flow, and its phone run used no provider turns. Those processes, simulators and disposable homes were cleaned up, with real configuration hashes unchanged. The current scrolling-viewer checks use the actual UI Send evidence listed above; the changed interaction is documented separately above.

This takes the full review path because it exceeds the small-change limit and adds a cross-client reader RPC/capability. The retained real-agent checks exercised ordinary UI Send with Claude and Codex, real replies and each actual sent attachment. The later desktop shell revision has focused renderer tests and full-viewport component screenshots; it does not imply another provider or phone run.

Tracked in #32355.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 29, 2026 05:05
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge, with the existing non-blocking page-entry issue still open.

Findings

  1. P2 Page entry stops early ▶

Summary

Adds bounded text-attachment previews to structured chats on desktop and phone.

  • Desktop structured chats open text attachments in a side sheet.
  • The owning host serves text attachments as bounded byte ranges.
  • Phone users open text attachments in the existing file preview.
  • Worktree lookups now keep records separate by owning host.

Diagram

sequenceDiagram
  participant User
  participant Preview
  participant Host
  participant Store
  User->>Preview: Open text attachment
  Preview->>Host: Check reader capability
  Host-->>Preview: Supported capabilities
  Preview->>Host: Request bounded byte range
  Host->>Store: Check path and source snapshot
  Store-->>Preview: Bytes and snapshot
  Preview-->>User: Show bounded text rows
Loading

Reviews (14) · Last reviewed commit: "Share attachment capability through its ..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

The change adds structured attachment references and previews to native chat on renderer and mobile clients. A shared source reads attachment content in validated chunks, checks snapshots, and supports paging, copying, and byte export. A workspace RPC connects clients to authorized attachment reads. RPC transports add cancellation and pre-send checks. Workspace selectors and runtime-context routing also change.

Merge Risk: Low · up to ce5b0

Phone page navigation can be awkward, and several safeguards lack reliable tests. The remaining issues are bounded; the change is mergeable with owner awareness and follow-up.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 18.97% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the primary user-facing change: opening pasted text in structured chats.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is substantially complete. It explains the problem, user-facing behavior, implementation scope, limitations, testing, verification results, visual proof, compatibility considerations, …
Full details: Description check

Explanation

The description is substantially complete. It explains the problem, user-facing behavior, implementation scope, limitations, testing, verification results, visual proof, compatibility considerations, and linked issues. It does not use every template heading explicitly, and it does not provide a clearly labeled risk level, rollback plan, or AI disclosure, but these omissions do not make the description incomplete or off-topic.

Full details: Docstring Coverage

Explanation

Docstring coverage is 18.97% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 58 functions across 76 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Resolve merge conflicts
  • Resolve merge conflict in branch brennanb2025/chat-pasted-text-viewer
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Nitpick comments: 2
src/renderer/src/components/native-chat/NativeChatTextAttachments.test.tsx: 1

153-157: Trivial · Functional Correctness · Quick win

Make the negative clipboard assertion wait for the failure.

expect(mocks.write).not.toHaveBeenCalled() runs right after release(). The copyText() continuation may not have finished by then. If it has not finished, the test passes without proving that source.assertCurrent() blocked the write.

Wait for the visible stale-connection error first. Then assert that the clipboard was not written. The reader message Connection changed. Close this attachment and reopen it. comes from createChatAttachmentReader. The preview may show a different message on this path. Match the message that source.assertCurrent() actually produces.

✅ Proposed fix
   await act(async () => {
     replaceRuntimeEnvironmentRevisions([{ id: 'env-text', createdAt: 2 }])
     release()
   })
+  await screen.findByRole('alert')
   expect(mocks.write).not.toHaveBeenCalled()
mobile/src/files/mobile-chat-attachment-read.test.ts: 1

56-65: Trivial · Functional Correctness · Quick win

The final assertion does not test chunk-reply validation.

sendRequest.mockResolvedValue(...) replaces the response for both status.get and the range request. The malformed response fails the capability check before the chunk request runs. Since the assertion checks only rejects.toThrow(), it does not prove that the chunk response was validated.

Keep the status.get response valid and assert the chunk-specific error.

Proposed fix
-  sendRequest.mockResolvedValue({ id: '2', ok: true, result: { contentBase64: 'a' } })
+  sendRequest.mockImplementation(async (method: string) => ({
+    id: '2',
+    ok: true,
+    result:
+      method === 'status.get'
+        ? { capabilities: [AGENT_SESSION_TEXT_ATTACHMENT_READ_CAPABILITY] }
+        : { contentBase64: 'a' }
+  }))
...
-  await expect(replaced.page(0)).rejects.toThrow()
+  await expect(replaced.page(0)).rejects.toThrow('Unable to read this attachment')

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: abd0ab82-bce8-424b-a476-289d4a062135
Commits

Reviewing files that changed from the base of the PR and between da31480 and d8dbc2c.

Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 39
  • mobile/src/files/MobileChatAttachmentPreview.tsx
  • mobile/src/files/MobileFilePreviewScreen.tsx
  • mobile/src/files/mobile-chat-attachment-read.test.ts
  • mobile/src/files/mobile-chat-attachment-read.ts
  • mobile/src/files/mobile-file-preview-route.test.ts
  • mobile/src/files/mobile-file-preview-route.ts
  • mobile/src/session/MobileNativeChatView.tsx
  • mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx
  • mobile/src/session/native-chat/composer/MobileNativeChatComposerAttachments.tsx
  • mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tsx
  • mobile/src/session/use-mobile-file-tap-handlers.test.ts
  • mobile/src/session/use-mobile-file-tap-handlers.ts
  • mobile/src/session/use-mobile-session-file-actions.ts
  • src/main/native-chat/agent-session-attachments/agent-session-attachment-store.ts
  • src/main/native-chat/agent-session-attachments/agent-session-attachment-text-read.ts
  • src/main/runtime/mobile-rpc-allowlist.test.ts
  • src/main/runtime/rpc/methods/structured-agent-session-attachments.test.ts
  • src/main/runtime/rpc/methods/structured-agent-session-attachments.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-mobile-agent-session-methods.ts
  • src/renderer/src/components/native-chat/NativeChatComposer.tsx
  • src/renderer/src/components/native-chat/NativeChatFileReferencePill.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageRow.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx
  • src/renderer/src/components/native-chat/NativeChatTextAttachmentPreview.tsx
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.test.tsx
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx
  • src/renderer/src/components/native-chat/NativeChatUserMessageRow.tsx
  • src/renderer/src/components/native-chat/native-chat-pasted-text-state.ts
  • src/renderer/src/components/native-chat/native-chat-text-attachment-read.ts
  • src/renderer/src/components/native-chat/use-native-chat-transcript-row-context.ts
  • src/shared/agent-session-runtime-capabilities.ts
  • src/shared/attachment-text-source.test.ts
  • src/shared/attachment-text-source.ts
  • src/shared/doc-preview-file-access.ts
  • src/shared/native-chat-text-attachment-references.ts
  • src/shared/rpc-contract/agent-session-attachment-params.ts
  • src/shared/use-attachment-text-preview.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 89624ed2-80db-44dd-b65d-7e6ab862bcc3
Commits

Reviewing files that changed from the base of the PR and between d7f5ff9 and 63fb01a.

Files selected for processing: 27
  • mobile/src/files/mobile-chat-attachment-read.test.ts
  • mobile/src/files/mobile-chat-attachment-read.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-requests.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-rpc-envelope.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client.ts
  • mobile/src/session/native-chat/transcript/MobileNativeChatMessage.test.ts
  • mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tsx
  • mobile/src/transport/mobile-relay-rpc-session.test.ts
  • mobile/src/transport/mobile-relay-rpc-session.ts
  • mobile/src/transport/rpc-client-request-tracker.ts
  • mobile/src/transport/unvalidated-rpc-request-port.ts
  • src/main/ipc/runtime-environments/runtime-environments-subscription-lifecycle.test.ts
  • src/renderer/src/components/native-chat/NativeChatTextAttachmentConsumers.test.tsx
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.markdown.test.tsx
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.test.tsx
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-prompt-recall.test.tsx
  • src/renderer/src/components/native-chat/native-chat-text-attachment-admission.test.ts
  • src/renderer/src/components/native-chat/native-chat-text-attachment-read.ts
  • src/renderer/src/web/preload-api/web-runtime-calls.ts
  • src/renderer/src/web/preload-api/web-runtime-environments-api.ts
  • src/renderer/src/web/web-runtime-client.ts
  • src/renderer/src/web/web-runtime-subscription-contract.ts
  • src/shared/attachment-text-source.ts
  • src/shared/native-chat-text-attachment-references.ts
  • src/shared/remote-runtime/requests/remote-runtime-subscription-connect-bound.test.ts
Files with no reviewable changes: 1
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71a8185c-4d26-4ab7-9d0f-60ec05f970db
Commits

Reviewing files that changed from the base of the PR and between 63fb01a and 047546c.

Files selected for processing: 11
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.tsx
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.visibility.test.tsx
  • src/renderer/src/components/native-chat/native-chat-attachment-routing.performance.test.tsx
  • src/renderer/src/components/native-chat/native-chat-image-runtime-context.ts
  • src/renderer/src/components/native-chat/native-chat-tab-directory.ts
  • src/renderer/src/lib/structured-chat-tab-index.ts
  • src/renderer/src/lib/workspace-catalog-owner-index.ts
  • src/renderer/src/lib/worktree-operation-route.ts
  • src/renderer/src/lib/worktree-owner-route.ts
  • src/renderer/src/lib/worktree-runtime-owner-index.ts
  • src/renderer/src/store/slices/worktree-helpers.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comments: 1
mobile/src/files/MobileChatAttachmentPreview.test.tsx: 1

160-165: Trivial · Maintainability & Code Quality · Quick win

Add a test for the disabled phone Copy gate on oversized attachments.

The mobile suite never renders the preview with a committed attachment whose raw size is above the phone frame limit. It never asserts that Copy is disabled before it is pressed. The only refusal test uses a 120,000-byte fixture, which stays under the gate, so Copy is enabled.

The gate allows Copy only when source.size + 4096 <= MOBILE_BRIDGE_MAX_FRAME_BYTES, which is 651,264 bytes of raw size. The PR states that phone Copy above the released bridge frame stays disabled. A regression that removes or changes this gate would not fail any test. Pressing Copy would then run source.copyText() before the JSON size check, so the refusal would come after the full-source read.

Suggested fix
+it('disables phone Copy before press when raw size exceeds the bridge frame', async () => {
+  const bytes = Buffer.alloc(651_265, 'a')
+  serveAttachment(bytes)
+  const route = normalizeMobileFilePreviewRouteParams({
+    hostId: 'owner',
+    worktreeId: 'work',
+    source: 'chatAttachment',
+    absolutePath: path
+  })
+  await act(async () => {
+    tree = create(createElement(MobileFilePreviewScreen, { route }))
+  })
+  expect(button('Copy').props.disabled).toBe(true)
+  expect(mocks.write).not.toHaveBeenCalled()
+})

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b2c3dc58-6536-4b17-ac08-6477c2d4e814
Commits

Reviewing files that changed from the base of the PR and between 047546c and ce5b066.

Files selected for processing: 2
  • mobile/src/files/MobileChatAttachmentPreview.test.tsx
  • src/renderer/src/components/native-chat/NativeChatTextAttachments.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@brennanb2025
brennanb2025 marked this pull request as draft October 29, 2026 18:05
@brennanb2025
brennanb2025 marked this pull request as ready for review October 29, 2026 18:05
@brennanb2025

brennanb2025 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Review complete — current-head CI and the required evidence are accepted.

Large pasted text could be folded into a pill that could not be opened, and sent text attachments could not be inspected from another computer or phone. This PR opens the original source from structured-chat drafts, sent messages and expanded goal objectives. Desktop uses a large centered modal with Copy and Save; phone uses the existing file preview. Huge and single-line sources use a bounded scrolling reader. Terminal-backed chats retain main's behavior.

Six historical source-review rounds and the subsequent bounded repairs are complete. Fixes cover source identity and host routing, cancellation, exact exports, UTF-8 and long-line bounds, and scrolling continuity. The final whole-mechanism reference, performance, checklist and test-pruning reviews carry for unchanged scopes. Required design/repeat rulings remain recorded; no blocking finding is waived.

The last native scrolling defect came from using a bounded position to find rows but raw overscroll to place them. That let text enlarge the scrolling area. Commit00884b16663062ed240c60d31c5f230d08fd73a8 uses a consistent valid coordinate and contains the existing phone track. Its regression fails on the parent and passes with the repair; the installed RN-web composite case at the previously accepted 4bdd head passed in 5.941 seconds, including its retained late physical-extent, elastic-offset, compressed-overscan and exact export assertions. The finite15-second aggregate deadline in tests-only8a0fa916a3e519286c796e8970021b1567b1f44f retains the whole composite renderer case, all46 assertions and its per-condition waits.

CI on reviewed/pushed 68182662dde8fbf61f772f018849d91bf1615cc3 completed with 37 successful checks and 21 conditional skips, with no failed or pending checks. Mobile verify, compiler/static analysis, the shipping mobile bundle, both package jobs and all three WSL distro checks passed. The primitive style-role errors from the first modal commit are repaired without changing reader behavior or weakening a gate. The earlier Mobile timeout remains repaired by the finite 15-second budget for the existing composite case, retaining its full callback and all 46 assertions. The audited main merges remain ddb7d98805cb40338e4d33062bb02011abf81c01 and 4bddac07f6f09f6a4de3007a0945dfb8d7f8b7c6. Independent log inspection confirmed the full changed-code-quality gate and compiler ran successfully, the desktop Dialog composite and both companion tests passed, and the complete installed mobile renderer case passed in 5.929 seconds. The normal shipping verifier reproduced the accepted 181-asset web bundle without relaxing its limits. GitHub reports CLEAN/out of draft; all nine review threads are resolved.

Brennan’s Nov 2 request changes the desktop reader from a side sheet to a large centered modal. Commit 8849970fb5fe5f9cde2a3aec3948b0c435ae6f36 reuses the existing Dialog primitive; the header and Copy/Save stay visible while the reader scrolls internally. The existing renderer tests cover actual Dialog focus entry, Escape, Close and the original reader/export paths (2 files, 3 passing tests). The changed-screen check rendered the production component at actual 1440×1000 and 800×600 viewports, with centered 88%-height bounds, at least 16px margins, no outer-page overflow and internal scrolling to End. These are component screenshots, not a new Electron or provider run. The subsequent style-role repair 68182662dde8fbf61f772f018849d91bf1615cc3 retains the visual constraints through primitive-compatible markup. Independent review accepted the screenshots at 8849970fb5fe5f9cde2a3aec3948b0c435ae6f36 and their carry across the behavior-preserving markup repair 68182662dde8fbf61f772f018849d91bf1615cc3; no pixel-identity or new screenshot capture at the later commit is claimed.

Accepted real-agent QA head0a77155115d3a228590217684a13000429b92bcd covers desktop and phone draft opening, actual UI Send through Claude and Codex, real replies, actual sent attachments and exact98,304-byte Copy. For unchanged source/reader flows, desktop additionally retains folding, wheel, End/Home, resize and horizontal-continuity evidence. Earlier sidebar images are superseded for the current presentation. Phone whitespace, horizontal continuity and orientation retain accepted evidence. Large25MiB saved fixtures prove bounded display only. These are the original accepted provider runs.

The targeted shipping phone check at ddb7 used normal production web assets, all181 cache entries byte-verified, in the explicitly admitted older Release shell installed on a new own iOS Simulator. After End, one extra fling and2.5106seconds quiet, a single away drag exposed earlier rows, which remained visible after settlement. Back, title, bytes, actions and status remained visible. Independent review accepted this bounded result. The prior separate loss of chrome was not reproduced; its cause remains unknown. The current main native shell, exact row distance, universal1:1 finger tracking, uninterrupted intermediate presentation, physical devices and full50MiB native traversal are not claimed. No new Send/provider replay occurred in this check.

Test pruning9c9a9a79e8f06379312551edf0372fffb8c44fce and the scrolling revisionab30b86758105810e4fd95ea367c2e730ce81084 removed duplicate matrices and obsolete paging tests; confirmed bug guards and transport contracts remain independently checked. The PR's generated size summary is authoritative. Save byte/completion/cancel paths pass in tests; native chooser completion and a saved-file disk hash were not exercised. Font measurement/anchors have renderer proof; the app font shortcut was not exercised successfully.

Temporary: phone Save and Copy above the bridge frame remain disabled with an explanation; phone paste folding and paste-as-text remain F2, tracked in #32355. Intended differences and unchanged main lookup costs tracked in STA-12852/STA-13152 are documented in the body.

For Brennan's review

Current desktop modal, rendered from the production component in headless Chromium at the actual window sizes shown. These screenshots cover presentation and internal scrolling; retained agent evidence below covers unchanged Send and source/export flows.

Large desktop window — 1440×1000 Small desktop window at End — 800×600
Large centered text modal Small centered text modal with internally scrolled reader
Phone draft reader Phone sent attachment at End
Phone draft reader Phone sent attachment at End

Retained real replies after UI Send, for unchanged agent flows: desktop Claude, desktop Codex, phone Claude, phone Codex.

Phone at End before the extra fling Phone after the single drag, released Phone after settlement
Phone reader at End Earlier rows and full phone header after drag Earlier rows and full phone header after settlement

Human judgment spots: large modal and existing controls, bounded source/UTF-8 seams, canonical scroll coordinates.

Post-QA changes carried explicitly: 8273687baa4f57fe1048bc2813f53c4ad71d632b reuses the same subscription type; 526a4c0b2656d3cf072be1af54666c3aefd715f0 preserves attachment effect triggers through the existing Effect Event pattern. Both are independently accepted equivalent CI repairs. The tests-row scrolling repair 00884b16663062ed240c60d31c5f230d08fd73a8 has the targeted shipping phone check at ddb7d98805cb40338e4d33062bb02011abf81c01 plus current installed regression proof. The audited main merges are ddb7d98805cb40338e4d33062bb02011abf81c01 and 4bddac07f6f09f6a4de3007a0945dfb8d7f8b7c6; 8a0fa916a3e519286c796e8970021b1567b1f44f changes only the finite renderer test budget. Original real-agent QA remains 0a77155115d3a228590217684a13000429b92bcd, with these later scopes separately verified. No new Send/provider run is implied.

Final independent review and current CI are accepted. The required ruling check passed for 15 design/repeat findings and 10 rulings; no blocking finding remains.

Retain current main crew integration and subscription lifecycle alongside structured attachment routing and runtime identity pinning.
@brennanb2025
brennanb2025 merged commit 40820c4 into main Nov 3, 2026
58 checks passed
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