Skip to content

feat: highlighted view code - #6

Merged
Floffah merged 3 commits into
mainfrom
feature/ui-cleanup
May 21, 2026
Merged

feat: highlighted view code#6
Floffah merged 3 commits into
mainfrom
feature/ui-cleanup

Conversation

@Floffah

@Floffah Floffah commented May 21, 2026

Copy link
Copy Markdown
Owner

What this changes

  • Repository settings
  • Repository homepage cleanup
  • Max height repository readme
  • Browse repo files w/ syntax highlighting

How I tested this

manual

Checklist

  • I have read CONTRIBUTING.md and this PR follows the guidelines
  • A human has reviewed the entire diff of this PR, every line of code
  • A human understands the changes and can explain why this approach is correct
  • Tests pass
  • This PR doesn't have AI-generated boilerplate or co-author lines
  • This PR was authored and submitted by an AI agent without human review

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Rate limit exceeded

@Floffah has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 37 minutes and 59 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d6ad704-44ef-46b0-b29e-43ceb8cd69b2

📥 Commits

Reviewing files that changed from the base of the PR and between 16f7ba2 and 1ebfa9c.

📒 Files selected for processing (7)
  • internal/app/api/repositories.go
  • internal/pkg/git/git.go
  • internal/pkg/gitstore/gitstore.go
  • web/public/code-theme-light.json
  • web/public/code-theme.json
  • web/src/components/ShikiCodeBlock.tsx
  • web/src/components/views/RepositoryHomepage/RepositoryHeader.tsx
📝 Walkthrough

Walkthrough

This PR introduces shadcn/ui skill documentation for AI agents, implements repository file access through new API endpoints with backend git integration, adds a settings form for managing repositories, expands the UI component library with styled primitives, and enhances repository browsing with file viewing and improved homepage layouts. Additionally, it includes VS Code theme files, CodeGraph configuration, dependency updates, and route protection.

Changes

Shadcn/UI Skill Documentation and Tooling

Layer / File(s) Summary
Core skill definition and critical rules
.agents/skills/shadcn/SKILL.md, .agents/skills/shadcn/agents/openai.yml
Introduces shadcn/ui skill metadata, critical composition/styling rules, form patterns, component selection table, and key field references for project context injection.
CLI reference and workflow documentation
.agents/skills/shadcn/cli.md, .agents/skills/shadcn/customization.md
Documents complete CLI command set, preset switching workflows, CSS variable theming, Tailwind v3/v4 registration, component customisation patterns, and dark mode setup.
Component composition and styling rules
.agents/skills/shadcn/rules/composition.md, .agents/skills/shadcn/rules/forms.md, .agents/skills/shadcn/rules/icons.md, .agents/skills/shadcn/rules/styling.md, .agents/skills/shadcn/rules/base-vs-radix.md
Establishes detailed rules for component grouping, form structure, icon usage, semantic tokens, and base-vs-radix API differences with correctness examples.
MCP server and evaluation specifications
.agents/skills/shadcn/mcp.md, .agents/skills/shadcn/evals/evals.json
Documents MCP server setup, registry operations, and three evaluation scenarios covering forms, dialogs, and dashboard layouts.

Repository File Access and Settings Management

Layer / File(s) Summary
API specification for file and repository operations
api/api.v1.openapi.yaml
Defines PATCH endpoint for updating repository metadata and GET endpoint for fetching repository files with optional ref parameter; adds request/response schemas.
Git storage layer for file retrieval
internal/pkg/gitstore/gitstore.go
Adds File struct, size limits, ErrFileNotFound/ErrFileTooLarge errors, and GetFile method that validates refs, resolves commits, and enforces blob size limits.
API endpoint handlers
internal/app/api/repositories.go
Implements UpdateRepository (owner enforcement, validation) and GetRepositoryFile (access control, error mapping) handlers with proper HTTP status responses.
Settings form and server helpers
web/src/components/views/RepositorySettingsForm.tsx, web/src/lib/server/repository.ts, web/src/app/(site)/[ownerName]/[repoName]/settings/layout.tsx, web/src/app/(site)/[ownerName]/[repoName]/settings/page.tsx
Adds RepositorySettingsForm with Zod validation, PATCH mutation handling, and success/error display; includes serverGetRepositoryFile helper and settings routing.
Metadata generation
web/src/app/(site)/[ownerName]/[repoName]/layout.tsx
Adds generateMetadata function fetching repository data to construct dynamic SEO metadata (title, description, openGraph).

