feat: add a collapsible sidebar, page header, error state and delayed skeletons - #11
Merged
Merged
Conversation
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.
What changed
Shared pieces for the Strata UI pass Amr asked for. Every change is additive or optional, so graphite-tracker keeps working on 0.2.1 and can upgrade when it wants.
aria-expanded,aria-controls), and the brand and toggle line up with the sidebar's icons;titleandaria-label, badges become a dot, and section labels become a divider;graphite-sidebar-collapsed); if storage is blocked it just isn't remembered;useShell()exposes the state.iconnow takes anIconNameor any node, so apps can pass a coloured initial;loadingdraws skeleton rows in the sidebar's shape, so a page refresh doesn't make the layout jump when the session arrives.PageHeader: a title with optional label, description and actions, using a new margin-freepage-heading. Every page title lands at the same height whether or not it has actions.ErrorState: an error panel with an icon, message and "Try again".Placeholder, and so every skeleton, stays invisible for 200 ms (placeholderDelayMs) and then fades in. Quick loads no longer flash a skeleton, and the space is held so nothing jumps.useDelayedis exported.tone: 'error') get a red edge, are announced as alerts, and no longer cut long messages short.DialogandConfirmDialogno longer require aneyebrow, and the close button is an icon;.primary-buttonand.secondary-buttonareinline-flexwith a gap, so an icon and label sit together without extra classes;.panel-rows,.choice-cardand.tag-markstyles;Verification
npm run lintandnpm run buildpass.test/shell.spec.tsxis new. It covers collapsing from the header with names kept for screen readers and the choice remembered, starting collapsed, the loading sidebar, the 200 ms skeleton delay,PageHeader, theErrorStateretry and error toasts.fields,dialog,workspaceandfeedbackspecs pass unchanged.Publishing as 0.3.0 needs a version bump and a
v0.3.0tag, which I haven't done.