Skip to content

chore(webview): remove dead CSS classes from the global stylesheet - #2251

Open
myk1yt wants to merge 1 commit into
Zoo-Code-Org:mainfrom
myk1yt:chore/remove-declaration-only-dead-code
Open

myk1yt wants to merge 1 commit into
Zoo-Code-Org:mainfrom
myk1yt:chore/remove-declaration-only-dead-code

Conversation

@myk1yt

@myk1yt myk1yt commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

What

Removes dead CSS classes from webview-ui/src/index.css. 3 lines added, 63 removed, one file.

Headline: most of PR-D1's planned scope was already removed upstream

PR-D1 was planned against a stale tree. The diet validation swarm scanned afec61ad3 (2026-10-07). origin/main is 159c42e15 (2026-10-30) and already contains 1cbc0f4d6 "deps(knip): enable production mode and remove dead code (#527)" (2026-10-17, 121 files, -4372 lines) plus 69a7d7df8 and 16425bcf3, which removed 19 of the 20 planned rows.

Every planned row was re-verified on origin/main before cutting. Result: 19 already gone (0 hits), 1 removed here, 1 kept deliberately.

Per-row verification (all counts are git grep -nw <sym> -- . on origin/main)

Row Planned Status on origin/main Evidence
ICodeIndexManager 70L remove already removed 0 hits; 1cbc0f4d6 deleted 83L from interfaces/manager.ts
IndexProgressUpdate 8L remove already removed 0 hits; same commit
extractEnvironmentDetailsForMiniMax 11L remove already removed 0 hits; 1cbc0f4d6 (api/transform/minimax-format.ts)
waitForClineInitialization 11L remove already removed 0 hits; 1cbc0f4d6
CachePoint 5L remove already removed 0 hits; 16425bcf3
buildNativeToolsArray 5L remove already removed 0 hits; 1cbc0f4d6 (core/task/build-tools.ts)
ClineProviderEvents 5L remove already removed 0 hits; 1cbc0f4d6 (core/webview/ClineProvider.ts)
flushModelProviders 4L remove already removed 0 hits; 1cbc0f4d6 (api/providers/fetchers/modelEndpointCache.ts)
auto-approval 2 fns 8L remove already removed 0 hits; 1cbc0f4d6 (core/auto-approval/commands.ts)
getCurrentLanguage 4L remove already removed 0 hits; 1cbc0f4d6 (i18n/index.ts)
formatGitSuggestion 3L remove already removed 0 hits; 1cbc0f4d6 (shared/context-mentions.ts)
getModeConfig 3L remove already removed 0 hits; 69a7d7df8 (shared/modes.ts)
MessageQueueState 1L remove already removed 0 hits; 1cbc0f4d6
loadRooConfiguration 1L remove already removed 0 hits; 1cbc0f4d6 (services/roo-config/index.ts)
registerCommands unused imports 2L remove already removed no Package / t imports remain in src/activate/registerCommands.ts
webview: EditMessage/DeleteMessageWithCheckpointDialog remove already removed 0 hits; 1cbc0f4d6 (CheckpointRestoreDialog.tsx)
webview: McpServerRestrictionImpl remove already removed 0 hits; b69989b82
webview: scanDOMForSearchableSettings remove already removed 0 hits; 1cbc0f4d6 (useSettingsSearch.ts)
CSS .border-x / .border-y remove removed here 0 refs repo-wide
CSS .animate-smooth-bounce remove removed here 0 refs; keyframe stays (RooHero uses it inline)
CSS .code-block-scrollable (7 rules + comment) remove removed here 0 refs; emitter was commented out upstream
CSS .custom-markdown remove removed here 0 refs
CSS .animate-slide-in-right + orphaned keyframe remove removed here 0 refs
CSS .dropdown-container remove KEPT - recorded see below

Why .dropdown-container is kept

The seats disagree (DEEP: dead, 2 hits both in index.css; MLARGE: dead; GLM: dead but flagged as a documented toolkit pattern). I checked the mechanism DEEP relied on and it does not hold: @vscode/webview-ui-toolkit@1.4.0 dist/ contains zero occurrences of dropdown-container (grep -ro | wc -l -> 0), and the dropdown component only emits select-indicator. So the class is not runtime-injected by the toolkit.

It is still kept, because removing a documented toolkit pattern is a visual-risk call that needs a render check, and this PR is declaration-only with zero runtime change by design. Deferred to a NEEDS-TEST unit together with the ui/ wrapper work.

Out of scope (explicitly untouched)

