fix(web): remove tool-call settings placeholder

This commit is contained in:
Yichen Jiang
2026-07-31 12:48:39 +08:00
parent ee74b5b07a
commit f45b6f76a5
15 changed files with 30 additions and 169 deletions

View File

@@ -1,7 +1,5 @@
/* General section rows (figma 501:29983 'Options'): stacked groups, 16px
* vertical padding each, hairline separator under all but the last child
* (feature-contributed rows carry their own row chrome and separators; the
* :last-child rule strips the trailing one wherever the column ends). */
/* Feature-contributed rows own their chrome and separators; the section
* strips the trailing separator wherever the column ends. */
.section {
display: flex;
@@ -12,64 +10,3 @@
.section > :last-child {
border-bottom: none;
}
/* Title + full-width body group (figma 'Frame 2117131229': column, gap 8). */
.group {
display: flex;
flex-direction: column;
gap: 8px;
padding: 16px 0;
border-bottom: 1px solid var(--dsw-alias-border-l2);
}
.title {
font-size: 14px;
font-weight: 400;
line-height: 22px;
color: var(--dsw-alias-label-primary);
}
.desc {
font-size: 12px;
font-weight: 400;
line-height: 18px;
color: var(--dsw-alias-label-tertiary);
}
/* Tool Call mode cubes share an 8px gap and wrap to one per row when the
panel is too narrow. */
.cubeRow {
display: flex;
align-items: stretch;
gap: 8px;
flex-wrap: wrap;
}
/* Tool Call mode cube (figma '.Selector Cube' 418w r16, flexed to fit the
* 800 panel; horizontal inset = outer pad 4 + inner .Menu_cell pad 10,
* vertical = inner pad 8). */
.modeCube {
box-sizing: border-box;
flex: 1 1 276px;
display: flex;
flex-direction: column;
justify-content: center;
gap: 2px;
padding: 8px 14px;
border: 1px solid var(--dsw-alias-border-l2);
border-radius: 16px;
background: transparent;
text-align: left;
cursor: pointer;
}
.modeCube:hover:not(.selected) {
background: var(--dsw-alias-interactive-bg-hover);
}
/* Selected cube: #F5F6F7 fill + #ADB2B8 border (static token — the bluish-400
* step has no alias-layer name). */
.selected {
background: var(--dsw-alias-bg-module-platform);
border-color: var(--dsw-static-neutral-bluish-400);
}

View File

@@ -1,9 +1,5 @@
/**
* The General section (figma 501:29983 'Options'): one column rendering the
* `settings.general.item` contributions. Features own their rows; this
* package contributes only the ownerless Tool Call skeleton.
*/
import type { PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
/** The General section: one column rendering feature-owned item contributions. */
import type { PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
import css from './GeneralSection.module.css'
/** Full component props: section owner share plus item render share. */
@@ -22,30 +18,3 @@ export function GeneralSection({ renderSlot }: GeneralSectionComponentProps) {
</div>
)
}
/** Props of the ownerless Tool Call item contribution. */
export type ToolCallSkeletonProps =
PropsRuntime<'settings.general.item'> & PropsLocale<'settings'>
/**
* Render the static Tool Call mode choice until its host setting exists.
* @param props - item runtime and translated copy.
* @returns the skeleton row.
*/
export function ToolCallSkeleton({ t }: ToolCallSkeletonProps) {
return (
<div className={css.group}>
<div className={css.title}>{t('toolcall.title')}</div>
<div className={css.cubeRow}>
<div className={`${css.modeCube} ${css.selected}`}>
<div className={css.title}>{t('toolcall.schema.title')}</div>
<div className={css.desc}>{t('toolcall.schema.desc')}</div>
</div>
<div className={css.modeCube}>
<div className={css.title}>{t('toolcall.code.title')}</div>
<div className={css.desc}>{t('toolcall.code.desc')}</div>
</div>
</div>
</div>
)
}

View File

@@ -1,8 +1,7 @@
/**
* Settings ownerless-copy plugin, browser half: registers everything on the
* Settings surface that belongs to no single feature — the trigger/header
* chrome content, the General section (`settings.general.item` slot plus the
* ownerless Tool Call skeleton), and the `settings` dictionaries.
* chrome content, the General section, and the `settings` dictionaries.
* Feature-owned rows and sections stay with their features.
* Export discipline: packages/client/AGENTS.md.
*/
@@ -13,14 +12,14 @@ import type {} from '@deepseek-ai/dsh-client-ui-settings/client'
// Type-only: pulls ctx.locale and the 'settings.general.item' SlotMap merge.
import type {} from '@deepseek-ai/dsh-client-locale/client'
import { CloseLabel, HeaderContent, TriggerContent } from './chrome.tsx'
import { GeneralSection, ToolCallSkeleton } from './GeneralSection.tsx'
import { GeneralSection } from './GeneralSection.tsx'
import { en, zh, type SettingsKey } from './locales.ts'
export type {
CloseLabelProps, HeaderContentProps, TriggerContentProps,
} from './chrome.tsx'
export type {
GeneralSectionComponentProps, ToolCallSkeletonProps,
GeneralSectionComponentProps,
} from './GeneralSection.tsx'
export type { SettingsKey } from './locales.ts'
@@ -69,19 +68,11 @@ export function apply(ctx: ClientContext): void {
locale: NS,
children: { 'settings.general.item': { kind: 'list', scope: 'root' } },
}, GeneralSection))
const toolCall = deferRegistration(ctx.slots, 'settings.general.item', ToolCallSkeleton, () =>
ctx.slots.register({
name: 'settings.general.item',
id: 'tool-call',
order: -10,
locale: NS,
}, ToolCallSkeleton))
return () => {
trigger.dispose()
header.dispose()
close.dispose()
general.dispose()
toolCall.dispose()
}
}, 'ui-settings-general: chrome and section registrations')
}

View File

@@ -1,24 +1,11 @@
/**
* `settings` namespace dictionaries: shell chrome plus the shell-owned
* General section (nav label and ownerless Tool Call skeleton). Technical
* mode copy is shared verbatim across locales per the Figma design.
* Feature-owned rows ship their copy in their own packages.
*/
const SHARED = {
'toolcall.schema.title': 'Schema mode',
'toolcall.schema.desc': 'Traditional function calling — invoke tools one at a time',
'toolcall.code.title': 'Code mode',
'toolcall.code.desc': 'Chain multiple tools with code — multi-step orchestration',
} satisfies Record<string, string>
/** Shell chrome and General-nav dictionaries; feature rows own their copy. */
/** Simplified Chinese dictionary (the key-set source of truth). */
export const zh = {
...SHARED,
'trigger': '设置',
'title': '设置',
'close': '关闭',
'general.nav': '通用设置',
'toolcall.title': '工具调用',
} satisfies Record<string, string>
/** The settings namespace key union. */
@@ -26,10 +13,8 @@ export type SettingsKey = keyof typeof zh
/** English dictionary, checked complete against the zh key set. */
export const en = {
...SHARED,
'trigger': 'Settings',
'title': 'Settings',
'close': 'Close',
'general.nav': 'General',
'toolcall.title': 'Tool Call',
} satisfies Record<SettingsKey, string>