GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): mod+f opens find in read-only source previews by nhwnahid · Pull Request #42442 · pingdotgg/t3code

Conversation

@nhwnahid

@nhwnahid nhwnahid commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #42071

Problem

Files rendered through ReadOnlySourcePreview (for example, workspace-external files opened from chat links, read-only files, or truncated files) used <Virtualizer><File /></Virtualizer>, which has no find UI. Clicking inside the file and pressing Ctrl+F / Cmd+F did nothing.

Fix

  • Switched ReadOnlySourcePreview to StyledDiffCodeView (@pierre/diffs CodeView) so read-only source previews use Pierre's built-in find panel (Mod+F, match highlighting, and Escape to close).
  • Bumped the CodeView item version when text or cacheKey changes so streaming/refreshed files update in place without losing scroll position, and ignored [data-search-panel] in SourceSelection pointer/copy handling.
  • Parked scrolled-out collapsed carets as clipped in SourceSelection so Shift+Click selection extension survives CodeView's two-pass virtualized scroll render.

Verification

  • Opened a workspace-external .ts file (/tmp/t3-42071-repro.*.ts) from a chat link in the right sidebar file preview: before this fix Ctrl+F opened no find bar; after this fix Ctrl+F opens and focuses the find input, highlights matches (1 of 1), and closes on Escape.
  • Added browser tests in ReadOnlySourcePreview.browser.test.tsx for mod+f find/highlight/Escape and in-place text updates.
  • Ran vp fmt --check, vp lint, vp run knip:check, typecheck, reactCompilerCoverage.test.ts, ReadOnlySourcePreview.browser.test.tsx (10/10), and FilePreviewPanel.browser.test.tsx (17/17).

Before

image

After

image

Built with Gemini 4 Neon in Antigravity.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nhwnahid
fix(web): mod+f opens find in read-only source previews
1331e27
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 24, 2026
@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
@juliusmarminge
Merge remote-tracking branch 'origin/main' into fix/readonly-source-p…
7b42720
…review-find
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The read-only source preview now renders through StyledDiffCodeView. Browser tests cover find behavior, updated preview content, and selection interactions. Selection clipping now includes collapsed selections that extend beyond mounted rows.

Changes: Read-only source preview

Layer / File(s) Summary
Integrate the code view and find behavior
apps/web/src/components/files/ReadOnlySourcePreview.tsx, apps/web/src/index.css, apps/web/src/components/files/ReadOnlySourcePreview.browser.test.tsx
The preview builds a versioned file item and renders it with StyledDiffCodeView. Copy handling, pointer handling, post-render callbacks, and search-panel styling are updated. Browser tests cover find behavior and updated text and matches after rerendering.
Handle clipped selections
apps/web/src/components/files/sourceSelection.ts, apps/web/src/components/files/ReadOnlySourcePreview.browser.test.tsx
Selection clipping now includes collapsed selections with endpoints outside the mounted range. Browser tests update mounted-row lookup and exercise selection behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant ReadOnlySourcePreview
  participant StyledDiffCodeView
  User->>ReadOnlySourcePreview: Open the source preview
  ReadOnlySourcePreview->>StyledDiffCodeView: Render the versioned file item
  User->>StyledDiffCodeView: Press Mod+F and enter a search term
  StyledDiffCodeView-->>User: Show the find input and matching highlights
  User->>StyledDiffCodeView: Press Escape
  StyledDiffCodeView-->>User: Close the find panel
Loading

Possibly related issues

  • #33932 — This change adds find behavior to the read-only source preview. The issue concerns rendered Markdown and HTML modes, which this change does not cover.

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 31e67

