feat: highlighted view code - #6
Conversation
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis 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. ChangesShadcn/UI Skill Documentation and Tooling
Repository File Access and Settings Management
UI Component Library and Repository Browsing Experience
Tooling, Configuration, and Dependencies
🎯 4 (Complex) | ⏱️ ~60 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (5)
.agents/skills/shadcn/assets/shadcn-small.pngis excluded by!**/*.png.agents/skills/shadcn/assets/shadcn.pngis excluded by!**/*.pngbun.lockis excluded by!**/*.lockinternal/app/api/api.gen.gois excluded by!**/*.gen.goweb/types/api.d.tsis 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.jsonREADME.mdapi/api.v1.openapi.yamlinternal/app/api/repositories.gointernal/pkg/gitstore/gitstore.gopackage.jsonskills-lock.jsonweb/package.jsonweb/public/catppuccin.LICENSEweb/public/code-theme-light.jsonweb/public/code-theme.jsonweb/src/app/(site)/[ownerName]/[repoName]/browse/[...path]/page.tsxweb/src/app/(site)/[ownerName]/[repoName]/layout.tsxweb/src/app/(site)/[ownerName]/[repoName]/settings/layout.tsxweb/src/app/(site)/[ownerName]/[repoName]/settings/page.tsxweb/src/app/globals.cssweb/src/app/layout.tsxweb/src/components/ExpandableContent.tsxweb/src/components/ShikiCodeBlock.tsxweb/src/components/layouts/RepoLayout/index.tsxweb/src/components/ui/button-group.tsxweb/src/components/ui/combobox.tsxweb/src/components/ui/command.tsxweb/src/components/ui/context-menu.tsxweb/src/components/ui/select.tsxweb/src/components/ui/sonner.tsxweb/src/components/views/ProfileSettings.tsxweb/src/components/views/RepositoryFileViewer.tsxweb/src/components/views/RepositoryHomepage/RepositoryAside.tsxweb/src/components/views/RepositoryHomepage/RepositoryBranchSelect/inner.tsxweb/src/components/views/RepositoryHomepage/RepositoryFileList.tsxweb/src/components/views/RepositoryHomepage/RepositoryHeader.tsxweb/src/components/views/RepositoryHomepage/RepositoryReadme.tsxweb/src/components/views/RepositoryHomepage/index.tsxweb/src/components/views/RepositorySettingsForm.tsxweb/src/lib/server/repository.tsweb/src/proxy.tsweb/tsconfig.json
What this changes
How I tested this
manual
Checklist