Give the app a sidebar, and the media library a screen of its own - #8
Open
pallaoro wants to merge 1 commit into
Open
Give the app a sidebar, and the media library a screen of its own#8pallaoro wants to merge 1 commit into
pallaoro wants to merge 1 commit into
Conversation
The editor had no navigation: one top header, and the global footage library buried in a tab inside a single composition, where it did not belong. It is not per-composition state, so it is now a screen next to the gallery. Navigation is defined once with <AppNav> from @clawnify/app, which paints the app's own rail when it is opened directly and hands the same list to the Clawnify dashboard's sidebar when it is embedded there, so there is never a second nav. The gallery is home (the app's name opens it) and Media is the one row; its badge is the asset count, which is why the list moved up to <App> — uploading or deleting a file now moves the number in both sidebars in the same tick, with no extra endpoint and no polling. Two details worth keeping: - The rail override block puts only geometry inside `@media (min-width: 768px)`. Our `aside.cn-nav` outranks the SDK's own `.cn-nav`, and specificity is resolved before source order, so an unguarded width would be a 275px column on a phone that no ordering could fix. - The shell takes a definite `h-dvh`. A min-height leaves descendant heights indefinite, and the editor's resizable group, which sizes off a percentage height, collapses to a 4px seam below 768px. Measured: 275px column at 1280px, full-width 45px strip at 390px with no sideways scroll on either.
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.
The editor had no navigation at all — one top header — and the global footage
library sat in a tab inside a single composition. The library is not
per-composition state, so it becomes a screen of its own next to the gallery.
What changed
/mediaroute rendering the existingMediaPanel, moved rather thanrewritten. The tab is gone from the composition editor;
RendersPanelisgenuinely per-composition and stays.
<AppNav>from@clawnify/appdefines the navigation once. Openeddirectly it paints the app's own 275px rail; embedded in the Clawnify
dashboard it paints nothing and hands the same list to the dashboard's
sidebar, so there is never a second nav.
Compositionsis home, so it is the brand row rather than a listed item;Mediais the single row.Mediabadge is the asset count. That is why the asset list moved upto
<App>:MediaPanelnow reads it and asks for a reload, so uploadingor deleting a file moves the number in both sidebars in the same tick —
no extra endpoint, no polling.
reportLocation()on every router change, so a dashboard reload lands backon the screen you were on.
Two details worth a second look
styles.csskeeps only geometry inside@media (min-width: 768px).aside.cn-navoutranks the SDK's own.cn-nav, and specificity is resolved before source order, so an unguardedwidth: 275pxwould be a 275px column on a 390px phone that no orderingcould fix. Paint and type stay global, and they map onto this app's tokens
(the SDK's fallbacks assume a
--sunkenthis app calls--surface-sunken,and a
--primarythat is ink here).h-dvhrather than a min-height. With amin-height every descendant height is indefinite, and the editor's
resizable group — which sizes off a percentage height — collapses to a
4px seam below 768px. Verified against
mainto confirm it was myregression and not pre-existing.
Verified
vite buildclean,tsc --noEmitclean.275px column, 800px tall, no page overflow; 390px → rail is a full-width
390 x 45 horizontal strip,
scrollWidth === clientWidth, no sideways scroll./mediarenders the library (dropzone, seeded asset,assets/<key>paths)with the Media row active;
/still renders the gallery; the compositioneditor still opens with its timeline/compose/renders switcher and a
full-height panel group at both widths.