Repository navigation
feat: resize the dashboard overview and map in the layout editor - #776
Open
arthur-lzrs wants to merge 1 commit into
Open
arthur-lzrs wants to merge 1 commit into
arthur-lzrs wants to merge 1 commit into
Conversation
On a phone the dashboard's car diagram and location map stand one above the other, and the diagram is tall. There was no way to give the map more of the screen. In the dashboard's layout editor on a phone, the car diagram and the location map each get a pair of magnifier buttons (minus and plus). The car goes from standard to three smaller sizes, the map from standard to two taller ones. Making the car smaller shrinks the drawing and the readings over it together, the text less than the drawing so it stays legible. The sizes are kept per device and standard is the layout as it was, so nothing changes until a button is used. Beside the sidebar the two cards stand side by side, so the buttons are not offered. Sizes are CSS custom properties (--car-scale, --car-text-scale, --map-min-height) set by a class on the dashboard, so they stay within the Content-Security-Policy. A smaller car also lets go of the 320 px flex-basis its box has in the phone's column, which would otherwise keep the room of a shrunk card empty. EditableCardSlot gets a "controls" slot, which EditableCardGrid forwards, and CardSizeControl fills it. A button at the end of its range is aria-disabled rather than disabled, so a key or a finger that has just taken the last step keeps its focus. overviewCarSize and overviewMapHeight are local to the device, so they are not synced to the account. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
On a phone the dashboard's car diagram and location map stand one above the other, and the diagram is tall. There is no way to give the map more of the screen.
In the dashboard's layout editor (long press a card, or Edit layout), on a phone, the car diagram and the location map each get a pair of magnifier buttons (minus and plus) in their corner:
I first made this a setting under Settings > General > Appearance, but sizing a card belongs where the cards are rearranged, and buttons need no names for the levels.
How it works
--car-scale,--car-text-scale,--map-min-height) switched by a class on the dashboard. No inline styles, so the Content-Security-Policy is untouched. They are defined for phones only (width <= 767px), the same query asPHONE_MEDIA_QUERY, and everything that reads them has the old value as its fallback.flex: 2 1 320pxis a height, a floor of 320 px, so a shrunk card's box would stay that tall with the room empty. The smaller sizes let go of it (flex-basis: auto); standard keeps it.EditableCardSlotgets acontrolsslot, whichEditableCardGridforwards, and the newCardSizeControlfills it. The statistics view uses the same components and passes nothing, so it is unchanged.aria-disabledrather thandisabled, so a key or a finger that has just taken the last step keeps its focus.overviewCarSizeandoverviewMapHeightare in the UI settings and listed inlocalKeys, so they stay on the device and are not synced to the account. A stored value that is not one of the sizes reads as standard.Type of Change
Related Issues
None.
How it was tested
Notes for review
dashboard.css(--car-scale,--car-text-scale,--map-min-height) and the two lists insettingsUi.ts, easy to tune or extend.nl,esandpt-PTare my own drafts ("Make smaller" and "Make larger", read by screen readers), so a native check is welcome.settingsUi.ts,settingsStores.spec.tsandsettingsSync.spec.tsnext to the same lines. Whichever lands second needs a trivial rebase.Checklist
pnpm checkinfrontend/(frontend only: the .NET side is untouched, sodotnet testanddotnet formatwere not run)feat: ...,fix(frontend): ...)ITripRepository): done in the demo too, with a step inTripRepositoryContractTests(not applicable)documentation/openapi.jsonis committed (not applicable, the API did not change)src/GarageStack.Data/Demo/(not applicable, the demo's dashboard already has both cards)frontend/src/locales/unraid/garagestack.xmlchanged: synced tojoszz/unraid-community-appsafter merge (not applicable, it did not change)🤖 Generated with Claude Code