Repository navigation
refactor(webapp): split the admin and playing pages and the query catalogue into directories - #360
Conversation
…rectories Signed-off-by: InstaZDLL <github.105mh@8shield.net>
…alogue by section Signed-off-by: InstaZDLL <github.105mh@8shield.net>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Catalogue et collections webapp/src/api/queries.ts, webapp/src/api/queries/catalog.ts, webapp/src/api/queries/collections.ts |
Les requêtes du catalogue et des collections sont définies séparément. Les clés incluent les paramètres pertinents; les requêtes paginées, la recherche et l’enrichissement ont leurs règles dédiées. |
Écoute, maintenance et pistes webapp/src/api/queries/listening.ts, webapp/src/api/queries/maintenance.ts, webapp/src/api/queries/tracks.ts |
Les modules ajoutent les requêtes d’écoute, de maintenance et de pistes. Ils définissent notamment la pagination, la résolution tolérante de pistes et les délais d’actualisation. |
Administration et exports publics webapp/src/api/queries/administration.ts, webapp/src/api/queries/index.ts |
Les requêtes d’administration sont ajoutées. Le point d’entrée réexporte les fonctions et constantes des modules de requêtes. |
Page d’administration
| Layer / File(s) | Summary |
|---|---|
Page et activité d’administration webapp/src/pages/admin-page.tsx, webapp/src/pages/admin-page/index.tsx, webapp/src/pages/admin-page/activity.tsx |
La page regroupe la création de bibliothèques et de comptes, les changements de statut et le lancement des scans. Des composants affichent leur progression et les écoutes en cours. |
Panneaux de gestion webapp/src/pages/admin-page/libraries.tsx, webapp/src/pages/admin-page/credentials.tsx |
Les panneaux gèrent les membres et paramètres des bibliothèques, les identifiants Subsonic et les jetons API. Les données des panneaux concernés sont chargées à leur ouverture. |
Page de lecture
| Layer / File(s) | Summary |
|---|---|
Vues de lecture et signets webapp/src/pages/playing-page.tsx, webapp/src/pages/playing-page/index.tsx, webapp/src/pages/playing-page/detail-view.tsx, webapp/src/pages/playing-page/immersive.tsx |
La page sélectionne la vue détail, paroles ou immersive à partir de l’URL. Elle conserve les opérations de sauvegarde, de suppression et de lecture des signets. |
Affichage et suivi des paroles webapp/src/pages/playing-page/lyrics.tsx |
Le module détermine l’état des paroles et la ligne synchronisée active. Les vues suivent cette ligne et les lignes horodatées permettent de rechercher une position. |
Priority:
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Refactor
Suggested labels: scope: web, size: xl
Merge Risk: 
Minimal · up to 3f459
-
This is a behavior-preserving refactor that splits the admin page, playing page and query catalogue into directories. Public exports and import resolution are preserved, and no merge-blocking issue was found. The remaining check is CI, which runs the Playwright suite.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
La description est complète et précise. Elle présente l’objectif, les changements, les choix de structure, les preuves de conservation du comportement, les tests exécutés et les points différés. Elle n’utilise pas exactement les titres du modèle et ne reprend pas la confirmation finale du modèle, mais les informations essentielles sont présentes.
-
-
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/api/queries/administration.ts
-
Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.
webapp/src/api/queries/catalog.ts
-
Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.
webapp/src/api/queries/collections.ts
-
Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.
- 12 others
-
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 15
- Charged: $3.75
- 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, for the pages, components and API client: the three files over 600 lines in
webapp/src/pages/,webapp/src/components/andwebapp/src/api/become directories, one file per section. Moves only: no export renamed, no signature or behaviour changed, and every import specifier elsewhere in the client (./pages/admin-page,./pages/playing-page,../api/queries,./queries,./playing-page) resolves as it did, to the directory'sindex.The history has two commits: the
git mvalone, then the split.Old → new
api/queries.tsapi/queries/index.ts: the module's doc comment and the explicit re-exportsapi/queries/catalog.ts: albums, songs, artists (with the enrichment retry), genres, the random draw, searchapi/queries/collections.ts: playlists, shares, bookmarks, radio stations, smart playlists, podcastsapi/queries/tracks.ts: one track's panels: properties, lyrics, canvas, the tag editorapi/queries/listening.ts: stats, mixes, now playing, favourites, history, scrobbles (HISTORY_PLAYSgoes with its two users)api/queries/maintenance.ts: needs attention, quality, the filed tree and folder tracks, missing and purged filesapi/queries/administration.ts: API tokens, own credentials, library members and settings, the administration listingpages/playing-page.tsxpages/playing-page/index.tsx:PlayingView,playingView, the view switcher,PlayingPageand its bookmarkspages/playing-page/lyrics.tsx:currentLyricLine,lyricSheetState,useLyricSheet,useFollowSungLine,LyricLines,LyricsStrip,LyricsViewpages/playing-page/detail-view.tsx:detailSplit,DetailViewpages/playing-page/immersive.tsx:ImmersiveViewpages/admin-page.tsxpages/admin-page/index.tsx:AdminPage(library registration, account creation, the account rows)pages/admin-page/libraries.tsx:LibraryMembersPanel,LibrarySettingsPanelpages/admin-page/credentials.tsx:CredentialForm,ApiTokensPanelpages/admin-page/activity.tsx:SCAN_STATUS,ScanProgress,NowPlayingPanelNo other
.ts/.tsxfile underpages/,components/orapi/was over its cap when this started (components/smart-playlists.tsx589,api/session.test.ts601, a test file under its 1,000).The visibility changes are the ones the split needs and nothing more:
exportadded toLyricSheet,useLyricSheet,LyricsStrip,LyricsView,ImmersiveView,DetailView,CredentialForm,ApiTokensPanel,ScanProgress,NowPlayingPanel,LibraryMembersPanelandLibrarySettingsPanel, each imported by its directory'sindexor a sibling. None of them is re-exported, so each directory's public surface is exactly the old file's: 51 names forqueries, 6 forplaying-page, 1 foradmin-page.Deviations from the suggested shape, and why
radio.ts,podcasts.tsorplaylists.tsunderqueries/. Each is two to four one-line query options; a file each would have been 10–20 lines. They are one family, what an account keeps, incollections.ts(50 lines).maintenance.tsholds the filed tree and folder tracks as well as the three maintenance sections. The old file had a displaced doc comment forfiledTreeQuerysitting directly above the "Needs attention" comment (see below). Keeping lines 237–359 together keeps that comment exactly where it was rather than moving it, which would have been a fix.nowPlayingQueryis inlistening.ts, beside the other listening reads, though only the admin screen asks for it.index.tsx. The forms that create a library and an account, and the per-account rows, are JSX insideAdminPagesharing its state (notice,adminError,watchedScan,reload). Lifting them out would mean new props and components, which is not a move.Proofs
Every line, exactly once. A script (not committed) takes each old file's non-blank lines outside
import/export … fromstatements, strips a leadingexport, and compares them as a multiset against the same lines of the new files minus their one-line header. It also compares the old file's exported names against the newindex's:The check was shown to fail on purpose: against a copy of the originals with the albums key reordered (
["albums", scope ?? null, sort]) and one line ofPlayingPagedeleted, it reports both (old x1, new x0/new only x1) and exits 1. Because every key literal is one of those lines, the query keys are byte-identical: cache entries are keyed by them.vitest (
bun run test): 40 files, 323 tests before and after.api/queries.test.ts,pages/playing-view.test.tsandpages/lyrics.test.tsstay where they were; their./queriesand./playing-pagespecifiers now resolve to the directories.Playwright (
bunx playwright test --list, listing only): 508 tests in 5 files before and after.Checks run (in
webapp/)bunx biome check .: the same 10 warnings asmain, none in the new filesbun run typecheck: cleanbun run test: 323 passedbun run build: builtPlaywright was not run locally; CI runs it on this PR.
Noticed, not changed
/** A library's whole filed tree … */block sits directly above the/** "Needs attention" (RFC-015) … */block, two JSDoc comments stacked, so it documents nothing andfiledTreeQuery, about 100 lines further down, has no doc comment. Kept verbatim inapi/queries/maintenance.ts.{user.role} · {user.folder_ids.length} libraries, with "libraries" hard-coded in English, and the membership role picker shows the rawlistener/managervalues as option labels.pages/holds "one screen per file". After this PR a screen can be a directory. That is for the phase B documentation pass.Summary by CodeRabbit