Repository navigation
feat(panel): File tabs and page source on Pierre, Luke's notes as annotations with the minimized chip - #4283
Merged
Merged
Conversation
…otations with the minimized chip A File tab reads its file whole (one line for the head's commit, then the raw text at that commit) and draws it through the diff bundle's mountFile: virtualized, coloured in the worker pool, in the diffs' own look. Luke's notes are Pierre annotations on the shared card, lighting their lines under the pointer, or put away behind the same chip as review threads while Minimize inline comments is on, which View settings › Lines offers and I turns. ⌘F counts and steps through the whole file and its notes from the text. A page's source draws the same way. The old path goes with it: themed-lines, the bundle's colourLines, window reading, and the host's page source colouring. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
3 tasks done
… show them, and recount an open find as notes change Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…ser, code as written Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…t its Markdown Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
3 tasks done
This branch was successfully deployed
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.
Summary
This is PR 2 of the approved plan Pierre for File tabs and code snippets (plan page). The developer chose no experimental switch, so the plan's PR 2 (the File tab on Pierre) and PR 3 (notes, chip and
I) are folded together here. Each old path is deleted in this same PR, somainnever has a File tab without its notes. It builds on #4262 (mountFile), which has merged.File tab
whole-file.tsx(WholeFile) loads the diff bundle and mountsmountFilein aScrollArea. It uses the diffs' own look (useDiffLook), so wrap, line numbers, syntax theme, font, size, line height and ligatures now apply natively. feat(desktop): File tabs and a page's source follow View settings' syntax theme #3851's repaint from GitHub colours is gone.AnnotationCard(feat(panel): Luke's File-tab notes on the annotation card, under the last line #4214), under the last line of their range. The card keeps its ⋯ menu (View in conversation, Copy link) and its fold. Pointing at it lights its lines, which swaps Pierre's lit range, the same call Files changed uses. On unwrapped lines, Pierre's own sticky annotation column keeps the card in view.MinimizedChipis generalized out ofMinimizedThreads(agreed with the Code-cards PR agent, so there's only one chip). While Minimize inline comments is on, Luke's note sits behind a chip at the end of its line, showing his wing mark, the count and "Luke's note on lines 3–4, show". Pressing the chip shows the card. The shown notes are forgotten whenever the setting turns.LinesRows,LINESscopenotes: true). Page source doesn't show it. Its hint reads "Or press I over the code".Iturns the setting while the tab holds the focus and no text field does, as it does in Files changed.file-find.ts). It counts every match in the file and in the notes' words, scrolls to each match's line, and paints the drawn matches with the existing highlight sheet, repainting as Pierre draws rows. The current match is brought into view, opening a folded card or chip around it.pickedLines(): lines picked by pressing their numbers, or else the lines a text selection covers in the shadow root.ph-no-capture.Page source
PageSourcedraws throughWholeFile(page.html, revisionpageId@version). The host's page-source act now returns plain lines, because the panel colours the source.What goes
themed-lines.tsxand its test; the bundle'scolourLines,colour-lines.tsand their tests (off the contract and out of the test stand-ins); the window helpers infile-tab-model.ts; the edge-row CSS; andCodeLinesView'sground,aboveandbelowprops.TASK_FILE_BOUNDSis no longer exported, since nothing outsidetask-wire.tsreads it now.Coordination with the Code-cards PR
code-lines.tsx(CodeLineRows, used by the Code cards and inbox cards, andCodeLinesViewfor the refused-file snippet fallback and attachments) and the host'shighlightFile/highlightCodestay.code-lines.tsxis deleted by whichever of those lands last.Screenshots
Harness: the real
FileTabover the builtstyles.cssand diff bundle (worker pool on), showing this PR's ownfile-tab.tsx(380 lines) opened on lines 104–108 with one of Luke's notes.Measured
The same harness and session as #4262, with a 5,000-line TSX file:
Tests
file-tab.test.ts(real diff bundle, jsdom):Iturns the setting.file-find.test.ts: matches on lines and in notes, in drawn order and case-insensitive. A query is matched as typed. Where a find starts.file-tab-model.test.ts: line counting.mention-lines.test.ts: reworked on Pierre. Picking lines by their numbers, then ⌥⌘K, gives a chip pinned to the commit. A selection ending at the next row's start pins one line. jsdom keeps no selection inside a shadow root, so the tab's own selection read is stood in for.file-view-menu.test.ts: View settings lists Minimize, and its rows apply on Pierre's drawing.page-pane.test.ts: the source draws on Pierre, coloured.src/testing/whole-file.ts.themed-lines.test.ts,colour-lines.test.tsandcolour-pool.test.ts, which test code that no longer exists.Evidence
tsc --noEmit: panel, host, features and desktop all clean../scripts/oxlint.sh: 0 warnings, 0 errors.biome check: clean.knip: no findings../scripts/repository-checks.sh: passed.apps/desktopbuild: passed.diff-view.jsis 244,394 gz,panel.js80,954 gz.Invariants
astype assertion, raw async primitive, or Effect run outside the edges.PRIVACY.mdunchanged: the File tab's root keepsph-no-capture, and nothing new leaves the machine.Made with Luke