fix(notes): keep the note stylesheet in the production bundle - #270
Merged
Conversation
`NotesWindow.module.css` was imported for its side effect only, with no binding. Rollup tree-shakes a binding-less CSS-module import out of the production bundle, so the shipped app carried zero `.tiptap` rules — dev looked fine because Vite injects module CSS at runtime there. Without `height: 100%` + `overflow-y: auto` the note body stops being a scroll container and grows to the height of its content. Paste a long note and ProseMirror scrolls the caret into view, which now scrolls the `overflow: hidden` shell instead: the toolbar leaves the viewport and the wheel cannot bring it back. Measured on a 400x540 window with ~5.8k characters pasted — editor 6360px tall, `scrollTop` pinned, toolbar at y=-5913, zero buttons hit-testable. Every selector in the file was already `:global`, so the CSS module bought nothing: rename it to plain `.css` and drop the wrappers. A plain CSS import is always emitted. This also restores the mirror transform, list markers, code blocks and heading sizes in production.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughNotesWindow now imports a global stylesheet. TipTap selectors use plain ChangesNotesWindow global stylesheet
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
This was referenced Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Notes window becomes unusable as soon as a long text is pasted into it: the note fills the whole window, the wheel does nothing, and every toolbar button leaves the screen for good.
Root cause is a build-time one, which is why it never showed in dev.
NotesWindow.tsximported its stylesheet for the side effect only:Rollup tree-shakes a binding-less CSS-module import out of the production bundle.
dist/assets/*.csscontained 0.tiptaprules, whileLaunchWindow.module.css(imported with a binding) was bundled normally. Vite injects module CSS at runtime in dev, so the dev server always looked correct.Without
height: 100%+overflow-y: auto, the note body stops being a scroll container and grows to its content height. Pasting puts the caret at the end, ProseMirror scrolls it into view, and the only scrollable ancestor left is theoverflow: hiddenshell — so the toolbar scrolls out of the viewport and the wheel cannot bring it back.Every selector in the file was already
:global(...), so the CSS module bought nothing. Renamed to a plainNotesWindow.cssand dropped the wrappers; a plain CSS import is always emitted. This also restores the mirror transform, list markers, code blocks and heading sizes in the packaged app — all silently missing until now.Related issue
Fixes #
Type of change
Release impact
Desktop impact
Screenshots / video
Measured rather than eyeballed — 400x540 window (the Notes window default), ~5.8k characters pasted:
Testing
npx vite buildthen grep the emitted CSS: 0.tiptaprules before, 30 after.vite preview) at?showNotes=true, 400x540, pasted ~5.8k characters: editor stays 412 px withoverflow-y: auto,scrollHeight3600, shellscrollTopstays 0, both toolbar rows visible, all 13 buttons hit-testable.vitest --run src/components/launch/→ 85 passed;tsc --noEmitclean; Biome clean.NotesWindow.test.tsx: the stylesheet must not be a CSS module, and.tiptapmust keepheight: 100%+overflow-y: auto.Note for the release manager
Branched from
mainper the workflow doc.release/v1.9.0is frozen at1.9.0-rc.2and carries the same bug, so this needs a manual cherry-pick onto the release branch if it should ship in 1.9.0.Summary by CodeRabbit