Per the CEO ruling, none of the following are in this PR:

  1. All dead ui/ wrappers (dropdown-menu, select-dropdown, autosize-textarea, radio-group) and their radix deps - seat split unresolved, deferred to a later NEEDS-TEST unit.
  2. The ChatRow placeholder switch(code) - the comment literally says "Do not remove this".
  3. restoreTodoListForTask / parseMarkdownChecklist - LIVE (3 and 32 hits).
  4. The 13 remaining *ToolUse + TOOL_DISPLAY_NAMES rows and the 2 shim spec-consumed interfaces - PR-D2's job.
  5. checkbox / popover / dialog / slider radix exports - LIVE via barrel.
  6. vscrui-checkbox* CSS - LIVE: vscrui Checkbox is imported by 11 prod files and always renders label.vscrui-checkbox + inner svg.
  7. scss and .chromium - not classes. scss is text inside a comment URL (index.css:255); .chromium does not exist in preflight.css (its only occurrences are bugs.chromium.org URLs in comments).

Verification

Check Command Result
src typecheck pnpm --dir src run check-types pass (clean)
webview typecheck pnpm --dir webview-ui run check-types pass (clean)
webview build pnpm --dir webview-ui run build pass, exit 0
knip pnpm knip identical to baseline: 5 config hints, 0 errors, no new issues
Built CSS - removed names absent grep src/webview-ui/build/assets/index.css animate-slide-in-right 0, animate-smooth-bounce 0, custom-markdown 0, code-block-scrollable 0
Built CSS - live siblings intact same file animate-fade-in 1, smooth-bounce 1, scrollable 10
CSS structural validity brace balance + empty-rule scan balanced (69/69), 0 empty rule blocks
Prettier prettier --check webview-ui/src/index.css pass
Mutation budget node scripts/stryker-diff.mjs ci --base <origin/main> --head <HEAD> 0/500 - "No changed executable lines in mutation-tested packages"
ESLint suppressions src/eslint-suppressions.json untouched, no count increase
Line endings committed blob LF, 0 CRLF - matches base blob, no churn
Conflict markers / zero-byte scan none (only intentional .gitkeep files)

Targeted suites (webview, the modules whose CSS this touches):

  • CodeBlock.spec.tsx + MermaidBlock.spec.tsx - 2 files, 10/10 passed
  • ChatView.scroll-debug-repro.spec.tsx (exercises .scrollable) - 1 file, 14/14 passed

Risk

Zero runtime behavior change. No TS/TSX touched, so no import, type, or logic surface moves. The only shipped artifact delta is a smaller stylesheet: 4 dead class names disappear from the bundle, every live selector is preserved and was verified present in the built output.

No changeset, no CHANGELOG (per AGENTS.md).

What:
- Drop the `.border-x` / `.border-y` selectors from the `@layer components`
  border-color rule (`.border`, `.border-r`, `.border-l`, `.border-t`,
  `.border-b` stay).
- Drop `.animate-smooth-bounce` (the `smooth-bounce` keyframe stays: RooHero
  applies it through an inline `animation` style).
- Drop the `.code-block-scrollable` selectors: the two border/transition
  rules and the five `::-webkit-scrollbar-*` rules plus their comment block.
  `.scrollable` and its `body:hover` / `body:focus-within` variants stay.
- Drop `.custom-markdown > pre` and `.animate-slide-in-right` together with
  its now-orphaned `slide-in-right` keyframe.

Why:
- Every removed class has zero references across the tracked tree
  (`git grep <class> -- . ':!webview-ui/src/index.css'` returns 0 for each).
  No component, test, visual fixture, or dependency emits them. The
  `.code-block-scrollable` emitter was deleted upstream when the className was
  commented out; the stylesheet rules were left behind.
- `.animate-smooth-bounce` was never applied: RooHero.tsx:24 sets
  `animation: "smooth-bounce 1s ease-in-out infinite"` directly, which is why
  the keyframe must stay and only the wrapper class goes.

Impact:
- No runtime behavior change. The built stylesheet keeps every live sibling
  (verified against `src/webview-ui/build/assets/index.css`: `animate-fade-in`,
  `smooth-bounce`, and `scrollable` are all still emitted; the four removed
  names are absent).
- 63 lines removed, 3 lines added (the shortened selector terminators).
- Also normalizes this file's line endings to LF to match the committed blob,
  which incidentally clears a pre-existing Prettier failure on the file.

Deliberately out of scope (kept): `.dropdown-container`. The seats disagree on
whether it is dead, and it is a documented toolkit dropdown pattern, so it is
deferred to a NEEDS-TEST unit rather than decided here.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 159c42e and e4b0eb0.

Files selected for processing: 1
  • webview-ui/src/index.css

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Recent review details
Additional context used
Path-based instructions: 2
Check React state and effect dependencies, cleanup, accessibility, i18n, and light/dark theme behavior.

CodeRabbit configuration file

Files:

  • webview-ui/src/index.css
Act as an adversarial second-opinion reviewer.

CodeRabbit configuration file

Files:

  • webview-ui/src/index.css
📝 Summary

Summary by CodeRabbit

  • Style
    • Scrollbar reveal behavior now applies to scrollable areas more broadly, including when the page is hovered or focused; code-block-specific scrollbar behavior has been removed.
    • Removed several border color rules, code-block background styling, and the slide-in and smooth-bounce animations. These visual effects are no longer available.

