Skip to content

Vibe-code an arguably better user interface#1

Merged
casperdcl merged 9 commits intoraw-content:mainfrom
0x2b3bfa0:main
Apr 5, 2026
Merged

Vibe-code an arguably better user interface#1
casperdcl merged 9 commits intoraw-content:mainfrom
0x2b3bfa0:main

Conversation

@0x2b3bfa0
Copy link
Copy Markdown
Contributor

No description provided.

0x2b3bfa0 and others added 9 commits April 5, 2026 18:37
Check response.ok on all fetch calls, show user-friendly error messages
for 404 (not found), 403 (rate limited), and missing paths. Also adds
basic CSS styling and file/folder icons to the listing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes "Cannot read properties of undefined (reading 'map')" when the
URL targets a file like README.md — now redirects to the raw GitHub URL
instead of trying to list it as a directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Splitting "owner/repo/main/" produces an empty string at the end,
causing traverse to fail with "Path not found: ". Fix by filtering
out empty segments after split.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Handle 404 errors and add basic CSS
- Primer color palette with full dark mode support (prefers-color-scheme)
- System font stack, Octicon SVGs for file/folder icons
- Bordered listing with hover rows, matching GitHub's file browser
- Interactive breadcrumb: owner and repo link to GitHub, path segments
  navigate within the app
- Landing page with usage hint when no query string provided
- Spinner loading state, sorted listing (directories first)
- Handle 404s, rate limits, missing paths, and file-path redirects
- XSS-safe: all user content HTML-escaped via esc()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split the breadcrumb into two distinct zones:
- Repo header (owner / repo): immutable, links to GitHub, larger text
  with the repo name in bold
- Toolbar: branch dropdown button + path breadcrumb on a subtle
  background, visually connected to the listing below

The branch selector is a dropdown that lazy-loads branches from the
GitHub API on first click, highlights the active branch with a
checkmark, and navigates to the selected branch preserving the
current path. Uses Octicon SVGs for the git-branch and chevron icons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the user selects a different branch from the dropdown, the current
path may not exist in the new branch. Instead of navigating blindly and
showing a "Path not found" error, we now walk the tree in the target
branch and resolve the deepest valid prefix of the current path.

For example, if the user is at src/lib/old-module and switches to a
branch where src/lib exists but old-module doesn't, they land at
src/lib. If src doesn't exist either, they land at the branch root.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When clicking a file, its content is now fetched and displayed inside
the listing area with line numbers (sticky on horizontal scroll) and
a "Raw" button linking to the raw.githubusercontent.com URL.

- Text files: rendered in a monospace pre block with line count and
  byte size in the header
- Images (png, jpg, gif, svg, webp, etc.): rendered as an img tag
- Binary files (zip, pdf, exe, etc.): show a download prompt
- File links in directory listings now use app URLs so the breadcrumb,
  branch selector, and back navigation all work seamlessly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Redesign with Primer tokens and functional styling
Copy link
Copy Markdown
Member

@casperdcl casperdcl left a comment

Choose a reason for hiding this comment

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

nice; though I have a slight preference for spinning off the css & svg into separate files :)

@0x2b3bfa0
Copy link
Copy Markdown
Contributor Author

@casperdcl, what happened to #2? 😇

@casperdcl casperdcl merged commit ef868f8 into raw-content:main Apr 5, 2026
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