feat(config): add showMemoryPid setting to toggle footer memory/PID display
## 实现要点 新增全局配置项 showMemoryPid,允许用户通过 /config 面板关闭底部状态栏的内存值和 PID 显示(默认开启,行为不变)。 ## 变更要点 - src/utils/config.ts:新增 showMemoryPid?: boolean 类型声明 + GLOBAL_CONFIG_KEYS 注册 - src/components/PromptInput/PromptInputFooterLeftSide.tsx:新增 isMemoryPidEnabled() 函数,RSS/PID 渲染受配置控制 - src/components/Settings/Config.tsx:/config UI 面板注册配置项,含 logEvent 埋点 - packages/builtin-tools/src/tools/ConfigTool/supportedSettings.ts:SUPPORTED_SETTINGS 注册
This commit is contained in:
parent
95a4430fa2
commit
b528d378db
|
|
@ -131,6 +131,11 @@ export const SUPPORTED_SETTINGS: Record<string, SettingConfig> = {
|
||||||
'How to spawn teammates: "tmux" for traditional tmux, "in-process" for same process, "auto" to choose automatically',
|
'How to spawn teammates: "tmux" for traditional tmux, "in-process" for same process, "auto" to choose automatically',
|
||||||
options: TEAMMATE_MODES,
|
options: TEAMMATE_MODES,
|
||||||
},
|
},
|
||||||
|
showMemoryPid: {
|
||||||
|
source: 'global',
|
||||||
|
type: 'boolean',
|
||||||
|
description: 'Show memory usage and PID in the footer status bar',
|
||||||
|
},
|
||||||
...(process.env.USER_TYPE === 'ant'
|
...(process.env.USER_TYPE === 'ant'
|
||||||
? {
|
? {
|
||||||
classifierPermissionsEnabled: {
|
classifierPermissionsEnabled: {
|
||||||
|
|
|
||||||
|
|
@ -365,8 +365,8 @@ function ModeIndicator({
|
||||||
...(shouldShowPrStatus
|
...(shouldShowPrStatus
|
||||||
? [<PrBadge key="pr-status" number={prStatus.number!} url={prStatus.url!} reviewState={prStatus.reviewState!} />]
|
? [<PrBadge key="pr-status" number={prStatus.number!} url={prStatus.url!} reviewState={prStatus.reviewState!} />]
|
||||||
: []),
|
: []),
|
||||||
// RSS memory indicator — always visible
|
// RSS memory indicator — configurable via showMemoryPid
|
||||||
...(rssState
|
...(isMemoryPidEnabled() && rssState
|
||||||
? [
|
? [
|
||||||
<Text
|
<Text
|
||||||
key="rss"
|
key="rss"
|
||||||
|
|
@ -626,3 +626,7 @@ function getSpinnerHintParts(
|
||||||
function isPrStatusEnabled(): boolean {
|
function isPrStatusEnabled(): boolean {
|
||||||
return getGlobalConfig().prStatusFooterEnabled ?? true;
|
return getGlobalConfig().prStatusFooterEnabled ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isMemoryPidEnabled(): boolean {
|
||||||
|
return getGlobalConfig().showMemoryPid ?? true;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -868,6 +868,28 @@ export function Config({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'showMemoryPid',
|
||||||
|
label: 'Show memory & PID in footer',
|
||||||
|
value: globalConfig.showMemoryPid ?? true,
|
||||||
|
type: 'boolean' as const,
|
||||||
|
onChange(enabled: boolean) {
|
||||||
|
saveGlobalConfig(current => {
|
||||||
|
if (current.showMemoryPid === enabled) return current;
|
||||||
|
return {
|
||||||
|
...current,
|
||||||
|
showMemoryPid: enabled,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
setGlobalConfig({
|
||||||
|
...getGlobalConfig(),
|
||||||
|
showMemoryPid: enabled,
|
||||||
|
});
|
||||||
|
logEvent('tengu_show_memory_pid_setting_changed', {
|
||||||
|
enabled,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'model',
|
id: 'model',
|
||||||
label: 'Model',
|
label: 'Model',
|
||||||
|
|
|
||||||
|
|
@ -544,6 +544,9 @@ export type GlobalConfig = {
|
||||||
// PR status footer configuration (feature-flagged via GrowthBook)
|
// PR status footer configuration (feature-flagged via GrowthBook)
|
||||||
prStatusFooterEnabled?: boolean // Show PR review status in footer (default: true)
|
prStatusFooterEnabled?: boolean // Show PR review status in footer (default: true)
|
||||||
|
|
||||||
|
// RSS memory + PID footer display
|
||||||
|
showMemoryPid?: boolean // Show memory usage and PID in footer (default: true)
|
||||||
|
|
||||||
// Tmux live panel visibility (ant-only, toggled via Enter on tmux pill)
|
// Tmux live panel visibility (ant-only, toggled via Enter on tmux pill)
|
||||||
tungstenPanelVisible?: boolean
|
tungstenPanelVisible?: boolean
|
||||||
|
|
||||||
|
|
@ -673,6 +676,7 @@ export const GLOBAL_CONFIG_KEYS = [
|
||||||
'copyOnSelect',
|
'copyOnSelect',
|
||||||
'permissionExplainerEnabled',
|
'permissionExplainerEnabled',
|
||||||
'prStatusFooterEnabled',
|
'prStatusFooterEnabled',
|
||||||
|
'showMemoryPid',
|
||||||
'remoteControlAtStartup',
|
'remoteControlAtStartup',
|
||||||
'remoteDialogSeen',
|
'remoteDialogSeen',
|
||||||
] as const
|
] as const
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user