The read-only preview now uses the diff code view with its built-in find panel. No concrete merge-blocking risk was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(web): mod+f opens find in read-only source previews" follows conventional commit form and names the main change. The changeset switches ReadOnlySourcePreview to StyledDiffCodeView so Mo…
Description check Passed The description follows the template well. It states the problem with expected behavior and reproduction steps, and it explains the fix and why each part is needed. It links issue #42071 and gives a c…
Linked Issues check Passed [#42071] The issue requires a find bar in the right-sidebar code file preview. Ctrl+F after clicking in the file should open find, with next and previous match navigation. At head, `ReadOnlySourcePrev…
Out of Scope Changes check Passed All changes support the find-enabled CodeView preview. The version bump on text or cacheKey change keeps streamed or refreshed files current in the reused item, as the sourceRevision state i…
Full details: Title check

Explanation

The title "fix(web): mod+f opens find in read-only source previews" follows conventional commit form and names the main change. The changeset switches ReadOnlySourcePreview to StyledDiffCodeView so Mod+F opens Pierre's find panel. The title covers the primary behavior, and the supporting changes (version bumps, selection handling, CSS) are expected to fall outside its scope.

Full details: Description check

Explanation

The description follows the template well. It states the problem with expected behavior and reproduction steps, and it explains the fix and why each part is needed. It links issue #42071 and gives a concrete manual check with the observed before and after results. It lists the test files and the commands run, and it includes before/after screenshots for the UI change. The Problem, Change, Scope, Verification, and agent-attribution sections are all present. The template's guidance to state anything not checked is not addressed, but the core required content is present.

Full details: Linked Issues check

Explanation

[#42071] The issue requires a find bar in the right-sidebar code file preview. Ctrl+F after clicking in the file should open find, with next and previous match navigation. At head, ReadOnlySourcePreview.tsx renders through StyledDiffCodeView with a file item instead of Virtualizer and File. The PR description, the PR summary, and the browser tests in ReadOnlySourcePreview.browser.test.tsx cover mod+f open, match highlighting (1 of 1), and Escape close. The find panel itself comes from the Pierre CodeView library. This review confirmed the switch in source but did not confirm the library's search default from its source. The reported manual repro uses the same workspace-external .ts path as the issue. The issue's workaround and impact notes are non-coding and do not apply. The incremental changes since the previous review are not itemized, so this verdict relies on the head source and the stated test coverage.

Full details: Out of Scope Changes check

Explanation

All changes support the find-enabled CodeView preview. The version bump on text or cacheKey change keeps streamed or refreshed files current in the reused item, as the sourceRevision state in ReadOnlySourcePreview.tsx shows. The [data-search-panel] guard in onPointerDown keeps find-panel clicks from changing source selection. The clipped handling in sourceSelection.ts keeps Shift+Click working under virtualized rendering. The index.css changes theme the diff search panel and remove the top inset for file previews, which supports the find UI. The DiffWorkerPoolProvider removal and the transition: none preview CSS are small, related rendering adjustments. The test updates support the same rendering change. No unrelated feature or refactor was found in the summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 2c0527b
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5aa25ff5-f50b-43df-87e1-b10f0386ad42
Commits

Reviewing files that changed from the base of the PR and between 1331e27 and 31e6780.

Files selected for processing: 2

  • apps/web/src/components/files/ReadOnlySourcePreview.tsx
  • apps/web/src/index.css

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge @claude
fix(web): read-only source preview keeps its code surface on CodeView
31e6780
Moving the preview onto StyledDiffCodeView put it on the diff canvas
background, faded the file in on mount, and kept a 40px find-panel inset
meant for a sticky file header it does not have. The preview now inherits
the code surface the editable file view uses, appears at once, and its
find panel takes Pierre's default inset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 24, 2026

Copy link
Copy Markdown
Member

Evidence

Open the chat link to a TypeScript file outside the workspace, click its source, and press Ctrl+F. On the fix, type recognizable, press Enter to advance, then Escape to close find. Real web app on Linux, 1440×900, light theme, fresh synthetic data on both commits.

Before After
2c0527b8d0 31e678062e
Before: Ctrl+F opens no file find bar After: focused find highlights three matches
Before recording After recording: find, navigation, Escape

Scenario driver. Scenario proof exited 0: fails on base, passes on head. Recording excerpts play at one-third speed.

Not shown:

  • macOS Cmd+F and the Electron desktop shell were not exercised; proof covers Ctrl+F in the real Linux web client.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit bd3e495 into pingdotgg:main Nov 24, 2026
17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
@patroza patroza mentioned this pull request Nov 25, 2026
Merge upstream main through feecca53e4dc patroza/t3code#675
Merged
@brandon-julio-t brandon-julio-t mentioned this pull request Nov 26, 2026
fix(web): file links with a line number open read-only files at that line #43235
Merged
@orbitingflea orbitingflea mentioned this pull request Nov 27, 2026
fix(files): keep the reader's place in read-only code views orbitingflea/t3code#326
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Ctrl+F does nothing in the right sidebar file preview for a .ts file (code view)

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@nhwnahid @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.