refactor(ui): replace CSS :has() modal sizing with explicit modal classes - #896
Conversation
…sses
The Obsidian plugin registry CSS-lint flagged 5 uses of `:has()` for
modal sizing — broad selector invalidation costs that grow with vault
size. Each call site was a `.modal.modal-container:has(.X)` selector
setting `width` on the modal based on a child content class.
Replaces the pattern with `this.modalEl.addClass('mod-X')` in each
modal's `onOpen()` plus a flat `.modal.mod-X` selector. The existing
`contentEl.addClass()` calls stay — those drive other in-modal rules
that target the content element.
Also drops the `gemini-tool-confirmation-modal` rule block, which was
dead CSS (no element ever received that class).
The `generated-help-references.ts` regen is incidental — it caught up
the auto-generated file with the eval-suite reference that #893 added
without committing the regen.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📜 Recent review details⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🧰 Additional context used📓 Path-based instructions (4)src/**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/ui/**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/ui/agent-view/**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (8)📚 Learning: 2025-12-29T00:49:29.597ZApplied to files:
📚 Learning: 2026-04-14T00:36:00.034ZApplied to files:
📚 Learning: 2026-03-01T22:53:18.726ZApplied to files:
📚 Learning: 2026-04-14T00:35:57.612ZApplied to files:
📚 Learning: 2026-04-20T02:48:16.135ZApplied to files:
📚 Learning: 2026-05-04T22:54:56.817ZApplied to files:
📚 Learning: 2026-03-02T01:02:13.449ZApplied to files:
📚 Learning: 2026-04-10T00:49:45.270ZApplied to files:
🔇 Additional comments (7)
WalkthroughThis PR extends the help references with evals.md and refactors modal styling across five modals from CSS ChangesEvals Reference
Modal Styling Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
The Obsidian plugin registry CSS-lint flagged 5 uses of
:has()for modal sizing (registry feedback: "Avoid:has— it can cause significant performance issues due to broad selector invalidation"). Each call site was a.modal.modal-container:has(.X)selector settingwidthon the modal based on a child content class.Replaces the pattern with
this.modalEl.addClass('mod-X')in each modal'sonOpen()plus a flat.modal.mod-Xselector. The existingcontentEl.addClass()calls stay — those drive other in-modal rules that target the content element.Also drops the
gemini-tool-confirmation-modalrule block, which was dead CSS (no element ever received that class — grep confirms zero source references).Changes
src/ui/rag-status-modal.ts,src/ui/rag-progress-modal.ts,src/ui/background-tasks-modal.ts,src/ui/agent-view/project-picker-modal.ts,src/ui/agent-view/session-list-modal.ts— addthis.modalEl.addClass('mod-X')alongside existingcontentEl.addClass().styles.css— 4 selectors moved from.modal.modal-container:has(.X)to.modal.mod-X; thegemini-tool-confirmation-modalblock (2 dead rules) deleted.src/services/generated-help-references.ts— incidental: caught up the auto-generated file with the eval-suite reference that docs: publish eval-suite methodology + results table (#874, #875) #893 added without committing the regen.Checklist
Required
npm test,npm run build,npm run format-check)AI-Generated Code
Summary by CodeRabbit