Skip to content

Feature/ai code reviewer - #72

Merged
swadhinbiswas merged 111 commits into
mainfrom
feature/ai-code-reviewer
Jul 31, 2026
Merged

Feature/ai code reviewer#72
swadhinbiswas merged 111 commits into
mainfrom
feature/ai-code-reviewer

Conversation

@swadhinbiswas

@swadhinbiswas swadhinbiswas commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Style

    • Refined light-theme primary and focus-ring colors for improved visual consistency and contrast.
  • Tests

    • Improved accessibility test coverage across mobile layouts, keyboard navigation, and landmark checks.
    • Strengthened theme-switching tests to verify menu options, persistence, and reload behavior more reliably.
    • Updated test reporting to capture failed test details.

- Use bun install --production to exclude dev dependencies
- Use oven/bun:1-slim instead of oven/bun:1 (smaller base)
- Use --no-install-recommends for apt packages
- Clean up apt cache in same layer
- Rename REPOS_PATH to GIT_REPOS_PATH for consistency
- AdminLayout: replace @apply with explicit CSS properties
- admin/index: remove :global() wrapper from style block
- BaseLayout: replace @apply with plain CSS for container
…cks from layouts blocks from layouts

- Move glass-panel and custom-scrollbar styles to globals.css
- Remove style block from admin/index.astro
- Remove style block from AdminLayout.astro
- notification-preferences: remove checkbox style block
- blob/[branch]/[...path]: remove shiki/scrollbar style block
- blame/[branch]/[path]: remove shiki/scrollbar style block
- ide/index: move inline styles to body attribute
- globals.css: add shiki/scrollbar styles centrally
… globals.css

- Remove <style is:global> from BaseLayout.astro
- Add font-family, container, scroll-behavior to globals.css
- Zero style blocks remain in any Astro files
Vite 8.x defaults to LightningCSS for CSS transformation, which
conflicts with Tailwind CSS v3 directives (@tailwind, @apply, @layer).
This caused 'Attempted to assign to readonly property' error during
Docker build on src/styles/globals.css.

Explicitly set css.transformer to 'postcss' in the Vite config to
ensure compatibility with Tailwind CSS v3.
The Docker build uses Astro 4.x which depends on Vite 5.4.21.
PostCSS 8.5.x introduced frozen/readonly AST node properties that
Vite 5.4.21's compileCSS function tries to mutate, causing:
  'Attempted to assign to readonly property' on globals.css

Pin PostCSS to ~8.4.49 (both in devDependencies and overrides)
to ensure compatibility until Astro upgrades to Vite 6+.
…ike design

- Fixed Vite 5 / PostCSS 8.5.x frozen AST bug by removing @astrojs/tailwind integration and pinning postcss.
- Moved CSS tools to dependencies and updated Dockerfile for multi-stage dependency installs.
- Cleaned and modernized globals.css.
- Merged duplicate class definitions (.glass-panel, .custom-scrollbar).
- Overhauled light theme to reflect modern GitHub aesthetics.
- Added missing Shadcn sidebar and chart tokens for all themes.
- Updated scrollbar implementation to use standard `scrollbar-width` and `scrollbar-color` properties.
- Added getCsrfToken to new.astro to generate the token and cookie on the server.
- Passed the token into a hidden input field.
- Extracted the token and included it in the X-CSRF-Token header in the client-side fetch request.
- Extracted CSRF token generation to BaseLayout and AdminLayout.
- Injected token via <meta name="csrf-token" /> tag.
- Added global window.fetch interceptor to automatically append the 'x-csrf-token' header to all state-changing requests (POST, PUT, PATCH, DELETE).
- Reverted manual CSRF handling in new.astro as it's now handled globally for all API requests (repo creation, profile updates, etc).
- Updated createSimpleGit and getGit to use getSanitizedGitEnv.
- Passed INTERNAL_HOOK_SECRET to ensure pre-receive and post-receive hooks authenticate correctly for system-initiated pushes like repository initialization.
- Added a fallback 'system' REMOTE_USER to bypass path protections when no specific user is authenticated.
- Updated installHooks to use port 4321 instead of 3000 as the fallback when SITE_URL is not set.
- Fixes the issue where curl would fail to connect to the internal API during hook execution, resulting in an empty response body and a 'pre-receive hook declined' error.
- Updated installHooks to always point curl to 127.0.0.1 instead of SITE_URL.
- This prevents connection timeouts when SITE_URL is an external IP that the host cannot route to itself.
- Added -sS flag to curl to bubble up explicit connection errors rather than failing silently with an empty body.
- Darken --primary/--ring from hsl(212,100%,48%) to hsl(212,100%,37%)
  to pass WCAG 2.1 AA contrast ratio (4.5:1 minimum)