UI Component Library and Repository Browsing Experience

Layer / File(s) Summary
New UI component primitives
web/src/components/ui/button-group.tsx, web/src/components/ui/combobox.tsx, web/src/components/ui/command.tsx, web/src/components/ui/context-menu.tsx, web/src/components/ui/select.tsx
Introduces styled wrapper components (button-group, combobox, command, context-menu, select) around Radix/Base-UI primitives with consistent data attributes and Tailwind styling.
Toast notification component
web/src/components/ui/sonner.tsx
Wraps sonner's Toaster with theme-aware icon customisation and CSS variable styling for consistent toast rendering.
File viewer and code highlighting
web/src/components/views/RepositoryFileViewer.tsx, web/src/components/ShikiCodeBlock.tsx, web/src/app/globals.css
Implements file viewer for README/code rendering, ShikiCodeBlock for syntax highlighting with language detection, and adds dark-mode code block styling plus --success colour token.
Repository homepage enhancements
web/src/components/views/RepositoryHomepage/index.tsx, web/src/components/views/RepositoryHomepage/RepositoryHeader.tsx, web/src/components/views/RepositoryHomepage/RepositoryReadme.tsx, web/src/components/views/RepositoryHomepage/RepositoryBranchSelect/inner.tsx, web/src/components/views/RepositoryHomepage/RepositoryFileList.tsx, web/src/components/views/RepositoryHomepage/RepositoryAside.tsx, web/src/app/(site)/[ownerName]/[repoName]/browse/[...path]/page.tsx
Refactors homepage with new RepositoryHeader (branch selector, navigation), expandable README, file viewer integration, responsive layout, improved branch selector labels, and blob file rendering.
Expandable content component
web/src/components/ExpandableContent.tsx
Adds client component using ResizeObserver for overflow detection, manages expanded/collapsed state, applies gradient overlays, and renders dynamic expand/collapse buttons.
Layout and profile updates
web/src/app/layout.tsx, web/src/components/layouts/RepoLayout/index.tsx, web/src/components/views/ProfileSettings.tsx
Updates RootLayout provider composition (TooltipProvider, Toaster), RepoLayout with user-based Settings link visibility, and ProfileSettings form submission with error/success feedback.
VS Code themes
web/public/code-theme.json, web/public/code-theme-light.json, web/public/catppuccin.LICENSE
Adds two complete VS Code theme configurations (Catena Dark and Light) with colour palettes, semantic token mappings, syntax highlighting rules, and MIT license attribution.

Tooling, Configuration, and Dependencies

Layer / File(s) Summary
CodeGraph configuration
.codegraph/config.json, .codegraph/.gitignore
Defines CodeGraph scanning scope with broad source-code includes, extensive build/dependency excludes, and extraction features; adds gitignore for local data files.
Package dependencies and configuration
web/package.json, package.json, web/tsconfig.json, web/src/proxy.ts, skills-lock.json
Bumps web dependency versions (Clerk, React Query, type definitions, base-ui, shiki), adds codegraph dev dependency, protects /new routes, extends @/public TypeScript alias, and creates skills version lock.
Project roadmap updates
README.md
Marks "Issues" as completed and relocates "External project management integrations" in the roadmap.

🎯 4 (Complex) | ⏱️ ~60 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ui-cleanup

@socket-security

socket-security Bot commented May 21, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​colbymchenry/​codegraph@​0.8.07310010096100
Addednpm/​cmdk@​1.1.110010010082100
Addednpm/​@​base-ui/​react@​1.5.0901008995100

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/shadcn/SKILL.md:
- Around line 16-18: The SKILL.md uses an ambiguous command-output templating
line `!`npx shadcn@latest info --json`` that has no repository evidence; update
SKILL.md to either (a) replace that line with the repo's supported command
execution syntax (or explicit inline example) or (b) add a short note linking to
the agent/framework docs that define the exact `!\`...\`` injection pattern so
readers know when substitution occurs; target the SKILL.md entry that contains
the `!`npx shadcn@latest info --json`` snippet and ensure the change clearly
shows the supported syntax or includes the documentation URL and a one-line
explanation of when/how the substitution runs.

