Repository navigation
refactor(webapp): split the three stylesheets into ordered parts - #361
Conversation
…ories The move alone, so that history follows each sheet into its first part. The next commit splits them and puts the three entry files back as ordered lists of @import. Signed-off-by: InstaZDLL <github.105mh@8shield.net>
styles.css, refresh.css and fluid.css keep their names and their place in main.tsx, and each is now an ordered list of @import over the parts under styles/, refresh/ and fluid/. Concatenated in that order, the parts are the old sheets byte for byte apart from the @import lines and each part's one-line header, and the built CSS bundle is byte-identical. The style tests read the sheets through sheets.ts, which inlines each entry's parts in order and throws if a part is imported by no entry or an entry names a part that does not exist: read raw, an entry is a list of paths and not one rule. Signed-off-by: InstaZDLL <github.105mh@8shield.net>
|
No actionable comments were generated in the recent review.
|
| Couche / Fichier(s) | Résumé |
|---|---|
Assemblage et imports des feuilles webapp/src/styles/sheets.ts, webapp/src/styles/fluid.css, webapp/src/styles/refresh.css, webapp/src/styles/design-tokens/themes-contrast.test.ts, webapp/src/styles/styles.test.ts |
sheets.ts assemble les imports CSS bruts et exporte les feuilles styles, refresh et fluid. Les feuilles d’entrée et les tests utilisent ces exports. |
Fondations et contrôles fluid webapp/src/styles/fluid/tokens.css, webapp/src/styles/fluid/base.css |
Les tokens définissent les palettes et valeurs partagées. La feuille de base définit le corps, la typographie, les boutons, les champs et les contrôles natifs. |
Navigation et pages fluid webapp/src/styles/fluid/rail.css, webapp/src/styles/fluid/page.css, webapp/src/styles/fluid/menus-sign-in-motion.css |
Ces feuilles définissent la navigation, les pages, les panneaux et les menus fluid, avec des règles responsives et de réduction des animations. |
Lecteur et sélecteur de thème fluid webapp/src/styles/fluid/player-bar.css, webapp/src/styles/fluid/theme-picker.css |
Les feuilles définissent la barre du lecteur, sa progression, la galerie de thèmes et les aperçus des cartes. |
Base, coque et surfaces refresh webapp/src/styles/refresh/base.css, webapp/src/styles/refresh/shell.css, webapp/src/styles/refresh/surfaces.css, webapp/src/styles/refresh/login-player-responsive.css |
Ces feuilles définissent les thèmes, la coque, les surfaces et les adaptations responsives de connexion et du lecteur. |
Albums et files refresh webapp/src/styles/refresh/album.css, webapp/src/styles/refresh/queue.css |
Ces feuilles définissent la présentation des albums, des morceaux, des albums associés et des files de lecture. |
Fondations et catalogue styles webapp/src/styles/styles/base.css, webapp/src/styles/styles/shell.css, webapp/src/styles/styles/panels.css, webapp/src/styles/styles/catalog.css, webapp/src/styles/styles/artist-hero.css |
Ces feuilles définissent les thèmes, la coque, les panneaux, le catalogue et les en-têtes d’artiste. |
Lecture et adaptation mobile styles webapp/src/styles/styles/player.css, webapp/src/styles/styles/playing.css, webapp/src/styles/styles/phone.css |
Ces feuilles définissent le lecteur, les vues de lecture et les adaptations mobiles, dont les règles de mouvement réduit. |
Pages et outils styles webapp/src/styles/styles/admin.css, webapp/src/styles/styles/folders.css, webapp/src/styles/styles/maintenance.css, webapp/src/styles/styles/menus.css, webapp/src/styles/styles/mixes-and-stats.css, webapp/src/styles/styles/workspace.css |
Ces feuilles définissent les présentations de l’administration, des dossiers, de la maintenance, des menus, des mixes, des statistiques et des espaces Radio et Podcasts. |
Priority:
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Refactor
Suggested labels: scope: web, scope: design-tokens, size: xl
Merge Risk: 
Minimal · up to be45b
-
The stylesheet split appears to preserve application styling and is mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
La description est complète et couvre le contexte, les changements, les tests exécutés, les limites de validation et les points d’attention. Elle n’utilise pas exactement les sections du modèle et ne reprend pas explicitement la déclaration finale de licence et de DCO, mais ces éléments restent non critiques au vu du niveau de détail fourni.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (29 skipped: 29 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- 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)
-
webapp/src/styles/design-tokens/themes-contrast.test.ts
-
Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.
webapp/src/styles/fluid.css
-
Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.
webapp/src/styles/fluid/base.css
-
Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.
- 29 others
-
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 32
- Charged: $8.00
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Comment @coderabbitai help to get the list of available commands.
Phase A of the webapp restructuring, stylesheets:
styles.css(4,582 lines),refresh.css(1,229) andfluid.css(1,788) split into parts along their real sections. Moves only — no rule changed, added, removed or reordered.main.tsxis untouched: the three entry files keep their names and their order there (styles.css,refresh.css, the fonts,fluid.css). Each entry is now an ordered list of@imports, which Vite inlines at build.Old → new
Each part is one contiguous range of the old sheet, in the old order. Line ranges are in the old file.
styles.css→styles/(the entry: a one-line header and 14@imports, 16 lines)base.cssshell.csscatalog.csspanels.cssplayer.cssphone.cssplaying.cssadmin.cssmenus.cssfolders.cssartist-hero.cssmaintenance.cssmixes-and-stats.cssworkspace.cssrefresh.css→refresh/(entry: 8 lines)base.cssshell.csssurfaces.cssqueue.cssalbum.csslogin-player-responsive.cssfluid.css→fluid/(entry: the sheet's own 30-line banner, kept where it was, and 7@imports — 38 lines)tokens.cssbase.cssrail.csspage.cssplayer-bar.cssmenus-sign-in-motion.csstheme-picker.cssEach part's count is its old range plus its one-line header and the blank line after it, minus the blank line that separated it from the next part. Largest file: 523 lines (cap 800).
Tests.
?rawof an entry is now a list of paths and not one rule, sostyles.test.tsanddesign-tokens/themes-contrast.test.tsread the sheets through a newsrc/styles/sheets.ts, which inlines each entry's parts in its@importorder (viaimport.meta.glob, so the order is read from the entry, not written a second time). It throws at import if a part is imported by no entry or an entry names a part that does not exist. Each test's change is its import line only; every assertion is as it was.themes-contrast.test.tssits underdesign-tokens/and is not moved.Proofs
CSS, source. A script strips each part's one-line header (with the blank line after it) and the entries'
@importlines, joins the parts in@importorder with the blank line that separated them, and compares to the old file byte for byte:The check fails as it should: swapping
catalog.cssandpanels.cssinstyles.cssgivesstyles.css … -> DIFFERENT, exit 1.The check script
CSS, built.
bun run buildonmainand on this branch produce the same single bundle,dist/assets/index-ac4mmiW1.css(111.50 kB), byte-identical: same content hash in the name,cmpclean, sha2564de7650d…10b6on both. No@importsurvives in it.The tests still read every rule. A throwaway test (not committed) parsed
sheets.ts's output and the old files with postcss: same counts, and the same text once comments and whitespace are removed. The raw entry alone parses to 0 rules — what the tests would have read without the helper.Dropping one
@importfromstyles.cssmakesstyles.test.tsfail at import withno entry imports ./styles/menus.css(entry restored and re-checked afterwards).vitest: 40 files, 323 tests before and after. Playwright:
bunx playwright test --list— 508 tests in 5 files before and after.Checks run (in
webapp/)bunx biome check .— no new warnings; see the note below on the countbun run typecheck— cleanbun run test— 323 passedbun run build— clean, CSS byte-identical tomainPlaywright is left to CI: listed locally, not run.
Noticed, not changed
noDescendingSpecificitynow sees less.main's 10 warnings are all this rule in the three sheets; after the split there are 2 (refresh/album.css248 and 256,refresh.css1012 and 1020 before). The rule compares selectors within one file, so the other 8 pairs now sit in different parts and are no longer reported — the CSS is unchanged, the lint is just blind across files. Nothing new is reported. Worth knowing if anyone relies on that rule.git mvalone, as the restructuring asks, so history follows each sheet into its first part; on its own it does not build (the entriesmain.tsximports come back in the second commit).CLAUDE.md's webapp layout paragraph describesstyles/as "the sheet and the design tokens"; it predates this and is not changed here.styles.cssare partly historical, so some parts carry a neighbour that landed between them (the file-quality meter and the settings grid insideshell.css, the genre list and the hub section menu at the head ofplaying.css, the toggle row and podcast episodes inmixes-and-stats.css). Moving them would reorder the cascade, which this PR does not do.Summary by CodeRabbit