Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/web/client/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,10 @@ function toast(text: string) {
}
function setGlobalNotice(text: string) {
element('#global-notice-text').textContent = text;
element('#global-notice').hidden = !text;
const notice = element('#global-notice'), changed = notice.hidden !== !text;
notice.hidden = !text;
// The top bar's status steps aside while the notice says the same thing.
if (changed) renderShell();
}
function setMobileView(view: 'compose' | 'runs', focus = false) {
const changed = document.body.dataset.mobileView !== view;
Expand Down Expand Up @@ -3220,7 +3223,7 @@ function renderShell() {
libraryHref: chatWorkspace?.id ? `library.html?${new URLSearchParams({ workbenchChat: chatWorkspace.id })}`
: chatWorkspace?.editingProblem ? `library.html?${new URLSearchParams({ workbenchEdit: chatWorkspace.editingProblem })}` : 'library.html',
history: { docked: historyDocked(), expanded: !historyCollapsed() },
connection: { tone: ready ? 'ready' : 'offline', label: !state.connected ? connectionRequest ? t('连接中') : t('连接中断') : ready ? t('环境就绪') : t('环境未就绪') },
connection: { tone: ready ? 'ready' : 'offline', inNotice: !element('#global-notice').hidden, label: !state.connected ? connectionRequest ? t('连接中') : t('连接中断') : ready ? t('环境就绪') : t('环境未就绪') },
settingsDisabled: !session || state.submitting, account: session?.account && accountLogin(session.account), onAccount: openAccount,
onHistory: toggleHistory, onHome: () => { void openNaturalResearch(); }, onDraft: openDraft, onSettings: () => openSettings(), onPalette: () => palette.open(), onGlossary: () => openGlossary(), onLocale: changeLocale,
onLive: () => {
Expand Down
3 changes: 2 additions & 1 deletion apps/web/client/chatSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,8 @@ export class ChatSession {
? t('当前运行镜像未安装原生团队后端。')
: this.options.session()?.runtime.ready
? t('当前服务暂不支持自然语言解题,可切换到 Lean 输入。')
: t('运行环境暂未就绪,原题会保留;恢复后可继续发送。')
// The notice at the top already names the runtime problem and offers a retry.
: undefined
: newProblem && !this.capabilities ? t("正在连接…")
// A running proof that takes no guidance says so, so a message here is not mistaken for an instruction to the Agent.
: this.conversation && this.run?.status === 'running' && !showGuidance && !canDecide && !this.options.isSample(this.run)
Expand Down
8 changes: 4 additions & 4 deletions apps/web/client/ui/Topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export type TopbarLive = { label: string; detail: string; tone: string; count: n
export type TopbarProps = {
model: string;
/** Desktop docks the history beside the run; narrow screens open it as a dialog. */ history: { docked: boolean; expanded: boolean };
connection: { tone: 'ready' | 'offline'; label: string }; settingsDisabled: boolean;
connection: { tone: 'ready' | 'offline'; label: string; /** The notice under the top bar already says it. */ inNotice?: boolean }; settingsDisabled: boolean;
live?: TopbarLive; mac: boolean; account?: string;
libraryHref?: string;
onHistory(): void; onHome(): void; onDraft(): void; onSettings(): void; onPalette(): void; onLive(): void; onAccount(): void; onGlossary(): void; onLocale(): void;
};
const tx = (zh: string, en: string) => locale === 'en' ? en : zh;

function Topbar(props: TopbarProps) {
const { live } = props;
const { live } = props, connectionShown = props.connection.tone !== 'ready' && !props.connection.inNotice;
const menu = useRef<HTMLDetailsElement>(null), [open, setOpen] = useState(false);
const close = (focus = false) => {
setOpen(false);
Expand Down Expand Up @@ -53,12 +53,12 @@ function Topbar(props: TopbarProps) {
aria-label={props.history.expanded ? t('收起研究记录') : t('展开研究记录')} title={t('研究记录')} onClick={props.onHistory}><Icon name="panel-left" /><span>{tx('历史', 'History')}</span></button>
: <button type="button" id="open-history" class="topbar-control" aria-haspopup="dialog" aria-label={t('打开研究记录')} title={t('研究记录')} onClick={props.onHistory}><Icon name="panel-left" /><span>{tx('历史', 'History')}</span></button>}
</nav>
<div class="topbar-statuses" hidden={!live && props.connection.tone === 'ready'}>
<div class="topbar-statuses" hidden={!live && !connectionShown}>
{live && <button type="button" class="live-pill" data-tone={live.tone} onClick={props.onLive} title={[live.label, live.detail].filter(Boolean).join(' · ')} aria-label={t('查看进行中的研究:{0}', live.label)}>
<span class="live-pill-dot" aria-hidden="true" /><span class="live-pill-label">{live.label}</span>
<span class="live-pill-detail mono">{live.detail}</span>
</button>}
<span id="connection-status" class={`connection-status ${props.connection.tone}`} hidden={props.connection.tone === 'ready'} role="status" title={props.connection.label}><span class="status-dot" />{props.connection.label}</span>
<span id="connection-status" class={`connection-status ${props.connection.tone}`} hidden={!connectionShown} role="status" title={props.connection.label}><span class="status-dot" />{props.connection.label}</span>
</div>
<button type="button" class="topbar-control topbar-command" onClick={props.onPalette} title={`${t('打开命令面板')} (${props.mac ? '⌘K' : 'Ctrl K'})`}
aria-haspopup="dialog" aria-keyshortcuts={props.mac ? 'Meta+K' : 'Control+K'}><Icon name="search" /><span>{tx('搜索', 'Search')}</span><kbd aria-hidden="true">{props.mac ? '⌘K' : 'Ctrl K'}</kbd></button>
Expand Down
1 change: 0 additions & 1 deletion apps/web/i18n/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,6 @@ export const app: Record<string, string> = {
"正在连接…": "Connecting…",
"当前服务暂不支持自然语言解题,可切换到 Lean 输入。": "This service does not currently support solving natural-language problems. You can switch to Lean input.",
"当前服务未配置自然语言解题的模型,请联系管理员;也可切换到 Lean 输入。": "No model service is configured for natural-language problems. Contact the administrator, or switch to Lean input.",
"运行环境暂未就绪,原题会保留;恢复后可继续发送。": "The runtime is not ready. Your problem is kept; you can send it when the runtime recovers.",
"等待开始": "Waiting to start",
"准备证明环境": "Preparing the proof environment",
"理解题目与定义": "Understanding the problem",
Expand Down
Loading