- Replace broken axe-core disableRules() with options({ rules: {...} })
  for reliable color-contrast rule disabling
- Replace flaky waitForTimeout() with deterministic waitForFunction()
  in theme toggle E2E tests
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Too many files changed for review. (139 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Failed to post review comments.

We encountered an issue with GitHub. Use @coderabbitai full review to retry the review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 00619104-c0a4-4dde-b959-33bd3db21b54

📥 Commits

Reviewing files that changed from the base of the PR and between cf1ca3f and b5af5f5.

📒 Files selected for processing (5)
  • playwright-report/index.html
  • src/styles/globals.css
  • test-results/.last-run.json
  • tests/e2e/accessibility.spec.ts
  • tests/e2e/theme-toggle.spec.ts
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Lint & Type Check
  • GitHub Check: Security Gates
🧰 Additional context used
🪛 ast-grep (0.45.0)
playwright-report/index.html

[error] 17-17: React's useState should not be directly called
Context: setTimeout(async()=>{Ol=Ol.filter(r=>r!=i);try{await i.terminate()}catch{}},f)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)


[error] 56-56: React's useState should not be directly called
Context: setTimeout(function(){throw l})
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)


[error] 56-56: React's useState should not be directly called
Context: setTimeout(function(){throw a})
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)


[error] 57-57: React's useState should not be directly called
Context: setTimeout(function(){throw t})
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)


[error] 57-57: React's useState should not be directly called
Context: setTimeout(function(){if(t.stylesheets&&Xu(t,t.stylesheets),t.unsuspend){var s=t.unsuspend;t.unsuspend=null,s()}},6e4+e)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)


[error] 57-57: React's useState should not be directly called
Context: setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Xu(t,t.stylesheets),t.unsuspend)){var s=t.unsuspend;t.unsuspend=null,s()}},(t.imgBytes>Ef?50:800)+e)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)


[error] 57-57: React's useState should not be directly called
Context: setTimeout(n,20)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)


[error] 57-57: React's useState should not be directly called
Context: setTimeout(n,100)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)


[warning] 57-57: Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: t.innerHTML=n
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] 57-57: Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: t.innerHTML=n
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] 17-17: Avoid using the initial state variable in setState
Context: setTimeout(async()=>{Ol=Ol.filter(r=>r!=i);try{await i.terminate()}catch{}},f)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(setstate-same-var)


[warning] 57-57: Avoid using the initial state variable in setState
Context: setTimeout(n,20)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(setstate-same-var)


[warning] 57-57: Avoid using the initial state variable in setState
Context: setTimeout(n,100)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(setstate-same-var)


[warning] 64-64: Avoid hand-rolled HTML escaping (replacing characters with HTML entities); use a vetted encoder/sanitizer such as DOMPurify or sanitize-html.
Context: i.replace(/[&"<>]/g,u=>({"&":"&",'"':""","<":"<",">":">"})[u])
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(manual-sanitization)


[warning] 57-57: Detects non-literal values in regular expressions
Context: new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/|www\.)[^\\s"+x2+'"]{2,}[^\s'+x2+"')}\\],:;.!?],"ug")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)

📝 Walkthrough

Walkthrough

The light-theme primary and ring tokens now use lower lightness. Accessibility tests improve mobile setup and focus checks. Theme-toggle tests use explicit controls and condition-based persistence checks.

Changes

Theme and end-to-end validation

Layer / File(s) Summary
Light-theme color tokens
src/styles/globals.css
The light-theme --primary and --ring tokens changed from 48% to 37% lightness.
Accessibility test flow
tests/e2e/accessibility.spec.ts, test-results/.last-run.json
Accessibility tests update mobile viewport setup, visibility waits, axe rules, and skip-link focus handling. The test record now lists 11 failed test identifiers.
Theme-toggle persistence flow
tests/e2e/theme-toggle.spec.ts
Theme-toggle tests use the palette control, explicit Light and Default Dark options, condition-based waits, specific localStorage.theme values, and awaited reload completion.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: enhancement

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is generic and does not describe the color-token update or the E2E test changes in the pull request. Use a concise title that identifies the primary change, such as improving theme-toggle and accessibility E2E tests.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ai-code-reviewer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@swadhinbiswas swadhinbiswas left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

dd

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@swadhinbiswas
swadhinbiswas merged commit b32ab9d into main Jul 31, 2026
14 of 15 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