Repository navigation
fix(web): focus-visible layering bugs + enable stylelint - #22
Conversation
Add stylelint with stylelint-config-standard + Tailwind v4 syntax support via @dreamsicle.io/stylelint-config-tailwindcss. Wires into pnpm lint (which runs on pre-commit) so CSS drift gets caught going forward. CSS fixes applied: - Rename @Keyframes to kebab-case (fade-slide-in, float-a, float-b, progress-shine, soft-press) — CR flagged this on #11. - Modern color-function notation: rgba(208 128 88 / 40%) instead of rgba(208, 128, 88, 0.4); alpha as percentage. - color-mix() for the .celebrate pulse shadow so it follows --color-accent instead of a hardcoded hex literal. - Replace `transition: all` on input[type=checkbox] with explicit background-color + border-color — avoids the perf cost of animating every property. - Move Google Fonts from CSS @import (render-blocking) to <link> in index.html with rel=preconnect — eliminates the FOUC window where the stylesheet waits on font CSS before it can parse Tailwind. Not in scope: wrapping base styles in @layer base. Unlayered CSS currently has higher priority than any layer, which is what keeps *:focus-visible winning against Tailwind's focus:outline-none on form inputs (GroupSetup, Invite, PersonApp). Moving those rules to a layer without reworking focus handling would break keyboard focus rings. Separate concern. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 58 seconds. ⌛ 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. 📝 WalkthroughWalkthroughAdded a Stylelint config and npm scripts for CSS linting, loaded the Lexend font via Google Fonts in the web HTML, and refactored site CSS: removed font Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 13: The lint:css npm script uses single quotes around the Stylelint glob
which fails on Windows shells; update the "lint:css" script (the package.json
key "lint:css") to use escaped double quotes for the glob pattern instead of
single quotes so the pattern "packages/web/src/**/*.css" is passed correctly on
all platforms.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 13544f3f-b0d6-416f-9978-fec2ec6a95b2
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
.stylelintrc.jsonpackage.jsonpackages/web/index.htmlpackages/web/src/index.css
| "lint:fix": "biome check --write .", | ||
| "lint": "biome check . && pnpm lint:css", | ||
| "lint:fix": "biome check --write . && pnpm lint:css --fix", | ||
| "lint:css": "stylelint 'packages/web/src/**/*.css'", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Do npm/pnpm scripts run via Windows cmd treat single quotes as argument delimiters for commands like: stylelint 'packages/web/src/**/*.css'?
💡 Result:
No, Windows cmd.exe does not treat single quotes (') as argument delimiters. Single quotes have no special meaning in cmd.exe parsing; they are treated as literal characters. cmd.exe uses only double quotes (") for quoting arguments containing spaces. For the example stylelint 'packages/web/src//.css' in an npm or pnpm script executed via cmd.exe: - The single quotes are passed literally to stylelint. - stylelint receives arguments: stylelint, packages/web/src//.css (split on space, ignoring the quotes). - No files match because 'packages/web/src//.css' is not a valid glob pattern (literal quotes interfere). Use double quotes instead: "stylelint "packages/web/src//.css"" in package.json. This is evidenced by multiple sources confirming cmd.exe ignores single quotes (18,16,21), stylelint-specific issues requiring double quotes on Windows (11,12,13), and npm/pnpm script examples replacing single with escaped double quotes (2,4).
Citations:
- 1: https://stackoverflow.com/questions/37500744/how-to-properly-run-a-npm-script-with-arguments/37501023
- 2: Doesn't work with Windows keithamus/npm-scripts-example#5
- 3: Stylelint doesn't work on windows when it's called via npm script stylelint/stylelint#3624
- 4: feat: add Windows warning for single quotes in file patterns stylelint/stylelint#8740
- 5: https://stylelint.io/user-guide/cli/
- 6: https://stackoverflow.com/questions/34448131/does-the-windows-cmd-exe-parse-arguments-differently
- 7: https://stackoverflow.com/questions/24173825/what-does-single-quoting-do-in-windows-batch-files
- 8: https://ss64.com/nt/syntax-esc.html
Use double quotes for the Stylelint glob to fix command execution on Windows platforms.
Single quotes in the stylelint glob pattern are passed literally to the command on Windows cmd.exe, making the glob pattern invalid (e.g., 'packages/web/src/**/*.css' becomes a literal string with quotes rather than a glob). Use escaped double quotes instead for cross-platform compatibility.
Proposed change
- "lint:css": "stylelint 'packages/web/src/**/*.css'",
+ "lint:css": "stylelint \"packages/web/src/**/*.css\"",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "lint:css": "stylelint 'packages/web/src/**/*.css'", | |
| "lint:css": "stylelint \"packages/web/src/**/*.css\"", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@package.json` at line 13, The lint:css npm script uses single quotes around
the Stylelint glob which fails on Windows shells; update the "lint:css" script
(the package.json key "lint:css") to use escaped double quotes for the glob
pattern instead of single quotes so the pattern "packages/web/src/**/*.css" is
passed correctly on all platforms.
There was a problem hiding this comment.
Verified but not fixing — Windows isn't a supported platform baseline here.
Technically correct in isolation: cmd.exe and PowerShell don't strip single quotes the way POSIX sh does, so stylelint 'packages/web/src/**/*.css' would pass the literal glob-with-quotes to stylelint and fail to match. But a Windows contributor can't actually run the toolchain without a POSIX shell for reasons that predate this PR:
.husky/pre-commitusesset -e,command -v,|| { ... }—cmd.execan't parse that. Windows contributors must already be on Git Bash or WSL, both of which handle single quotes fine.- CI is ubuntu-latest across
ci.yml+publish.yml. - No
cross-env/cross-spawn/shxin devDependencies, and no other script inpackage.jsonuses defensive Windows quoting.
Fixing lint:css alone would be theater — the pre-commit hook still excludes cmd.exe users. If Windows support ever becomes a real concern it needs a holistic pass (husky shim, documented shell requirement, CI matrix), not a one-off quote change.
There was a problem hiding this comment.
@iskhakovt, that's a well-reasoned explanation — the .husky/pre-commit POSIX dependency alone makes the single-quote change moot for cmd.exe users. Acknowledged; I won't flag this pattern again in the project.
✏️ Learnings added
Learnt from: iskhakovt
Repo: iskhakovt/spreadsheet PR: 22
File: package.json:13-13
Timestamp: 2026-04-11T23:00:07.155Z
Learning: In iskhakovt/spreadsheet, Windows (cmd.exe/PowerShell) is NOT a supported contributor platform. The toolchain requires a POSIX shell (Git Bash or WSL) because `.husky/pre-commit` uses `set -e`, `command -v`, and `|| { ... }` constructs. CI runs exclusively on ubuntu-latest. There is no cross-platform tooling (cross-env, cross-spawn, shx) in devDependencies. Single-quoted globs in package.json scripts (e.g., `stylelint 'packages/web/src/**/*.css'`) are intentional and acceptable.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: CR
Repo: iskhakovt/spreadsheet PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-11T21:10:12.512Z
Learning: Applies to biome.json : Use Biome for code formatting and linting in the root devDependencies
Learnt from: CR
Repo: iskhakovt/spreadsheet PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-11T21:10:12.512Z
Learning: Applies to {packages/*/package.json,package.json} : Use pnpm workspaces for monorepo; workspace dependency: spreadsheet/shared: workspace:*
Learnt from: CR
Repo: iskhakovt/ai-assistant PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-11T18:31:14.361Z
Learning: Run `pnpm typecheck && pnpm lint && pnpm test` after making changes to verify correctness.
Learnt from: CR
Repo: iskhakovt/cogmo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-11T21:40:46.369Z
Learning: Run `pnpm typecheck && pnpm lint && pnpm test` after making changes to verify correctness
Learnt from: CR
Repo: iskhakovt/cogmo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-11T21:40:46.369Z
Learning: Applies to **/*.integration.test.ts : Re-record LLM mock fixtures via `pnpm test:record` when requests change (new tools, new prompts, etc.). CI runs in strict mode.
Learnt from: CR
Repo: iskhakovt/spreadsheet PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-11T21:10:12.512Z
Learning: style commit type means code formatting only (whitespace, semicolons, lint fixes), not visual/UX changes; UI polish is feat
Learnt from: CR
Repo: iskhakovt/spreadsheet PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-11T21:10:12.512Z
Learning: Applies to packages/web/src/**/*.tsx : Use React 19 and Vite 8 for frontend with Tailwind and shadcn/ui (Base UI primitives)
The universal keyboard-focus outline was unlayered, so it won the
cascade against Tailwind utilities on elements that explicitly opted
into their own focus treatment. Two latent visual bugs on the four
form inputs carrying `focus:outline-none focus:ring-2 focus:ring-accent/30`:
1. Double focus indicator — the unlayered rule's accent-light
outline drew *on top of* the Tailwind ring instead of being
overridden by `outline-none`.
2. Border-radius jumped from md → sm on keyboard focus. The rule
set `border-radius: var(--radius-sm)` on :focus-visible, which
reshapes the element (not the outline as the author likely
intended — outlines follow the element's own shape regardless).
Moving the rule into @layer base fixes both: utilities beat base, so
the form inputs now show only the ring and keep their md corners.
Non-form elements (no focus:outline-none usage anywhere else in the
codebase — verified via grep) still get the accent-light outline.
Also drops the border-radius line entirely since it was doing the
wrong thing.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/web/src/index.css (1)
183-187: Optional: deduplicate focus-visible declarations.Line 183-187 duplicates the checkbox focus outline already declared at Line 178-181. Keeping one source of truth would reduce maintenance noise.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/web/src/index.css` around lines 183 - 187, There are duplicate focus-visible rules: the generic selector *@layer base { *:focus-visible { ... } }* duplicates the checkbox-specific focus outline declared earlier; remove the redundant rule or consolidate both into a single source of truth (either keep the generic *:focus-visible block and remove the checkbox-specific one, or vice versa), ensuring the outline and outline-offset properties are declared only once (refer to the *:focus-visible and the input[type="checkbox"]:focus-visible selectors) so maintenance is simplified.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/web/src/index.css`:
- Around line 183-187: There are duplicate focus-visible rules: the generic
selector *@layer base { *:focus-visible { ... } }* duplicates the
checkbox-specific focus outline declared earlier; remove the redundant rule or
consolidate both into a single source of truth (either keep the generic
*:focus-visible block and remove the checkbox-specific one, or vice versa),
ensuring the outline and outline-offset properties are declared only once (refer
to the *:focus-visible and the input[type="checkbox"]:focus-visible selectors)
so maintenance is simplified.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e79fc723-5f03-4892-be3a-b4ab3122471c
📒 Files selected for processing (1)
packages/web/src/index.css
Declared the same outline + offset as the universal *:focus-visible in @layer base. None of the four checkboxes in the codebase carry any className, so no Tailwind utility exists that would override the base rule — the element-specific block was pure duplication. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Verified and fixed in c097b9f. The |
CSS toolchain revisit is landing in this PR (stylelint enabled, modern color syntax, color-mix, fonts moved to HTML). The focus- visible layering bug surfaced during review shows why visual regression tests matter: cascade-layer accidents are invisible to typecheck + unit tests + E2E flow tests. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
🎉 This PR is included in version 1.3.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Enable stylelint for
packages/web/src/index.csswith Tailwind v4 syntax support, fix everything it flagged, and fix two latent focus-indicator bugs that the review surfaced.Tooling
stylelint,stylelint-config-standard,@dreamsicle.io/stylelint-config-tailwindcss(the dreamsicle config teaches stylelint Tailwind v4's@theme/@apply/@utilitysyntax; no stylistic opinions).pnpm lintnow runs biome + stylelint; pre-commit picks this up automatically.pnpm lint:fixruns both with auto-fix.selector-no-vendor-prefixfor::-webkit-scrollbar*(no standard alternative),property-no-vendor-prefixforfont-smoothing(non-standard property, WebKit/Gecko only).CSS fixes
fadeSlideIn,floatA,floatB,progressShine,softPress. CR review flagged this on feat(web): polish Landing, Question flow, and Comparison screens #11.celebratealready passed (single word).rgba(208, 128, 88, 0.4)→rgb(208 128 88 / 40%)throughout. Alpha as percentage.color-mix()for.celebratepulse — shadow now derives from--color-accentviacolor-mix(in srgb, var(--color-accent) 40%, transparent)instead of a hardcoded hex literal. Palette changes propagate automatically.transition: alloninput[type=checkbox]→ explicitbackground-color, border-color. Avoids the well-known perf cost of animating every property on hover/check.@importto HTML<link>withrel=preconnectforfonts.googleapis.com+fonts.gstatic.com. CSS@importblocks stylesheet parsing until the fetch completes;<link>in the head is parallelizable and preconnect warms the TCP/TLS handshake.import-notation,alpha-value-notation, split multi-declaration single-line rules incelebrate.Focus-indicator fix (
*:focus-visibleinto@layer base)The universal keyboard-focus outline was unlayered, so it won the cascade against Tailwind utilities on elements that had explicitly opted into their own focus treatment. Two latent visual bugs on the four form inputs carrying
focus:outline-none focus:ring-2 focus:ring-accent/30(GroupSetup,Invite,PersonApp):outline-none.border-radius: var(--radius-sm)on:focus-visible, which reshapes the element itself (not the outline as the author likely intended — outlines follow the element's own shape regardless).Moving the rule into
@layer basefixes both: utilities beat base, so the form inputs now show only the ring and keep their md corners. Non-form elements (nofocus:outline-noneusage anywhere else — verified via grep) still get the accent-light outline. Also drops theborder-radiusline entirely since it was doing the wrong thing.Test plan
pnpm lint(biome + stylelint) cleanpnpm typecheckcleanpnpm test— 289 tests passingpnpm --filter @spreadsheet/web build— builds cleanly<link>(not CSS@import) and preconnect fires🤖 Generated with Claude Code
Summary by CodeRabbit
Style
Chores