The stylesheet updates scrollbar reveal selectors to use .scrollable and removes code-block-specific scrollbar styling. It also removes border-color selectors, animation classes and keyframes, and a Markdown preformatted-block background override.

Changes: Stylesheet updates

Layer / File(s) Summary
Scrollbar reveal selectors
webview-ui/src/index.css
Scrollbar reveal rules now target .scrollable elements. Code-block-specific reveal conditions and WebKit scrollbar styling are removed.
Border, animation, and Markdown rules
webview-ui/src/index.css
The border-color selector drops .border-x and .border-y. The stylesheet removes the animate-smooth-bounce class, the transparent Markdown pre background override, and the slide-in-right animation and class.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • Zoo-Code-Org/Zoo-Code#1763: Changes the task header to use .scrollable, the selector used by this PR’s scrollbar reveal rules.
Merge Risk: Minimal · up to e4b0e

No actionable merge-blocking issue is established for this CSS cleanup. It is mergeable subject to normal checks.

Pre-merge checks: Passed 7 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description gives detailed implementation context and test results, but it omits the required approved GitHub Issue link and does not complete the required pre-submission checklist or template sec… Add a Related GitHub Issue entry with an approved issue number, complete the Pre-Submission Checklist, and address the required Documentation Updates and Get in Touch sections.
Passed Passed checks: 7 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: removing unused CSS classes from the global stylesheet.
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.
Regression Evidence Passed PASS. The diff removes selectors with no live references in either reviewed revision: .border-x, .border-y, .animate-smooth-bounce, .code-block-scrollable, .custom-markdown, and `.animate-sl…
Security Boundaries Passed PASS. The pull request changes only webview-ui/src/index.css. The diff removes unused CSS selectors, animation declarations, and scrollbar rules. It adds no code that handles secrets or PII, validat…
Persistence Integrity Passed PASS: The pull request changes only webview-ui/src/index.css. The diff removes CSS selectors, scrollbar rules, a Markdown style, and animation declarations. It adds no persistence operation, write p…
Lifecycle Resource Cleanup Passed PASS. The reviewed range changes only webview-ui/src/index.css. It removes CSS selectors, keyframes, and scrollbar styling, and narrows the .scrollable selector rules. It adds no listener, watcher…
Full details: Regression Evidence

Explanation

PASS. The diff removes selectors with no live references in either reviewed revision: .border-x, .border-y, .animate-smooth-bounce, .code-block-scrollable, .custom-markdown, and .animate-slide-in-right. CodeBlock uses styled components and does not emit .code-block-scrollable; MarkdownBlock uses StyledMarkdown and does not emit .custom-markdown; RooHero uses the retained smooth-bounce keyframe through an inline animation. The live .scrollable behavior remains, and its existing ChatView coverage remains. No concrete changed behavior or durable visible UI change requires new focused coverage.

Full details: Security Boundaries

Explanation

PASS. The pull request changes only webview-ui/src/index.css. The diff removes unused CSS selectors, animation declarations, and scrollbar rules. It adds no code that handles secrets or PII, validates or executes input, or changes approval or allowlist controls. No changed path matches a security-boundary failure condition.

Full details: Persistence Integrity

Explanation

PASS: The pull request changes only webview-ui/src/index.css. The diff removes CSS selectors, scrollbar rules, a Markdown style, and animation declarations. It adds no persistence operation, write path, default propagation, rollback path, or state consumer. No changed persistence path can trigger the specified failure conditions.

Full details: Lifecycle Resource Cleanup

Explanation

PASS. The reviewed range changes only webview-ui/src/index.css. It removes CSS selectors, keyframes, and scrollbar styling, and narrows the .scrollable selector rules. It adds no listener, watcher, provider, timer, task, disposal, cancellation, or restart path. No changed lifecycle resource cleanup issue exists.

Full details: Description check

Explanation

The description gives detailed implementation context and test results, but it omits the required approved GitHub Issue link and does not complete the required pre-submission checklist or template sections.

Resolution

Add a Related GitHub Issue entry with an approved issue number, complete the Pre-Submission Checklist, and address the required Documentation Updates and Get in Touch sections.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Biome (2.5.15)
webview-ui/src/index.css

File contains syntax errors that prevent linting: Line 22: Tailwind-specific syntax is disabled.; Line 25: Tailwind-specific syntax is disabled.; Line 27: Tailwind-specific syntax is disabled.; Line 214: Tailwind-specific syntax is disabled.

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.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review status

Thanks for contributing. This comment tracks the review sequence and the next action.

Current step: Awaiting fresh human maintainer or CODEOWNER approval.

Automated review is complete for the latest commit but does not replace human approval.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Oct 30, 2026
@github-actions github-actions Bot added awaiting-maintainer CodeRabbit approved; waiting for a human maintainer and removed coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Oct 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-maintainer CodeRabbit approved; waiting for a human maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant