Use a red trash icon for question card deletion

This commit is contained in:
qyh15 2026-12-02 09:51:12 +08:00
parent 83caa1ae8a
commit 2dac6ce609
5 changed files with 1334 additions and 1289 deletions

File diff suppressed because it is too large Load Diff

View File

@ -143,6 +143,21 @@ function subscribeProjectCards(projectId, listener) {
}
}
export function DeleteQuestionButton({ disabled, onClick }) {
return h('button', {
type: 'button',
className: 'frameless-delete-card',
disabled,
onClick,
'aria-label': '删除问答卡片',
title: '删除问答卡片',
}, h('svg', {
viewBox: '0 0 24 24', width: 15, height: 15, fill: 'none',
stroke: 'currentColor', strokeWidth: 1.8, strokeLinecap: 'round', strokeLinejoin: 'round',
'aria-hidden': true,
}, h('path', { d: 'M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 11v5m4-5v5' })))
}
function CardBox({ card, expired, busy, error, onAnswer, badgeNote }) {
const answered = card.status === 'answered'
const dismissed = card.status === 'dismissed'

View File

@ -3,6 +3,7 @@ import { createElement as h, useCallback, useEffect, useMemo, useRef, useState }
import { SEAT_GROUPS, SEATS } from '../shared/roles.js'
import { collectModelOptions, PRESET_OPTIONS, presetShortLabel, recommendedPresetForSeat } from './workbench.js'
import { mergePendingItems } from './pending-model.js'
import { DeleteQuestionButton } from './cards.js'
import { request } from './transport.js'
import {
buildMasterItems,
@ -611,7 +612,7 @@ export function MasterWorkbench(props) {
h('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 6, marginLeft: 'auto' } },
h('span', { className: 'frameless-chip is-pri' }, h('span', { className: 'ss-dot is-primary' }), '问答卡片'),
h('span', { className: 'font-seal', style: { fontWeight: 700, fontSize: 13 } }, q.seatLabel || SEATS[q.seatId]?.label || '丞相'),
h('button', { type: 'button', className: 'frameless-link', disabled: busy, onClick: () => void dismissQuestion(q) }, '删除'),
h(DeleteQuestionButton, { disabled: busy, onClick: () => void dismissQuestion(q) }),
),
),
h('div', { style: { fontSize: 12, fontWeight: 600, color: 'var(--ss-fg)' } }, q.title),

View File

@ -144,6 +144,10 @@ html[data-theme="dark"] .ssmwb,
.ssv2 .frameless-primary-btn:hover,.ssmwb .frameless-primary-btn:hover,.frameless-primary-btn:hover{opacity:.9}
.frameless-link{font-size:12px;color:var(--ss-link);flex-shrink:0}
.frameless-link:hover{text-decoration:underline}
.ssv2 .frameless-delete-card,.ssmwb .frameless-delete-card{display:inline-grid;place-items:center;width:28px;height:28px;flex:0 0 28px;padding:0;border:1px solid transparent;border-radius:8px;color:var(--ss-error);background:color-mix(in srgb,var(--ss-error) 8%,var(--ss-card));transition:background-color 140ms ease,border-color 140ms ease}
.ssv2 .frameless-delete-card:hover:enabled,.ssmwb .frameless-delete-card:hover:enabled{background:color-mix(in srgb,var(--ss-error) 15%,var(--ss-card));border-color:color-mix(in srgb,var(--ss-error) 28%,transparent)}
.frameless-delete-card:focus-visible{outline:2px solid var(--ss-error);outline-offset:2px}
.frameless-delete-card:disabled{opacity:.45}
/* ---------- 提示横幅 & 弹窗 ---------- */
.wb-toast-wrap{flex:none;padding:10px 16px 0}

View File

@ -16,6 +16,7 @@ import {
updateDraft,
} from './workbench.js'
import { mergePendingItems } from './pending-model.js'
import { DeleteQuestionButton } from './cards.js'
import { groupModelChoices, modelPartsOf, modelObjectFromParts, shortModelName } from './master-model.js'
import { request } from './transport.js'
@ -863,7 +864,7 @@ export function WorkbenchV2(props) {
),
h('div', { className: 'frameless-btn-group' },
card.seatId ? h('button', { type: 'button', className: 'frameless-link', disabled: busy, onClick: () => void openSeat(card.seatId) }, '查看会话 →') : null,
h('button', { type: 'button', className: 'frameless-link', disabled: busy, onClick: () => void dismissQuestion(card) }, '删除'),
h(DeleteQuestionButton, { disabled: busy, onClick: () => void dismissQuestion(card) }),
),
),
h('p', { style: { margin: 0, fontSize: 12, fontWeight: 600 } }, card.title),