Repository navigation
dash: allow placing a card type more than once - #4312
Merged
Merged
Conversation
A card type can set card.allowMultiple in the registry. Each placement of such a type gets its own instanceId and keeps its options on the placement in dashCards, like Control Center widgets do. Placements without an instanceId keep using dashOptions, so saved layouts load unchanged. Claude-Session: https://claude.ai/code/session_01DQu2E4BboXnuoPrnnmViJ7
Clock is the first card that can be placed more than once, e.g. an analog and a digital clock side by side. Each copy is set up from its own options sheet in edit mode, so Settings no longer shows one shared Clock card for them. Keyboard focus returns to the copy it was on. Claude-Session: https://claude.ai/code/session_01DQu2E4BboXnuoPrnnmViJ7
Settings -> Dashboard lists one options card per placed clock again, numbered from the second one on, instead of hiding them. The first clock keeps using the shared options, so its settings and search entries work as before. Claude-Session: https://claude.ai/code/session_01DQu2E4BboXnuoPrnnmViJ7
Contributor
Claude reviewNo issues found. |
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.
Description
First PR for the system monitor widgets redesign that I shared in the design channel. This lets a dash card be placed more than once. The new System monitor card will need that later (e.g. one card per drive or per GPU), and the clock is the first card that already uses it, so an analog and a digital clock side by side, or a big one plus a small one with the date.
A card type opts in with
allowMultiple, the same flag the Control Center widgets use. Each copy keeps its own options, so two clocks can be set up differently. Cards that don't opt in work exactly like before and saved dash layouts load unchanged.Settings -> Dashboard shows one options card per clock, numbered from the second one on (Clock, Clock 2, ...). The first clock keeps the existing clock options, so nothing changes for anyone.
Type of change
Related issues
Screenshots / video
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings