roster ui tweaks: column gap, hover X button, clear input on select

This commit is contained in:
Justin Edmund 2025-12-20 20:02:44 -08:00
parent abed7fee22
commit f5eaa5bb75

View file

@ -62,6 +62,7 @@
let rosterData = $state<RosterMember[]>([]) let rosterData = $state<RosterMember[]>([])
let isLoadingRoster = $state(false) let isLoadingRoster = $state(false)
let searchTimeout: ReturnType<typeof setTimeout> | null = null let searchTimeout: ReturnType<typeof setTimeout> | null = null
let svelecteValue: SearchOption | null = $state(null)
// Check if user is an officer // Check if user is an officer
$effect(() => { $effect(() => {
@ -133,8 +134,9 @@
} }
] ]
// Clear selection after adding // Clear selection and input after adding
searchOptions = [] searchOptions = []
svelecteValue = null
} }
function removeItem(id: string, type: ItemType) { function removeItem(id: string, type: ItemType) {
@ -218,7 +220,7 @@
<div class="search-section" oninput={handleInput}> <div class="search-section" oninput={handleInput}>
<Svelecte <Svelecte
options={searchOptions} options={searchOptions}
value={null} bind:value={svelecteValue}
labelField="label" labelField="label"
valueField="value" valueField="value"
searchable={true} searchable={true}
@ -456,6 +458,7 @@
.roster-row { .roster-row {
display: flex; display: flex;
align-items: center; align-items: center;
gap: spacing.$unit;
} }
.roster-header { .roster-header {
@ -532,7 +535,9 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
opacity: 0;
transition: transition:
opacity 0.15s,
background-color 0.15s, background-color 0.15s,
color 0.15s; color 0.15s;
@ -542,6 +547,10 @@
} }
} }
.item-col:hover .remove-item-btn {
opacity: 1;
}
.ownership-cell { .ownership-cell {
.not-owned { .not-owned {
color: var(--text-secondary); color: var(--text-secondary);