Uh oh!
There was an error while loading. Please reload this page.
feat: session work column enhancements — Files Changed editing + project-wide Preview with PDF and TeX support - #737
Draft
jeonghun-jj-lee wants to merge 13 commits into
Draft
Conversation
Picks up fork infrastructure for #721: - pdfjs-dist@4.10.38 dependency (packages/app/package.json now in overlay) - Shared buildCollapsedTree + filterCollapsedTree (utils/collapsed-tree.ts) - Shared ZoomControl component + createZoomState hook (components/zoom-control.tsx) - Also includes 31bf627498: suppress per-message Changed files section (#733)
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add file-type-modes.ts: pure function mapping file extensions to available view modes (.md → Diff|Raw|Preview, .tex/.bib/.tikz/.sty → same, other text → Diff|Raw, binary → Diff only) - Add modeToggle + modeContent render props to SessionReviewFilePreviewV2 - Wire per-file-sticky mode state in ReviewPanelV2 (Map<file, mode>) - SegmentedControlV2 toggle dispatches to correct content area - Raw and Preview content slots render placeholders until F1 fills them - Unit tests for file-type classification (12 tests) Part of #721
- Add transient filter input at the top of the Files Changed file picker dropdown - Filter narrows the tree by case-insensitive substring match on file path/name - Filter clears when the dropdown closes (state local to the render prop IIFE) - Uses filterCollapsedTree from the shared collapsed-tree module - Autofocus on the input for instant typing - Empty filter shows the full tree (no change from current behavior) Part of #721
…#725) - Add previewable-files.ts: PreviewFileEntry type (extended beyond .md), PREVIEWABLE_EXTENSIONS constant, isPreviewable() function (unit tests: 7) - Extend WorkspaceProjectEntry with previewableFiles field (both extension and app-side types) - Add scanPreviewableFiles() to extension workspace_projects.ts — recursive directory scan filtered to previewable types - Update SessionPreviewTab to accept projectFiles/projectRoot props - Conditional data source: project files when project loaded, session-touched .md files when no project (current behavior preserved) - Add error state: 'Could not load file' inline message on load failure - Update PreviewFileList: project-source files show no change badge Part of #721
…ent (#723) - Migrate save indicator from ad-hoc Tailwind (text-green-500/text-text-weak) to var(--status-running) / var(--status-done) design tokens - Add onFileSaved callback prop: fires after POST /file/write completes (path + success boolean) — hook for #729 TeX auto-compile - Add onDiffRefreshNeeded callback: fires after save to signal the parent that diff data should be re-fetched - Zoom widget extraction was completed in Phase 1 (components/zoom-control.tsx) Part of #721
- Add renderer-dispatch.ts: getRendererKind() maps extensions to renderer kinds (markdown, source, image, pdf, unknown) - getShikiLanguage(): .tex/.tikz/.sty → latex grammar, .bib → bibtex - hasSourcePreviewToggle(): source files get Raw | Preview toggle - resolveMainPdf(): convention-based PDF resolution (basename.pdf adjacent) - Wire renderer dispatch into Files Changed Preview content slot - Unit tests for dispatch, language mapping, PDF resolution (15 tests) Part of #721
- Add PDFViewer component: canvas-per-page rendering in scrollable container - pdfjs-dist worker configured via ?url import (same pattern as shiki worker) - Zoom support via CSS scale transform (matches markdown preview behavior) - Scroll-position preservation on reload: saves scrollTop before reload, restores after DOM update via requestAnimationFrame - Reactive version prop: incrementing triggers reload (contract for #729 TeX compilation hot-reload) - Loading state ('Loading PDF...') while parsing - Error state ('Could not load PDF') on failure - Load cancellation: new request destroys in-flight task Part of #721
- Add RawFileEditor shared component: textarea with auto-save (debounced 1s + Cmd+S), save indicator using design tokens, file-type-agnostic - Save indicator uses var(--status-running) for 'Saving...' and var(--status-done) for 'Saved' - Prevents global command system from stealing Cmd+A/Z/Shift+Z - onSaved callback for downstream consumers (#729 TeX auto-compile) - Zoom support via proportional font-size scaling Part of #721
…729) Extension side: - Add tex_support.ts: detectTex() checks PATH for latexmk/pdflatex/xelatex/lualatex - parseLatexConfig(): reads research-project.toml [latex] section (main, engine, outdir, auto_compile) — simple TOML parser, no dependency - resolveEngine(): selection chain (toml > .latexmkrc > latexmk default > first available engine) - discoverMainFile(): discovery chain (toml > auto-detect \documentclass > undefined if ambiguous) - enrichProjectEntries(): populates previewableFiles + tex capability per project Bridge extension: - WorkspaceProjectEntry gains tex?: { available, engine, mainFile? } field - App-side WorkspaceProject type extended to match Tests: 8 new tests for TOML parsing, main file discovery, ambiguity handling Note: The app-side compile UI (Build button, auto-compile, error banner) is infrastructure-ready but the UI components are placeholder — the compile command execution and IPC are deferred to the wiring pass. Part of #721
- Add synctex.ts: parser for .synctex.gz files (gzipped SyncTeX v1 format) - parseSyncTexFile(): reads and decompresses .synctex.gz, returns SyncTexIndex - parseSyncTexContent(): parses Input records (tag→filename) and page records (v/h nodes with tag, line, x, y coordinates) - forwardSearch(): maps (source file, cursor line) → (page, x, y) position in the PDF. Matches by full path, suffix, or basename fallback. Finds the closest line when no exact match exists. - Graceful degradation: all functions return undefined on any failure (missing file, corrupt data, parse error) — the PDF viewer opens at its current position, never crashes. - Unit tests: 10 tests against a minimal SyncTeX fixture Part of #721
…lders - Raw mode: loads file via SDK, renders RawFileEditor with auto-save - Preview mode for .md: loads file via SDK, renders <Markdown> - Add structural test: no placeholder strings, imports RawFileEditor + Markdown - Other preview types: honest 'not yet available' message (source/PDF next)
- Mode toggle (Diff/Raw/Preview) now in the toolbar header, right of the arrows and left of the unified/split toggle - Icons: unified (+/-) for Diff, edit (pencil) for Raw, eye for Preview - Tooltips on hover - Add toolbarExtra prop to SessionReviewV2Props - Fix Icon import: v2/icon (has 'unified') instead of v1 icon
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 freeto 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.
Closes#721
Session work column enhancements
Implementation of the 9-slice feature DAG for #721.
Dependency DAG (5 frontiers)
Phase 1 (complete)
pdfjs-distto opencode fork (v1.18.10-amicode.20)buildCollapsedTreeto sharedutils/collapsed-tree.tsZoomControlto sharedcomponents/zoom-control.tsxIn progress
Walking the DAG frontier by frontier...