fix: resolve workbench final review findings

This commit is contained in:
2026-07-19 19:59:38 +08:00
parent 6341a6bd8b
commit ba4ca16375
13 changed files with 357 additions and 44 deletions

View File

@@ -7,6 +7,18 @@
export let tags: string[];
export let recentSessions: AISessionItem[];
export let onSelectChannel: (channelID: string) => void;
const channelIcons: Record<WorkbenchChannel['icon'], string> = {
home: '\u2302',
mail: '\u2709',
list: '\u2630',
sparkles: '\u2726',
file: '\u25A4',
clock: '\u25F7',
link: '\u21AA',
};
$: sortedChannels = [...channels].sort((left, right) => left.sortOrder - right.sortOrder);
</script>
<aside class="channel-sidebar" aria-label="Project channels">
@@ -15,23 +27,24 @@
<p>Current project</p>
<h2>{project.name}</h2>
</div>
<button aria-label="Project settings">&#9881;</button>
<button aria-label="Project settings" disabled>&#9881;</button>
</header>
<section class="tag-row" aria-label="Project tags">
<ul class="tag-row" aria-label="Project tags">
{#each tags as tag}
<button type="button">#{tag}</button>
<li>#{tag}</li>
{/each}
</section>
</ul>
<section class="channel-group">
{#each channels as channel}
{#each sortedChannels as channel}
<button
class:active={channel.id === selectedChannelID}
aria-pressed={channel.id === selectedChannelID}
aria-label={`${channel.title}${channel.count ? ` ${channel.count}` : ''}`}
on:click={() => onSelectChannel(channel.id)}
>
<span class="channel-icon" aria-hidden="true">{channelIcons[channel.icon]}</span>
<span>{channel.title}</span>
{#if channel.count !== undefined}
<small>{channel.count}</small>
@@ -42,11 +55,13 @@
<section class="recent-sessions" aria-label="Recent sessions">
<h3>Recent sessions</h3>
{#each recentSessions as session}
<button type="button">
<span>{session.title}</span>
<small>{session.updatedAt}</small>
</button>
{/each}
<ul>
{#each recentSessions as session}
<li>
<span>{session.title}</span>
<small>{session.updatedAt}</small>
</li>
{/each}
</ul>
</section>
</aside>