mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:01:09 +02:00
fix(todo): simplify section headers - remove chevron, count, and collapse
Sections are now always open with clean minimal headers: - Remove chevron toggle icon - Remove task count from section headers - Remove collapsible behavior (sections always visible) - Reduce icon size from 20 to 18 - Remove count from upcoming day subheaders Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6c4fd392cc
commit
10df359fdb
2 changed files with 14 additions and 57 deletions
|
|
@ -1,24 +1,17 @@
|
|||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
import {
|
||||
Warning,
|
||||
CalendarBlank,
|
||||
CalendarDots,
|
||||
CheckCircle,
|
||||
CaretDown,
|
||||
} from '@manacore/shared-icons';
|
||||
import { Warning, CalendarBlank, CalendarDots, CheckCircle } from '@manacore/shared-icons';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
count: number;
|
||||
count?: number;
|
||||
icon?: 'warning' | 'today' | 'upcoming' | 'completed';
|
||||
variant?: 'default' | 'warning' | 'success';
|
||||
defaultOpen?: boolean;
|
||||
children: Snippet;
|
||||
}
|
||||
|
||||
let { title, count, icon, variant = 'default', defaultOpen = true, children }: Props = $props();
|
||||
let isOpen = $state(defaultOpen);
|
||||
let { title, icon, variant = 'default', children }: Props = $props();
|
||||
|
||||
// Icon colors based on variant
|
||||
const iconColors = {
|
||||
|
|
@ -36,70 +29,34 @@
|
|||
</script>
|
||||
|
||||
<div class="section mb-3">
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => (isOpen = !isOpen)}
|
||||
class="section-header w-full flex items-center gap-2 py-2 cursor-pointer transition-all duration-200"
|
||||
>
|
||||
<div class="section-header flex items-center gap-2 py-2">
|
||||
<!-- Icon -->
|
||||
<span class="icon-wrapper {iconColors[variant]}">
|
||||
{#if icon === 'warning'}
|
||||
<Warning size={20} weight="bold" />
|
||||
<Warning size={18} weight="bold" />
|
||||
{:else if icon === 'today'}
|
||||
<CalendarBlank size={20} weight="bold" />
|
||||
<CalendarBlank size={18} weight="bold" />
|
||||
{:else if icon === 'upcoming'}
|
||||
<CalendarDots size={20} weight="bold" />
|
||||
<CalendarDots size={18} weight="bold" />
|
||||
{:else if icon === 'completed'}
|
||||
<CheckCircle size={20} weight="bold" />
|
||||
<CheckCircle size={18} weight="bold" />
|
||||
{/if}
|
||||
</span>
|
||||
|
||||
<!-- Title -->
|
||||
<span class="title font-semibold {headerColors[variant]}">{title}</span>
|
||||
<span class="title text-sm font-semibold {headerColors[variant]}">{title}</span>
|
||||
</div>
|
||||
|
||||
<!-- Count -->
|
||||
<span class="count text-sm text-muted-foreground">({count})</span>
|
||||
|
||||
<!-- Chevron -->
|
||||
<span
|
||||
class="chevron ml-auto text-muted-foreground transition-transform duration-200"
|
||||
class:rotate-180={isOpen}
|
||||
>
|
||||
<CaretDown size={18} weight="bold" />
|
||||
</span>
|
||||
</button>
|
||||
|
||||
{#if isOpen}
|
||||
<div class="section-content mt-3 pl-1">
|
||||
{@render children()}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="section-content pl-1">
|
||||
{@render children()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.section-header:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.icon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.section-content {
|
||||
animation: slideDown 0.2s ease-out;
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-8px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@
|
|||
{#each groupedUpcomingTasks() as group}
|
||||
<div>
|
||||
<h3 class="text-sm font-medium text-muted-foreground mb-2 pl-2">
|
||||
{group.label} ({group.tasks.length})
|
||||
{group.label}
|
||||
</h3>
|
||||
<TaskList
|
||||
tasks={group.tasks}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue