remove redundant edit description button and edit party modal

This commit is contained in:
Justin Edmund 2025-12-21 12:37:54 -08:00
parent aeea96cb8f
commit b66405ca73
3 changed files with 5 additions and 128 deletions

View file

@ -122,8 +122,6 @@
let loading = $state(false) let loading = $state(false)
let error = $state<string | null>(null) let error = $state<string | null>(null)
let selectedSlot = $state<number>(0) let selectedSlot = $state<number>(0)
let editDialogOpen = $state(false)
let editingTitle = $state('')
let conflictDialogOpen = $state(false) let conflictDialogOpen = $state(false)
let conflictData = $state<ConflictData | null>(null) let conflictData = $state<ConflictData | null>(null)
@ -327,30 +325,6 @@
} }
} }
// Edit dialog functions
function openEditDialog() {
if (!canEdit()) return
editingTitle = party.name || ''
editDialogOpen = true
}
async function savePartyTitle() {
if (!canEdit()) return
try {
loading = true
error = null
// Update party title via API
await updatePartyDetails({ name: editingTitle })
editDialogOpen = false
} catch (err: any) {
error = err.message || 'Failed to update party title'
} finally {
loading = false
}
}
// Party operations // Party operations
async function updatePartyDetails(updates: Omit<UpdatePartyParams, 'id' | 'shortcode'>) { async function updatePartyDetails(updates: Omit<UpdatePartyParams, 'id' | 'shortcode'>) {
if (!canEdit()) return if (!canEdit()) return
@ -431,9 +405,7 @@
function openDescriptionPanel() { function openDescriptionPanel() {
openDescriptionSidebar({ openDescriptionSidebar({
title: party.name || '(untitled party)', title: party.name || '(untitled party)',
description: party.description, description: party.description
canEdit: canEdit(),
onEdit: openEditDialog
}) })
} }
@ -1046,34 +1018,6 @@
</div> </div>
</div> </div>
<!-- Edit Dialog -->
<Dialog bind:open={editDialogOpen}>
{#snippet children()}
<ModalHeader title="Edit Party Details" />
<ModalBody>
<div class="edit-form">
<label for="party-title">Party Title</label>
<input
id="party-title"
type="text"
bind:value={editingTitle}
placeholder="Enter party title..."
disabled={loading}
/>
</div>
</ModalBody>
<ModalFooter
onCancel={() => (editDialogOpen = false)}
cancelDisabled={loading}
primaryAction={{
label: loading ? 'Saving...' : 'Save',
onclick: savePartyTitle,
disabled: loading || !editingTitle.trim()
}}
/>
{/snippet}
</Dialog>
<!-- Delete Confirmation Dialog --> <!-- Delete Confirmation Dialog -->
<DeleteTeamDialog <DeleteTeamDialog
bind:open={deleteDialogOpen} bind:open={deleteDialogOpen}
@ -1281,44 +1225,6 @@
gap: $unit-2x; gap: $unit-2x;
} }
// Edit form styles
.edit-form {
display: flex;
flex-direction: column;
gap: $unit-half;
label {
font-weight: $medium;
font-size: $font-small;
color: var(--text-secondary);
}
input {
padding: $unit-three-quarter;
border: 1px solid var(--button-bg);
border-radius: $unit-three-quarter;
font-size: $font-regular;
background: var(--input-bg);
@include smooth-transition($duration-quick, border-color, background);
&:hover {
background: var(--input-bg-hover);
}
&:focus {
outline: none;
border-color: var(--accent-blue);
box-shadow: 0 0 0 2px rgba(39, 93, 197, 0.1); // Using raw value since CSS variables don't work in rgba()
}
&:disabled {
background: var(--button-bg);
opacity: 0.7;
cursor: not-allowed;
}
}
}
// Dialog buttons (shared styles) // Dialog buttons (shared styles)
.btn-primary, .btn-primary,
.btn-secondary, .btn-secondary,

View file

@ -1,15 +1,11 @@
<script lang="ts"> <script lang="ts">
import DescriptionRenderer from '$lib/components/DescriptionRenderer.svelte' import DescriptionRenderer from '$lib/components/DescriptionRenderer.svelte'
import Button from '$lib/components/ui/Button.svelte'
interface Props { interface Props {
title?: string
description?: string description?: string
canEdit?: boolean
onEdit?: () => void
} }
let { title, description, canEdit = false, onEdit }: Props = $props() let { description }: Props = $props()
</script> </script>
<div class="description-sidebar"> <div class="description-sidebar">
@ -22,19 +18,10 @@
{:else} {:else}
<div class="empty-state"> <div class="empty-state">
<p>No description available for this party.</p> <p>No description available for this party.</p>
{#if canEdit}
<Button variant="primary" onclick={onEdit}>Add Description</Button>
{/if}
</div> </div>
{/if} {/if}
</div> </div>
</div> </div>
{#if canEdit && description}
<div class="actions-section">
<Button variant="secondary" onclick={onEdit} class="edit-button">Edit Description</Button>
</div>
{/if}
</div> </div>
<style lang="scss"> <style lang="scss">
@ -88,19 +75,9 @@
min-height: 200px; min-height: 200px;
p { p {
margin: 0 0 $unit-2x 0; margin: 0;
color: var(--text-secondary); color: var(--text-secondary);
font-size: $font-regular; font-size: $font-regular;
} }
} }
.actions-section {
padding: $unit-2x;
padding-bottom: $unit-2x;
border-top: 1px solid var(--button-bg);
:global(.edit-button) {
width: 100%;
}
}
</style> </style>

View file

@ -4,19 +4,13 @@ import DescriptionSidebar from '$lib/components/sidebar/DescriptionSidebar.svelt
interface DescriptionSidebarOptions { interface DescriptionSidebarOptions {
title?: string | undefined title?: string | undefined
description?: string | undefined description?: string | undefined
canEdit?: boolean | undefined
onEdit?: (() => void) | undefined
} }
export function openDescriptionSidebar(options: DescriptionSidebarOptions) { export function openDescriptionSidebar(options: DescriptionSidebarOptions) {
const { title, description, canEdit = false, onEdit } = options const { title, description } = options
// Open the sidebar with the party title as the header
sidebar.openWithComponent(title ?? '', DescriptionSidebar, { sidebar.openWithComponent(title ?? '', DescriptionSidebar, {
title, description
description,
canEdit,
onEdit
}) })
} }