-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Editable toolbar #8959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tuuuni147
wants to merge
6
commits into
TriliumNext:main
Choose a base branch
from
tuuuni147:editable-toolbar
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Editable toolbar #8959
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4a54b86
add interactive toolbar customizatio
tuuuni147 fc2528a
improved desing for toolbar settings
tuuuni147 f9a08b8
improved handeling of groups toolbar settings + save button in toolb…
tuuuni147 bba4d4f
Merge branch 'TriliumNext:main' into editable-toolbar
tuuuni147 76d1d90
toolbar eddit, added icons for better visibility
tuuuni147 e1be04f
some improvements of gemini code review
tuuuni147 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
309 changes: 309 additions & 0 deletions
309
apps/client/src/widgets/type_widgets/options/toolbar_customization.css
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,309 @@ | ||
| .toolbar-editor { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 10px; | ||
| } | ||
|
|
||
| /* ── Two-column layout ────────────────────────────────────────────────── */ | ||
|
|
||
| .toolbar-columns { | ||
| display: grid; | ||
| grid-template-columns: 1fr 1fr; | ||
| gap: 12px; | ||
| align-items: start; | ||
| } | ||
|
|
||
| @media (max-width: 700px) { | ||
| .toolbar-columns { | ||
| grid-template-columns: 1fr; | ||
| } | ||
| } | ||
|
|
||
| /* ── Panel (shared by both columns) ──────────────────────────────────── */ | ||
|
|
||
| .toolbar-panel { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 6px; | ||
| border: 1px solid var(--main-border-color); | ||
| border-radius: var(--bs-border-radius); | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| .toolbar-panel-header { | ||
| padding: 5px 10px; | ||
| font-size: 0.8rem; | ||
| font-weight: 600; | ||
| text-transform: uppercase; | ||
| letter-spacing: 0.04em; | ||
| background: var(--accented-background-color); | ||
| border-bottom: 1px solid var(--main-border-color); | ||
| color: var(--muted-text-color); | ||
| } | ||
|
|
||
| /* ── Vertical item list ───────────────────────────────────────────────── */ | ||
|
|
||
| .toolbar-list { | ||
| display: flex; | ||
| flex-direction: column; | ||
| min-height: 60px; | ||
| } | ||
|
|
||
| .toolbar-list.available-list { | ||
| max-height: 360px; | ||
| overflow-y: auto; | ||
| } | ||
|
|
||
| /* ── A single row ─────────────────────────────────────────────────────── */ | ||
|
|
||
| .toolbar-row-wrapper { | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .toolbar-row-wrapper.drop-above > .toolbar-row:first-child { | ||
| border-top: 2px solid var(--main-text-color); | ||
| } | ||
|
|
||
| .toolbar-row { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 6px; | ||
| padding: 5px 8px; | ||
| font-size: 0.85rem; | ||
| border-bottom: 1px solid var(--main-border-color); | ||
| user-select: none; | ||
| min-height: 32px; | ||
| cursor: default; | ||
| } | ||
|
|
||
| .toolbar-row:last-child { | ||
| border-bottom: none; | ||
| } | ||
|
|
||
| .toolbar-row[draggable="true"] { | ||
| cursor: grab; | ||
| } | ||
|
|
||
| .toolbar-row[draggable="true"]:active { | ||
| cursor: grabbing; | ||
| } | ||
|
|
||
| /* Group header row */ | ||
| .toolbar-row.group-header { | ||
| background: var(--accented-background-color); | ||
| font-weight: 600; | ||
| transition: background 0.12s, outline 0.12s; | ||
| } | ||
|
|
||
| /* Drop-into-group highlight: shown when dragging an item over a group header */ | ||
| .toolbar-row.group-header.drop-into-group { | ||
| outline: 2px solid var(--main-text-color); | ||
| outline-offset: -2px; | ||
| background: var(--hover-item-background-color); | ||
| } | ||
|
|
||
| /* Separator row */ | ||
| .toolbar-row.separator { | ||
| color: var(--muted-text-color); | ||
| font-size: 0.78rem; | ||
| font-style: italic; | ||
| justify-content: center; | ||
| padding-block: 3px; | ||
| } | ||
|
|
||
| /* Sub-item row (inside an expanded group) */ | ||
| .toolbar-row.sub { | ||
| padding-left: 28px; | ||
| background: var(--more-accented-background-color); | ||
| font-size: 0.82rem; | ||
| } | ||
|
|
||
| .toolbar-row.sub.drop-above { | ||
| border-top: 2px solid var(--main-text-color); | ||
| } | ||
|
|
||
| /* Available-item row */ | ||
| .toolbar-row.available { | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .toolbar-row.available:hover { | ||
| background: var(--hover-item-background-color); | ||
| } | ||
|
|
||
| /* ── Row internals ────────────────────────────────────────────────────── */ | ||
|
|
||
| .drag-handle { | ||
| color: var(--muted-text-color); | ||
| font-size: 1rem; | ||
| flex-shrink: 0; | ||
| cursor: grab; | ||
| } | ||
|
|
||
| .row-label { | ||
| flex: 1; | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| white-space: nowrap; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| .row-add-icon { | ||
| color: var(--muted-text-color); | ||
| font-size: 1rem; | ||
| flex-shrink: 0; | ||
| } | ||
|
|
||
| .toolbar-row.available:hover .row-add-icon { | ||
| color: var(--main-text-color); | ||
| } | ||
|
|
||
| .row-btn { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| border: none; | ||
| background: transparent; | ||
| padding: 2px; | ||
| cursor: pointer; | ||
| color: var(--muted-text-color); | ||
| line-height: 1; | ||
| font-size: 1rem; | ||
| border-radius: 2px; | ||
| flex-shrink: 0; | ||
| } | ||
|
|
||
| .row-btn:hover { | ||
| color: var(--main-text-color); | ||
| background: var(--hover-item-background-color); | ||
| } | ||
|
|
||
| .row-btn.remove:hover { | ||
| color: var(--danger-text-color, #dc3545); | ||
| } | ||
|
|
||
| /* ── Expanded group panel ─────────────────────────────────────────────── */ | ||
|
|
||
| .group-expanded { | ||
| display: flex; | ||
| flex-direction: column; | ||
| border-bottom: 1px solid var(--main-border-color); | ||
| } | ||
|
|
||
| .group-name-row { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 8px; | ||
| padding: 6px 8px 6px 28px; | ||
| background: var(--more-accented-background-color); | ||
| border-bottom: 1px solid var(--main-border-color); | ||
| } | ||
|
|
||
| .group-name-label { | ||
| font-size: 0.78rem; | ||
| font-weight: 500; | ||
| color: var(--muted-text-color); | ||
| white-space: nowrap; | ||
| flex-shrink: 0; | ||
| } | ||
|
|
||
| .group-name-input { | ||
| flex: 1; | ||
| max-width: 180px; | ||
| } | ||
|
|
||
| /* ── Trash zone ───────────────────────────────────────────────────────── */ | ||
|
|
||
| .toolbar-trash { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 6px; | ||
| padding: 6px 10px; | ||
| border-top: 1px dashed var(--main-border-color); | ||
| color: var(--muted-text-color); | ||
| font-size: 0.82rem; | ||
| transition: background 0.12s, color 0.12s; | ||
| } | ||
|
|
||
| .toolbar-trash.active { | ||
| background: rgba(220, 53, 69, 0.12); | ||
| background: color-mix(in srgb, var(--danger-text-color, #dc3545) 12%, transparent); | ||
| color: var(--danger-text-color, #dc3545); | ||
| border-color: var(--danger-text-color, #dc3545); | ||
| } | ||
|
|
||
| /* ── Action bar ───────────────────────────────────────────────────────── */ | ||
|
|
||
| .toolbar-actions { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| align-items: center; | ||
| gap: 5px; | ||
| padding: 6px 8px; | ||
| border-top: 1px solid var(--main-border-color); | ||
| background: var(--accented-background-color); | ||
| } | ||
|
|
||
| /* ── Save / Discard bar ───────────────────────────────────────────────── */ | ||
|
|
||
| .toolbar-save-bar { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 6px; | ||
| padding: 6px 10px; | ||
| border: 1px solid var(--main-border-color); | ||
| border-radius: var(--bs-border-radius); | ||
| background: var(--accented-background-color); | ||
| font-size: 0.82rem; | ||
| margin-bottom: 8px; | ||
| } | ||
|
|
||
| .toolbar-save-bar.has-changes { | ||
| border-color: var(--bs-warning, #ffc107); | ||
| background: rgba(255, 193, 7, 0.08); | ||
| background: color-mix(in srgb, var(--bs-warning, #ffc107) 8%, var(--accented-background-color)); | ||
| } | ||
|
|
||
| .toolbar-save-status { | ||
| flex: 1; | ||
| color: var(--muted-text-color); | ||
| } | ||
|
|
||
| .toolbar-save-bar.has-changes .toolbar-save-status { | ||
| color: var(--main-text-color); | ||
| font-weight: 500; | ||
| } | ||
|
|
||
| /* ── Item icons ───────────────────────────────────────────────────────── */ | ||
|
|
||
| .toolbar-item-icon { | ||
| width: 16px; | ||
| height: 16px; | ||
| flex-shrink: 0; | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| color: var(--muted-text-color); | ||
| } | ||
|
|
||
| .toolbar-item-icon svg { | ||
| width: 16px; | ||
| height: 16px; | ||
| fill: currentColor; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| /* ── Misc ─────────────────────────────────────────────────────────────── */ | ||
|
|
||
| .toolbar-empty-hint { | ||
| font-size: 0.8rem; | ||
| color: var(--muted-text-color); | ||
| padding: 8px 10px; | ||
| font-style: italic; | ||
| } | ||
|
|
||
| .toolbar-empty-hint.indented { | ||
| padding-left: 28px; | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
color-mix()CSS function is a modern feature with support limited to recent browser versions (e.g., Chrome 111+, Firefox 113+). Depending on the target Electron/Chromium version for this project, this might lead to inconsistent styling. For broader compatibility, you might consider usingrgba()or hex colors with alpha transparency. For instance,background: color-mix(in srgb, var(--danger-text-color, #dc3545) 12%, transparent);could be replaced withbackground: #dc35451f;(which corresponds to ~12% opacity).