feat(app): make the side panel user-directed (#3605)
* feat(app): let the file panel close its tree rail The file panel's tree rail was permanent on desktop — the changes panel had a folder-tree toggle in its toolbar, the file toolbar had nothing, so the rail was there whether you wanted it or not. The changes panel's private DesktopTreeToggle becomes a shared TreeRailToggle so both toolbars render the same affordance; that also drops the treeToggleStyle prop threaded through ChangesToolbarProps, which recomputed exactly what the component already built internally. The i18n keys move out of workspace.git.diff into workspace.tree, since a shared component reaching into the git namespace would rot. The two rails keep independent flags — the file rail in panel-store, the changes rail in useChangesPreferences — so closing one leaves the other alone. FileTreeToggle wires itself to the store rather than taking a callback: the bar renders several components below FilePanel, where the rail actually lives. Both rails also get narrower (320 -> 260 default, 200 -> 180 minimum). The persist version bump resets treeRailWidth on purpose: nearly every existing install carries the old 320 default, so without the reset the narrower rail would only ever reach new users. Anyone who dragged their rail to a deliberate custom width loses it once. Note that MIN_CONTENT_WIDTH still clamps the rail to `containerWidth - 240`, so in a narrow pane the new default never applies — that floor, not the default, is what sets the width there. * feat(app): make the side panel an empty workspace surface The fixed, hideable side panel keeps supporting context beside an agent without seeding content. Pane-local choices stay local, while implicit supporting opens follow a persisted routing preference. * test(app): exercise side panel policy through its capability boundary The browser rail journey already covers the real tree-toggle behavior. Side-panel policy tests now pass their platform capability through the public boundary instead of replacing a production module. * test(app): expect an empty side panel after upgrade * test(app): expect an empty first split pane * test(app): account for the empty side panel in split retention * feat(app): make workspace panel tabs independent Give explicit New actions fresh tab instances, keep panel state opaque to tab management, preserve File navigation context, and stabilize uncached File transitions. * fix(app): preserve file conflicts during preview refresh Keep the current preview mounted for same-target reads and conversions so the editor retains its conflict observation state. Clear retained previews only when the file target changes.
This commit is contained in:
@@ -553,7 +553,6 @@ export const zhCN: TranslationResources = {
|
||||
loading: "正在加载...",
|
||||
modified: "未保存的更改",
|
||||
loadingAgentTitle: "正在加载 Agent 标题",
|
||||
emptyPane: "此窗格中没有标签。",
|
||||
fallback: {
|
||||
newAgent: "新建 Agent",
|
||||
setup: "Setup",
|
||||
@@ -595,6 +594,7 @@ export const zhCN: TranslationResources = {
|
||||
newBrowser: "新建浏览器",
|
||||
maximizePane: "最大化窗格",
|
||||
restorePane: "还原窗格",
|
||||
closePane: "关闭窗格",
|
||||
exitFocusMode: "退出专注模式",
|
||||
splitRight: "向右拆分窗格",
|
||||
splitDown: "向下拆分窗格",
|
||||
@@ -604,10 +604,10 @@ export const zhCN: TranslationResources = {
|
||||
terminalProfilesMenu: "Terminal profiles",
|
||||
editTerminalProfiles: "Edit profiles…",
|
||||
},
|
||||
explorer: {
|
||||
open: "打开 explorer",
|
||||
close: "关闭 explorer",
|
||||
toggle: "切换 explorer",
|
||||
sidePanel: {
|
||||
open: "打开侧边面板",
|
||||
close: "关闭侧边面板",
|
||||
toggle: "切换侧边面板",
|
||||
changes: "变更",
|
||||
files: "文件",
|
||||
},
|
||||
@@ -706,6 +706,10 @@ export const zhCN: TranslationResources = {
|
||||
stopFailed: "停止 {{scriptName}} 失败",
|
||||
},
|
||||
},
|
||||
tree: {
|
||||
showFolderTree: "显示文件夹树",
|
||||
hideFolderTree: "隐藏文件夹树",
|
||||
},
|
||||
git: {
|
||||
actions: {
|
||||
moreOptions: "更多选项",
|
||||
@@ -847,8 +851,6 @@ export const zhCN: TranslationResources = {
|
||||
split: "Side-by-side diff",
|
||||
switchToUnified: "切换到统一差异视图",
|
||||
switchToSplit: "切换到并排差异视图",
|
||||
showTreeView: "显示文件夹树",
|
||||
hideTreeView: "隐藏文件夹树",
|
||||
options: "Diff 选项",
|
||||
hideWhitespace: "隐藏空白差异",
|
||||
showWhitespace: "显示空白差异",
|
||||
@@ -1894,6 +1896,10 @@ export const zhCN: TranslationResources = {
|
||||
description: "内置终端缓冲区保留的行数",
|
||||
accessibilityLabel: "终端回滚行数",
|
||||
},
|
||||
sidePanelRouting: {
|
||||
label: "在侧边面板中打开辅助标签页",
|
||||
description: "文件链接、拉取请求和设置进度会在你的工作旁边打开,而不是在聚焦的窗格中",
|
||||
},
|
||||
autoExpandReasoning: {
|
||||
label: "始终展开推理过程",
|
||||
description: "默认情况下完全展开 AI 的思考和推理过程",
|
||||
@@ -2076,11 +2082,11 @@ export const zhCN: TranslationResources = {
|
||||
toggleCommandCenter: "切换命令中心",
|
||||
showKeyboardShortcuts: "显示键盘快捷键",
|
||||
toggleLeftSidebar: "切换左侧边栏",
|
||||
toggleRightSidebar: "切换右侧边栏",
|
||||
toggleRightSidebar: "切换侧边面板",
|
||||
toggleBothSidebars: "切换两侧边栏",
|
||||
toggleSettings: "切换设置",
|
||||
toggleFocusMode: "切换专注模式",
|
||||
toggleExplorerPaneMaximization: "切换资源管理器窗格最大化",
|
||||
toggleExplorerPaneMaximization: "切换侧边面板最大化",
|
||||
cycleTheme: "循环切换主题",
|
||||
focusMessageInput: "聚焦消息输入框",
|
||||
cycleAgentMode: "循环切换代理模式",
|
||||
|
||||
Reference in New Issue
Block a user