refactor(shell): retire the plugin's own right panel and free windows
DSH 0.1.5 owns the right column (its native Sidebar hosts every tab type this plugin registers), so the plugin's own right panel, its width drag / new-session seed prefs, and the free-window feature are gone. The bottom workbench is the only plugin-owned surface left, and its expand/collapse control is registered into DSH's session-header utilities list slot (the header's corner seat belongs to the native sidebar's own control). - state: one `bottomSplits` tree; `makeDefaultState()` takes no arguments; `toggleBottomPanel` / `openTabInBottomPane` are the only landing reducers; `setBottomHeight` and `sanitizeState` share the `CONVERSATION_MIN` cap (a persisted tall height no longer snaps on the first drag). - service: every landing in the workbench (creation or focus) expands it; `SIDEBAR_FEATURES` drops `'floatWindows'`; the open/close/activate tab pools cover the single tree. - shell: `Sidebar.tsx` renders only the bottom workbench; the toggle lives in `sidebar/bottom-toggle.tsx`; layout-push pushes height only (no width, no `--dsh-sidebar-width`). - prefs: `openByDefault` / `defaultWidthPercent` / `changesDiffFloat` removed from the schema, defaults, client parser, settings page, and all 20 dictionaries; the retired keys in stored documents are ignored. - tests: free-window specs deleted, panel/float assertions dropped, remaining suites adapted (124 files / 1287 tests); the mount lane asserts the header toggle and sweeps the native sidebar's guide page. - docs: README / README_EN / guide §0,§11 / AGENTS test map.
This commit is contained in:
+3
-31
@@ -9,24 +9,17 @@
|
||||
/** The user-settings namespace holding the side card preferences. */
|
||||
export const SIDEBAR_PREFS_NS = 'dsh-better-sidebar'
|
||||
|
||||
/** User-facing side card preferences (new-conversation defaults). */
|
||||
/** User-facing side card preferences. */
|
||||
export interface SidebarPrefs {
|
||||
/** Whether a brand-new conversation opens the side card by default. */
|
||||
openByDefault: boolean
|
||||
/** Default panel width as a percent of the window width (20–60). */
|
||||
defaultWidthPercent: number
|
||||
/**
|
||||
* Whether the sidebar auto-activates the Tasks page when the current
|
||||
* conversation spawns a new subagent. Wide viewports also open the panel;
|
||||
* narrow viewports prepare the tab without opening the full-screen drawer.
|
||||
* conversation spawns a new subagent.
|
||||
*/
|
||||
autoOpenSubagent: boolean
|
||||
/**
|
||||
* Whether the sidebar auto-activates the Tasks page containing the
|
||||
* background-jobs section when a NEW job appears for the current
|
||||
* conversation (any new job id, not just the first one). Wide viewports also
|
||||
* open the panel; narrow viewports prepare the tab without opening the
|
||||
* full-screen drawer.
|
||||
* conversation (any new job id, not just the first one).
|
||||
*/
|
||||
autoOpenJobs: boolean
|
||||
/**
|
||||
@@ -72,14 +65,6 @@ export interface SidebarPrefs {
|
||||
* Side card settings; off restores the pre-merge editor exactly.
|
||||
*/
|
||||
editorExplorer: boolean
|
||||
/**
|
||||
* Where the changes tab's "expand to a diff tab" action lands the diff:
|
||||
* true (default) floats it as a free window centered on the viewport;
|
||||
* false docks it into the shell's diff pane below the source panel (the
|
||||
* pre-float behavior). The select lives under the changes card's gear in
|
||||
* the Side card settings.
|
||||
*/
|
||||
changesDiffFloat: boolean
|
||||
/**
|
||||
* Whether the sidebar's filesystem routes enforce the workspace fence:
|
||||
* every client-supplied path must resolve (through symlinks) inside the
|
||||
@@ -238,11 +223,6 @@ export interface SidebarPrefs {
|
||||
pluginSettings: Record<string, Record<string, unknown>>
|
||||
}
|
||||
|
||||
/** Range contract of {@link SidebarPrefs.defaultWidthPercent}. */
|
||||
export const WIDTH_PERCENT_MIN = 20
|
||||
export const WIDTH_PERCENT_MAX = 60
|
||||
export const WIDTH_PERCENT_DEFAULT = 35
|
||||
|
||||
/** Range contract of {@link SidebarPrefs.terminalFontSize}. */
|
||||
export const TERMINAL_FONT_SIZE_MIN = 9
|
||||
export const TERMINAL_FONT_SIZE_MAX = 32
|
||||
@@ -259,8 +239,6 @@ export type TitleBarScheme = typeof TITLE_BAR_SCHEMES[number]
|
||||
|
||||
/** Fallback prefs used whenever the settings document is unreachable or malformed. */
|
||||
export const SIDEBAR_PREFS_DEFAULTS: SidebarPrefs = {
|
||||
openByDefault: false,
|
||||
defaultWidthPercent: WIDTH_PERCENT_DEFAULT,
|
||||
autoOpenSubagent: true,
|
||||
autoOpenJobs: true,
|
||||
agentTerminalTools: false,
|
||||
@@ -269,7 +247,6 @@ export const SIDEBAR_PREFS_DEFAULTS: SidebarPrefs = {
|
||||
terminalFontFamily: '',
|
||||
terminalFontSize: TERMINAL_FONT_SIZE_DEFAULT,
|
||||
editorExplorer: false,
|
||||
changesDiffFloat: true,
|
||||
workspaceFence: true,
|
||||
terminalShell: '',
|
||||
terminalShellArgs: '',
|
||||
@@ -290,11 +267,6 @@ export const SIDEBAR_PREFS_DEFAULTS: SidebarPrefs = {
|
||||
pluginSettings: {},
|
||||
}
|
||||
|
||||
/** Clamp one width percent into the contract range (shared by schema and client reads). */
|
||||
export function clampWidthPercent(value: number): number {
|
||||
return Math.min(WIDTH_PERCENT_MAX, Math.max(WIDTH_PERCENT_MIN, Math.round(value)))
|
||||
}
|
||||
|
||||
/** Clamp one terminal font size into the contract range (shared by schema and client reads). */
|
||||
export function clampTerminalFontSize(value: number): number {
|
||||
return Math.min(TERMINAL_FONT_SIZE_MAX, Math.max(TERMINAL_FONT_SIZE_MIN, Math.round(value)))
|
||||
|
||||
Reference in New Issue
Block a user