In `@internal/app/api/repositories.go`:
- Around line 168-188: The current PATCH handler calls
s.repository.GetRepositoryByOwnerAndName directly which leaks private-repo
existence (returns 403 vs 404); replace that lookup with the shared
access-checking helper getAccessibleRepository (or equivalent) to enforce
visibility rules before loading the repo, then use the returned repository for
subsequent owner checks; map getAccessibleRepository errors to the same
UpdateRepository404JSONResponse when repo is inaccessible/not found and to
UpdateRepository403JSONResponse only when it indicates an explicit
forbidden/public-but-not-owned condition, removing the direct use of
s.repository.GetRepositoryByOwnerAndName and its current error branches.
- Around line 217-233: The code allows any non-empty defaultBranch value to be
saved which can break browse/readme/file/tree handlers; before calling
s.repository.UpdateRepository (and using UpdateRepositoryParams.DefaultBranch),
validate that the trimmed defaultBranch from request.Body.DefaultBranch actually
exists as a ref/branch/tag in the repository (use the repository/Git service
method that resolves refs for this repo or call the same resolver used by the
browse/readme/file/tree handlers), and if it does not resolve return a 400
BadRequestJSONResponse with a clear error (e.g. "default branch does not exist
or is not a valid ref"); only proceed to call s.repository.UpdateRepository when
the ref resolution succeeds.

In `@skills-lock.json`:
- Line 7: Update the skillPath value for the shadcn entry so it points to the
real repository location; locate the "skillPath" property in the
skills-lock.json entry for the shadcn skill and change its value from
"skills/shadcn/SKILL.md" to ".agents/skills/shadcn/SKILL.md" so consumers
resolving skills by path find the correct file.

In `@web/public/code-theme-light.json`:
- Around line 1216-1223: In the theme scopes array, fix the typo in the TextMate
scope string: replace "constant.charactger.entity.js.jsx punctuation" with the
correct "constant.character.entity.js.jsx punctuation" so the rule matches; also
scan nearby scope entries (e.g., "constant.character.entity.tsx" variants) for
any similar misspellings and make them consistent.

In `@web/public/code-theme.json`:
- Around line 1216-1223: Fix the typo in the CSS/TM scope selector by replacing
the incorrect selector string "constant.charactger.entity.js.jsx punctuation"
with the correct "constant.character.entity.js.jsx punctuation" so the dark
theme rule matches JS/JSX entity punctuation; update the entry that pairs with
"constant.character.entity.js.jsx" and "constant.character.entity.tsx" to ensure
consistent spelling across related selectors.

In `@web/src/app/`(site)/[ownerName]/[repoName]/layout.tsx:
- Around line 35-40: The Open Graph URL is hard-coded to https://oncatena.com in
layout.tsx (see openGraph.url using response.data.ownerName/response.data.name);
change this to derive the origin from an environment variable
(process.env.NEXT_PUBLIC_CATENA_INSTANCE_URL) or set metadataBase at the root
metadata and use a relative URL, then build openGraph.url by concatenating that
origin with `/${response.data.ownerName}/${response.data.name}` (or use new URL
constructors) so previews work across preview/staging/custom domains; update
both web/src/app/(site)/[ownerName]/[repoName]/layout.tsx and
web/src/app/layout.tsx accordingly.

In `@web/src/components/ShikiCodeBlock.tsx`:
- Around line 111-120: ShikiCodeBlock currently creates a highlighter with
langs: ["go"] inside the component which causes codeToHast to throw when lang
(passed from RepositoryFileViewer via fileNameToLanguage) is not loaded; move
createHighlighter out to module scope so it’s reused, and either preload the
full set of languages you expect or ensure the highlighter loads the requested
language before calling highlighter.codeToHast (e.g., call
highlighter.loadLanguage(lang) or include fileNameToLanguage-derived languages
in the initial createHighlighter call), updating references to
createHighlighter, highlighter, codeToHast, RepositoryFileViewer,
fileNameToLanguage, and lang accordingly.

In `@web/src/components/views/RepositoryHomepage/RepositoryHeader.tsx`:
- Line 45: The Tags button in RepositoryHeader.tsx is linking to the wrong
route; update the Link that currently uses
href={`/${ownerName}/${repoName}/refs/branches`} (the Link component rendering
the "Tags" control) to point to the tags route instead (change the path segment
from "branches" to "tags" so it becomes `/${ownerName}/${repoName}/refs/tags`),
ensuring the Tags button opens the correct page.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 15007f0f-3cfc-42b7-b64a-c4bea38081fe

📥 Commits

Reviewing files that changed from the base of the PR and between 954b31b and 16f7ba2.

⛔ Files ignored due to path filters (5)
  • .agents/skills/shadcn/assets/shadcn-small.png is excluded by !**/*.png
  • .agents/skills/shadcn/assets/shadcn.png is excluded by !**/*.png
  • bun.lock is excluded by !**/*.lock
  • internal/app/api/api.gen.go is excluded by !**/*.gen.go
  • web/types/api.d.ts is excluded by !**/*.d.ts
📒 Files selected for processing (50)
  • .agents/skills/shadcn/SKILL.md
  • .agents/skills/shadcn/agents/openai.yml
  • .agents/skills/shadcn/cli.md
  • .agents/skills/shadcn/customization.md
  • .agents/skills/shadcn/evals/evals.json
  • .agents/skills/shadcn/mcp.md
  • .agents/skills/shadcn/rules/base-vs-radix.md
  • .agents/skills/shadcn/rules/composition.md
  • .agents/skills/shadcn/rules/forms.md
  • .agents/skills/shadcn/rules/icons.md
  • .agents/skills/shadcn/rules/styling.md
  • .codegraph/.gitignore
  • .codegraph/config.json
  • README.md
  • api/api.v1.openapi.yaml
  • internal/app/api/repositories.go
  • internal/pkg/gitstore/gitstore.go
  • package.json
  • skills-lock.json
  • web/package.json
  • web/public/catppuccin.LICENSE
  • web/public/code-theme-light.json
  • web/public/code-theme.json
  • web/src/app/(site)/[ownerName]/[repoName]/browse/[...path]/page.tsx
  • web/src/app/(site)/[ownerName]/[repoName]/layout.tsx
  • web/src/app/(site)/[ownerName]/[repoName]/settings/layout.tsx
  • web/src/app/(site)/[ownerName]/[repoName]/settings/page.tsx
  • web/src/app/globals.css
  • web/src/app/layout.tsx
  • web/src/components/ExpandableContent.tsx
  • web/src/components/ShikiCodeBlock.tsx
  • web/src/components/layouts/RepoLayout/index.tsx
  • web/src/components/ui/button-group.tsx
  • web/src/components/ui/combobox.tsx
  • web/src/components/ui/command.tsx
  • web/src/components/ui/context-menu.tsx
  • web/src/components/ui/select.tsx
  • web/src/components/ui/sonner.tsx
  • web/src/components/views/ProfileSettings.tsx
  • web/src/components/views/RepositoryFileViewer.tsx
  • web/src/components/views/RepositoryHomepage/RepositoryAside.tsx
  • web/src/components/views/RepositoryHomepage/RepositoryBranchSelect/inner.tsx
  • web/src/components/views/RepositoryHomepage/RepositoryFileList.tsx
  • web/src/components/views/RepositoryHomepage/RepositoryHeader.tsx
  • web/src/components/views/RepositoryHomepage/RepositoryReadme.tsx
  • web/src/components/views/RepositoryHomepage/index.tsx
  • web/src/components/views/RepositorySettingsForm.tsx
  • web/src/lib/server/repository.ts
  • web/src/proxy.ts
  • web/tsconfig.json

Comment thread .agents/skills/shadcn/SKILL.md
Comment thread internal/app/api/repositories.go Outdated
Comment thread internal/app/api/repositories.go
Comment thread skills-lock.json
Comment thread web/public/code-theme-light.json
Comment thread web/public/code-theme.json
Comment thread web/src/app/(site)/[ownerName]/[repoName]/layout.tsx
Comment thread web/src/components/ShikiCodeBlock.tsx
Comment thread web/src/components/views/RepositoryHomepage/RepositoryHeader.tsx Outdated
@Floffah
Floffah merged commit 4854864 into main May 21, 2026
6 checks passed
@Floffah
Floffah deleted the feature/ui-cleanup branch May 21, 2026 14:41
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