Skip to content

feat: repo file explorer with tree sidebar and syntax highlighting#127

Merged
stylessh merged 4 commits intomainfrom
stylessh/repo-file-explorer
Apr 16, 2026
Merged

feat: repo file explorer with tree sidebar and syntax highlighting#127
stylessh merged 4 commits intomainfrom
stylessh/repo-file-explorer

Conversation

@stylessh
Copy link
Copy Markdown
Owner

Summary

  • Adds a split-panel code explorer accessible by clicking files/folders in the repo overview page
  • Left sidebar with a recursive, lazy-loaded file tree; right pane shows folder listings or Shiki syntax-highlighted code
  • Routes follow GitHub's tree/blob URL convention (/:owner/:repo/tree/:ref/:path, /:owner/:repo/blob/:ref/:path)
  • File viewer shows the latest commit affecting the selected file (not repo-level), line count, file size, copy button, and raw download link
  • Progressive BFS prefetching of all tree nodes to eliminate loading spinners when navigating folders
  • Mobile uses a drawer pattern for the file tree, matching the review page layout
  • Ref parsing from splat URLs with longest-branch-match strategy to handle refs containing /

Test plan

  • Navigate to a repo overview page — file tree rows are now clickable links
  • Click a folder — URL updates to /tree/main/folder, explorer opens with sidebar + folder listing
  • Click a file — URL updates to /blob/main/path/file.ts, right pane shows syntax-highlighted code
  • Verify commit bar above code shows the last commit that touched that specific file
  • Back/forward browser buttons work correctly
  • Branch selector changes branch and updates URL
  • Mobile viewport shows drawer pattern for file tree
  • Resize the sidebar panel — respects min/max constraints

…lob/tree routes

Add a split-panel code explorer accessible from the repo overview file tree.
Clicking any file or folder navigates to tree/blob routes matching GitHub's
URL convention. The explorer features:

- Resizable left sidebar with recursive file tree (lazy-loaded directories)
- Folder view with commit messages and timestamps in the right pane
- Shiki syntax-highlighted code viewer with line numbers, copy, and raw download
- File-specific latest commit bar (fetches last commit affecting that file)
- Progressive BFS prefetching of all tree nodes to eliminate loading spinners
- Mobile drawer pattern for file tree (matches review page)
- Ref parsing from splat URLs with longest-branch-match strategy
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 15, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
diffkit 6c3c380 Apr 16 2026, 09:20 PM

…lish

- Extract file search card into shared component for reuse across repo sidebar and PR review page
- Add fuzzy file search library (fuzzy-file-search.ts)
- Fetch per-entry last commit data in folder view and file tree (commit message + relative time)
- Render image files (png, jpg, gif, etc.) as media preview instead of blob content
- Add preview/code toggle for SVG files
- Fix long-line background rendering by moving overflow to outer wrapper with sticky line numbers
- Split directory node click: arrow toggles expand, name navigates to folder
- Center README content with max-w-3xl and increased vertical padding
- Use bg-surface-1 for latest commit bar
- Align search card top padding with content pane
- Add F shortcut to focus search in PR review page
- Batch per-entry commit messages into a single GraphQL query with
  aliased history fields instead of N separate REST calls
- Add explorer-path-store (useSyncExternalStore) so tree nodes subscribe
  to derived isActive booleans — only 2 nodes re-render on navigation
- Memoize scope objects in route components to stop busting memo on
  every child
- Prevent same-URL navigation on already-active tree nodes
- Stabilize callbacks in RepoExplorerLayout (useCallback + imperative
  reads from store)
- Isolate pathname subscription in dashboard-tabs via
  ScrollActiveTabIntoView renderless component
- Fix branch switch in blob view navigating to tree route
- Add light-mode border to branch selector button
Merge main's drag-to-reorder tabs and "close merged" features while
preserving imperative pathname reads in callbacks and the isolated
ScrollActiveTabIntoView component for re-render optimization.
@stylessh stylessh merged commit e7dd799 into main Apr 16, 2026
5 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