From 6d5fa969e2bfbf3aad535daa3f7859a4d05d5969 Mon Sep 17 00:00:00 2001 From: xarmian Date: Fri, 17 Apr 2026 17:27:59 -0400 Subject: [PATCH] feat(web): visual redesign pass across collection modals (#138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes TASK-598 in PLAN-593. Applies the design doc recorded on the task before implementation. The work: 1. Field card alignment (resolves the T2 regression) Key row moved out of the header flex into a full-width block below. Header is now baseline-aligned at a consistent height: drag handle, label input, type-select, remove button all sit on one row regardless of whether a key row is present. Label-and- key feel related without being cramped. 2. Emoji picker parity Both modals' General tabs now render EmojiPickerButton (size md) next to the name input, matching the Quick Actions pattern. The inline .icon-btn + dance, its showEmojiPicker state, and all supporting CSS are deleted. 3. Danger zone Archive moved out of the footer into a dedicated "Danger zone" section at the bottom of the General tab. Red-tinted background, red section header, red destructive button that fills on hover. Confirmation flow lives inside the section (not crammed into the footer). Footer is now Cancel + Save Changes only. 4. Empty states Fields empty state gets icon + title + description (not a bare string). Quick Actions empty states explain what item / collection actions are for, inside a dashed-bordered suggestion block. 5. Template picker Blank card shares the same structure as other templates — a muted circular + icon wrapper instead of a dashed outline. All cards have a consistent min-height so Blank doesn't look stubby. Added :focus-visible outline for keyboard users. 6. Typography rhythm Section labels normalized to the app convention: 0.75em, 600, uppercase, 0.05em tracking, --text-muted. Applied to .fields-label, .form-label, .actions-section-title. 7. Responsive Both modals: 16px overlay padding, scrollable content, full- width under 640px. Edit modal tab bar scrolls horizontally with a right-edge fade mask under 640px; settings grid collapses to one column; footer buttons fill width. 8. Motion Modal fade + subtle scale-in (160ms ease-out). Respects prefers-reduced-motion. Existing tab/chevron transitions kept. Out of scope (per plan): new features (T6), backend changes, schema shape changes. --- .../collections/CreateCollectionModal.svelte | 176 ++++---- .../collections/EditCollectionModal.svelte | 378 ++++++++++++------ .../components/collections/FieldEditor.svelte | 101 ++--- 3 files changed, 410 insertions(+), 245 deletions(-) diff --git a/web/src/lib/components/collections/CreateCollectionModal.svelte b/web/src/lib/components/collections/CreateCollectionModal.svelte index c6135de5..2d319edd 100644 --- a/web/src/lib/components/collections/CreateCollectionModal.svelte +++ b/web/src/lib/components/collections/CreateCollectionModal.svelte @@ -2,7 +2,7 @@ import { api } from '$lib/api/client'; import type { CollectionCreate, FieldDef, CollectionSettings } from '$lib/types'; import { COLLECTION_TEMPLATES, type CollectionTemplate } from './collection-templates'; - import EmojiPicker from '$lib/components/common/EmojiPicker.svelte'; + import EmojiPickerButton from '$lib/components/common/EmojiPickerButton.svelte'; import FieldEditor, { type CollectionOption } from './FieldEditor.svelte'; import { blankField, @@ -30,7 +30,6 @@ let name = $state(''); let selectedIcon = $state(''); let description = $state(''); - let showEmojiPicker = $state(false); let fields = $state([]); let selectedSettings = $state(null); let creating = $state(false); @@ -55,7 +54,6 @@ description = ''; fields = []; selectedSettings = null; - showEmojiPicker = false; error = ''; void loadCollectionOptions(); } @@ -91,7 +89,6 @@ description = ''; fields = []; selectedSettings = null; - showEmojiPicker = false; error = ''; } @@ -294,7 +291,11 @@ type="button" onclick={() => selectTemplate(null)} > - + + Blank Start from scratch @@ -304,7 +305,7 @@ type="button" onclick={() => selectTemplate(template)} > - {template.icon} + {template.name} {template.description} @@ -318,17 +319,7 @@ {/if}
- +
- {#if showEmojiPicker} -
- { - selectedIcon = emoji; - showEmojiPicker = false; - }} - /> -
- {/if} - diff --git a/web/src/lib/components/collections/EditCollectionModal.svelte b/web/src/lib/components/collections/EditCollectionModal.svelte index 77652024..c3e9661b 100644 --- a/web/src/lib/components/collections/EditCollectionModal.svelte +++ b/web/src/lib/components/collections/EditCollectionModal.svelte @@ -2,7 +2,6 @@ import { api } from '$lib/api/client'; import type { Collection, CollectionUpdate, CollectionSettings, FieldDef, FieldMigration, QuickAction } from '$lib/types'; import { parseSchema, parseSettings } from '$lib/types'; - import EmojiPicker from '$lib/components/common/EmojiPicker.svelte'; import EmojiPickerButton from '$lib/components/common/EmojiPickerButton.svelte'; import FieldEditor, { type CollectionOption } from './FieldEditor.svelte'; import { @@ -55,7 +54,6 @@ let name = $state(''); let selectedIcon = $state(''); let description = $state(''); - let showEmojiPicker = $state(false); let saving = $state(false); let error = $state(''); @@ -182,7 +180,6 @@ originalDefault: f.default })); newFields = []; - showEmojiPicker = false; error = ''; activeTab = 'general'; confirmArchive = false; @@ -541,17 +538,7 @@
- +
- {#if showEmojiPicker} -
- { - selectedIcon = emoji; - showEmojiPicker = false; - }} - /> -
- {/if} -
{collection.prefix}
{/if} + + {#if !collection.is_default} +
+
+

Danger zone

+

+ Archiving removes this collection and all its items from the workspace. + This can't be undone from the UI. +

+
+ + {#if confirmArchive} +
+

+ Archive "{collection.name}" and all its items? +

+
+ + +
+
+ {:else} + + {/if} +
+ {/if} {:else if activeTab === 'fields'}
{#if existingFields.length === 0 && newFields.length === 0} -
No fields defined yet.
+
+ +

No fields yet

+

+ Fields define the structured data each item in this collection carries — + like status, priority, or a due date. +

+
{:else}
{#each existingFields as field, i (field.key)} @@ -718,7 +746,13 @@
{/each} {:else} -
No item actions defined.
+
+

No per-item actions yet.

+

+ Add one to surface a one-click agent prompt on every item in this + collection — e.g. "Summarize for standup" or "Draft release notes". +

+
{/if}
@@ -753,7 +787,13 @@ {/each} {:else} -
No collection actions defined.
+
+

No collection-level actions yet.

+

+ Collection actions apply to the whole list — e.g. "Triage new items" + or "Archive completed". +

+
{/if} @@ -761,20 +801,6 @@ {/if} -
- - {#if isNew} -
- - -
- {#if keyError} - - {:else if field.keyTouched} -
Keys can't be changed after save.
- {/if} - {/if} -
+ + + {#if keyError} + + {:else if field.keyTouched} +
Keys can't be changed after save.
+ {/if} + {/if} + {#if isComputed}
@@ -569,16 +573,9 @@ cursor: default; } - .field-header-left { + .field-label-input { flex: 1; min-width: 0; - display: flex; - flex-direction: column; - gap: 2px; - } - - .field-label-input { - width: 100%; padding: var(--space-1) var(--space-2); background: var(--bg-secondary); border: 1px solid transparent; @@ -597,12 +594,19 @@ outline: none; } - /* ── Key input row (new fields only) ───────────────────────────────────── */ + /* ── Key block (new fields only) ───────────────────────────────────────── */ - .field-key-row { + /* + * Full-width row below the header. Lives outside the header flex so + * the label / type-select / remove-button baseline stays consistent + * regardless of whether a key row is present. + */ + .field-key-block { display: flex; align-items: center; gap: var(--space-2); + padding: 0 var(--space-3) var(--space-2); + margin-top: calc(var(--space-3) * -1 + var(--space-1)); } .field-key-prefix { @@ -612,7 +616,9 @@ letter-spacing: 0.05em; color: var(--text-muted); font-family: var(--font-mono); - padding: 0 var(--space-2); + width: 28px; + text-align: right; + flex-shrink: 0; } .field-key-input { @@ -644,15 +650,18 @@ background: color-mix(in srgb, var(--accent-red, #ef4444) 4%, transparent); } - .field-key-error { - padding: 0 var(--space-2); + .field-key-error, + .field-key-hint { + padding: 0 var(--space-3) var(--space-2); + padding-left: calc(var(--space-3) + 28px + var(--space-2)); font-size: 0.72em; + } + + .field-key-error { color: var(--accent-red, #ef4444); } .field-key-hint { - padding: 0 var(--space-2); - font-size: 0.72em; color: var(--text-muted); font-style: italic; }