Skip to content

Code Review: Viewed, faster open, readable comments, keyboard moves (#319) - #506

Merged
BunsDev merged 7 commits into
mainfrom
cr-viewed
Nov 12, 2026
Merged

BunsDev merged 7 commits into
mainfrom
cr-viewed

Conversation

@BunsDev

@BunsDev BunsDev commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

First fixes from the real-use benchmark on ten pull requests of this repository (#319), plus Val's decisions 5 and 6 of 2026-11-04.

  • Viewed (C65, decision 5). A checkbox per file and a count of viewed files. Marks are kept in local storage per signed-in account and shown only at the revision they were made at. No GitHub request.
  • New-tab control removed (C07, decision 6).
  • Faster open. Inbox reads take a background lane so an opened pull request is not queued behind them; resolve hands its read to overview once; the merge base and the first file page are read in parallel. Measured on the real repository: find about 2.0 s (was 3.8 s), checks ready about 4.8 s (was 6.6 s).
  • Readable comments. HTML in descriptions and comments (details, sup, img, links) showed as raw tags. Known tags outside code are dropped; an image reads "Image: alt".
  • Inbox rows show repo #number.
  • Keyboard. F6 and Shift+F6 move between the areas; [ and ] move between files in Changes.

Not in this PR: review comments made on diff lines are still not shown, and the benchmark has not been re-run on this build.

Testing

  • pnpm build && pnpm test: 0 failures.
  • All Code Review e2e specs: 108 passed.
  • Each fix was checked against a mutation that turns its test red.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Nov 12, 2026 6:05pm UTC

Request Review

BunsDev and others added 5 commits November 12, 2026 03:30
Decision 5 (C65): a file can be marked viewed. The mark is kept on this
Mac per account and belongs to one revision; a new head or base shows
none. Marking folds the file; the tree and a count show progress.
Nothing is read from or sent to GitHub.

Decision 6 (C07): the unavailable new-tab button is removed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Measured on real pull requests, every control was reachable with Tab but
only through 34 to 124 presses between areas, and 147 arrows to the last
of 151 files. F6 and Shift+F6 now move between the inbox, the pane tabs,
the pane and the file list; [ and ] move to the previous and next file.
Keys typed in a text field stay text.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Measured on 10 real pull requests, opening one took 2 to 5 s to its
title and 6 to 7 s to its checks. Three causes are addressed:

- Reads for an opened pull request go ahead of inbox lookups that have
  not started; a running read is never interrupted.
- The overview uses resolve's read of the pull request once, within 2 s,
  under the same account, and only if nothing newer read it.
- The merge base and the file page are read together between the two
  guarding reads.

Checks and activity keep their order: a failed first read still costs
GitHub nothing further.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ox rows

GitHub comment bodies often carry HTML (details, sup, img, links). The overview showed the tags as raw text.
Known tags outside code are now dropped, and an image becomes "Image: alt". Inbox rows show repo #number.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… first benchmark fixes (#319)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@BunsDev BunsDev left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read-only review of the local Viewed persistence path; one reproduced recovery issue below.

const next = paths.length ? [...rest, [id(key), { baseSha: revision.baseSha, headSha: revision.headSha, paths } satisfies Entry]] : rest;
try {
storage.setItem(VIEWED_KEY, JSON.stringify({ ...read(storage), [key.account]: Object.fromEntries(next) }));
} catch { /* A full or blocked store keeps the mark for this session only. */ }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[P2] Preserve session marks when local storage rejects writes

When localStorage.setItem throws (for example, quota exhaustion), this catch returns the new paths to React, but the next toggle reconstructs current from storage rather than that session state. I reproduced this against exact head 7c8f365 with getItem returning null and setItem throwing: marking src/a.ts returns ["src/a.ts"], then marking src/b.ts returns only ["src/b.ts"]. Thus marking a second file visibly clears the first mark even without reloading; the stated session-only fallback does not hold. With an existing persisted mark, unmarking it can similarly be undone by the next toggle. Please retain an account/repository/PR/revision-scoped in-memory fallback or pass the current React state through the update, and add a blocked/full-storage regression covering mark A, mark B, unmark A and another toggle. No owner worktree edits or live GitHub writes were used in the reproduction.

CodeQL flagged the tag pattern (polynomial backtracking on an unclosed tag) and the comment strip
(one replace can leave a new opener). A character scanner replaces both; hostile inputs are timed in the test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-code-quality

github-code-quality Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main d6bda9b cr-viewed 35b52b0 +/-
66% 66% 0%
View coverage of the 4 most impacted files.
File main d6bda9b cr-viewed 35b52b0 +/-
apps/desktop/sr...read-service.ts 98% 99% +1%
apps/desktop/sr...-review/keys.ts 0% 67% +67%
apps/desktop/sr.../remote-text.ts 0% 98% +98%
apps/desktop/sr...eview/viewed.ts 0% 100% +100%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 12, 2026 19:11 UTC

@BunsDev
BunsDev added this pull request to the merge queue Nov 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 12, 2026
@BunsDev
BunsDev added this pull request to the merge queue Nov 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 12, 2026
The bracket key focuses its file on the next animation frame. The keyboard test went on to
focus the filter and type at once, so on a slow runner that focus arrived mid-typing and the
filter kept only the first character. This failed the merge queue run for #506.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@BunsDev
BunsDev enabled auto-merge November 12, 2026 18:05
@BunsDev
BunsDev added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit c695072 Nov 12, 2026
12 of 13 checks passed
@BunsDev
BunsDev deleted the cr-viewed branch November 12, 2026 20:04

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – modex — 35b52b07 Deployed Nov 12, 2026 by vercel[bot]
Preview — 0f28862a Deployed Nov 12, 2026 by vercel[bot]
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.

2 participants