Skip to content

fix(workbench,settings): move consent confirmations to ModalDialog and fix workbench UI polish issues - #7597

Merged
M4n5ter merged 4 commits into
apache:mainfrom
sunrioa:fix/settings-confirmation-dialogs
Dec 5, 2026
Merged

M4n5ter merged 4 commits into
apache:mainfrom
sunrioa:fix/settings-confirmation-dialogs

Conversation

@sunrioa

@sunrioa sunrioa commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Brings Settings confirmation flows and several workbench/chat UI surfaces into alignment with DESIGN.md:

Settings confirmation dialogs & layout spacing

  • Convert external-agent & ChatGPT sign-in consent flows to ModalDialog: ExternalAgentConfirmation (Codex / Claude Code / Antigravity) and SignInRiskConfirmation previously replaced the entire Settings page with a sparse subpage (~70% empty space with footer buttons pinned to the bottom edge), unlike Removal, SettingsDiscard, and every other Settings confirmation. Both now render as centered alertdialog overlays via SettingsConfirm + SettingsConsentCheck, preserving the parent provider page in context and supporting Escape dismissal.
  • Checkbox semantics for pre-submit consent: Replaced the acknowledgement SettingsSwitch with a full-row clickable Checkbox (ChoiceIndicator kind="checkbox"), keeping switches strictly for immediately-applied settings. Added optional icon support to DialogHeader and removed confirmation overrides from the connections page header/nested state.
  • Remove 36pt ghost section header gap: ExternalAgentSection passed trailing={<If when={false}>...</If>} to SettingsSection; because a JSX <If> element is truthy, SettingsSection rendered an empty minHeight: 28 header row + 8pt gap above the Codex/Claude Code switch card. Switched ExternalAgentSettings, ComposerToolbarSettings, and SystemPermissionSettings to pass undefined when trailing controls are hidden.

Workbench & chat UI polish

  • Composer disabled Send icon contrast: On desktop, Composer dropped the disabled Send button fill to stateLayer('hover') while keeping C.onAction icon ink (~1.13:1 contrast in light mode, ~1.45:1 in dark mode). Now uses C.muted when disabled, matching RoomComposer and StageFloatingComposer.
  • Light-mode modal input borders, focus rings, and keyboard/footer consistency:
    • Added borderWidth / borderColor: C.line and focusStyle={{ borderColor: C.accent }} to inputs in RecallSearch, WorkspacePicker, and WorkspaceLocations (previously borderless C.background on white C.floating).
    • Added selectedRowStyle() and medium weight to the active scope toggle in RecallSearch.
    • In WorkspacePicker, switched folder rows from opaque C.surface to transparent + stateLayer('selected' | 'hover'), fixed disabled primary button ink contrast (C.onAction instead of C.muted on C.action), and added a footer Cancel button.
    • In WorkspaceLocations, bound Escape to cancel and adopted DialogFooter + SettingsButton.
  • Room modals & scroll safety: Wrapped RoomMembersModal body in <Scroll> so long member/session/role lists cannot clip DialogFooter; standardized New room, Rename room, Delete room, and Edit room topic onto SettingsButton and inputBorderRadius() + focus rings; converted Delete room to size="alert" / role="alertdialog" with Cancel auto-focused.
  • Fixed-size icon button padding & single primary action: Cleared inherited controlStyle() padding on fixed-size icon buttons in WorkspaceBrowser, SessionTree, and RoomPanels; ensured Automations displays at most one tone="primary" button at a time (dropping primary tone from split-view Run now and hiding header New automation when empty).

Verification

  • node --test products/maka/workbench/tests/*.test.mjs: 474 / 474 passed
  • cargo test -p maka-workbench --lib -- settings_switches_confine_press_targets provider_catalog_grouping_flat_search models_settings_renders_each_error_once models_settings_unifies_sources_without_inline_layout_jumps: 4 / 4 passed (updated tests to assert role:alertdialog, role:checkbox, Escape dismissal, and the absence of the ghost spacing gap between the warning callout and the Codex switch card)
  • node node_modules/typescript/bin/tsc -p products/maka/bundle/tsconfig.json --noEmit: passed
  • node node_modules/typescript/bin/tsc -p packages/plugin-sdk/tsconfig.json --noEmit: passed
  • node node_modules/@biomejs/biome/bin/biome check <16 modified TS/TSX files>: passed
  • cargo fmt -p maka-workbench -- --check: passed
  • node scripts/asf-license-headers.mjs check: passed
  • Built local Windows desktop binaries (maka.exe, maka-desktop-shell.exe, maka-python-worker.exe, maka-service.exe) and visually verified in the desktop app.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Antigravity assisted with auditing Settings/workbench views against DESIGN.md, implementing the modal confirmation and UI fixes, updating headless UI tests, and running local verification.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a breaking change or persisted-data migration?

  • Yes — describe user/data impact, in-place migration, and upgrade_compat.rs coverage under Summary above
  • No

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English

Overall this is a clean, well-scoped polish PR—converting ExternalAgentConfirmation and SignInRiskConfirmation into ModalDialog overlays with SettingsConsentCheck makes those flows much more consistent with the rest of Settings.

A few concrete issues worth addressing before merge:

  1. Automations.tsx (L3236): New automation button disappears completely in narrow windows (< 760px) and terminal mode when filtering an empty session or on list error

    • split() is !terminal && paneWidth() >= 760, so split() is always false in TUI and on narrow desktop panes.
    • When props.sessionFilter() is set for a conversation with 0 automations (or when initial fetch sets listError() with counts().all === 0), globalEmpty() and showRightPane() are both false, which makes showDetailColumn() false.
    • The left list empty state only renders text (no create button), and the detail pane (which holds the only other New automation CTA) is not mounted. Changing the header guard to !editor() && counts().all > 0 hides the header button too, leaving no way to create an automation.
    • Suggestion: Hide the header CTA only when the detail-pane empty CTA is actually rendered, e.g.:
      const detailEmptyAction = () =>
        showDetailColumn() && !editor() && !selectedSummary() && !loading() && counts().all === 0;
      and use <If when={!editor() && !detailEmptyAction()}>.
  2. WorkspacePicker.tsx (L691): Unconditional C.onAction on the disabled primary button makes the label invisible (~1:1 contrast) in terminal mode

    • On desktop, controlDisabledStyle is { opacity: 0.5 } over C.action, so C.onAction improves contrast.
    • In terminal mode (platform.idiom === 'terminal'), controlDisabledStyle replaces the background with C.background (#ffffff in light mode, #111418 in dark mode), while C.onAction is #ffffff (light) / #12161c (dark)—making the disabled label invisible on initial open at the root list or on folder error.
    • Suggestion: Match SettingsButton's primaryFill handling (use C.muted when platform.idiom === 'terminal' and disabled), or replace the two footer buttons with SettingsButton / DialogFooter as done in WorkspaceLocations and RoomWorkspace.
  3. RoomPanels.tsx (L441–L453): Missed the 4th fixed-size icon button (Room actions) in RoomHeaderControls

    • Pinned (26×26), Unpin (22×22), and Search (26×26) were updated to clear inherited controlStyle() vertical padding, but the sibling Room actions (more, 26×26, 14px icon) button right below Search still spreads ...controlStyle() (paddingVertical: 8) without paddingVertical: 0, alignItems: 'center', and justifyContent: 'center'.

Minor follow-ups (optional):

  • Reactive remount of SettingsSection trailing buttons: Because nsh compiles trailing={cond ? <SettingsButton /> : undefined} into a reactive getter, any update to owner.runtimes() (ExternalAgentSettings.tsx), composerToolbar.layout() (ComposerToolbarSettings.tsx), or desktop() / host() (SystemPermissionSettings.tsx) while the condition stays true tears down and remounts the button (e.g. dropping keyboard focus on Refresh after pressing Enter). Wrapping the boolean in computed(() => ...) avoids unnecessary remounts.
  • Unused externalAgents.title(): After removing its only caller in plugins/settings/settings/ui.tsx, title in products/maka/workbench/app/externalAgentSettingsState.ts (L408–L409) appears to have no remaining callers and can be removed.
简体中文

整体改动很克制、方向也很清晰,把 ExternalAgentConfirmation 和 SignInRiskConfirmation 改成 ModalDialog + SettingsConsentCheck 之后,和 Settings 里其他确认流的一致性明显好多了。

有 3 个具体问题建议合前处理一下:

  1. Automations.tsx(L3236):窄窗(< 760px)和 TUI 下按空会话过滤或列表报错时,New automation 入口完全消失

    • split() 定义为 !terminal && paneWidth() >= 760,在 TUI 下恒为 false,桌面窄窗下也为 false。
    • 当 props.sessionFilter() 指向一个没有 automation 的会话(或首次拉取出现 listError() 且 counts().all === 0)时,globalEmpty() 和 showRightPane() 都为 false,导致 showDetailColumn() 也为 false。
    • 左侧列表空状态里只有文字没有新建按钮,唯一另一个新建按钮所在的右侧详情栏此时未挂载;Header 改成 !editor() && counts().all > 0 后也被藏掉了,全屏没有任何新建入口。
    • 建议: 直接按右侧空状态按钮是否实际渲染来做互斥,例如:
      const detailEmptyAction = () =>
        showDetailColumn() && !editor() && !selectedSummary() && !loading() && counts().all === 0;
      Header 改为 <If when={!editor() && !detailEmptyAction()}>。
  2. WorkspacePicker.tsx(L691):禁用态主按钮文案无条件改为 C.onAction,TUI 下对比度跌到 ~1:1 变隐身字

    • 桌面端 controlDisabledStyle 是 { opacity: 0.5 }(底色仍是 C.action),改成 C.onAction 确实提升了对比度。
    • 但 TUI(platform.idiom === 'terminal')下 controlDisabledStyle 会把背景替换成 C.background(浅色 #ffffff、深色 #111418),而 C.onAction 分别是 #ffffff / #12161c,导致打开根目录列表或目录报错时主按钮文案几乎完全不可见。
    • 建议: 对齐 SettingsButton 的 primaryFill 处理(TUI 禁用态保留 C.muted),或像本 PR 修改 WorkspaceLocations / RoomWorkspace 一样,把底部两个按钮也直接换成 SettingsButton / DialogFooter。
  3. RoomPanels.tsx(L441–L453):RoomHeaderControls 漏修了第 4 个固定尺寸图标按钮(Room actions)

    • Pinned(26×26)、Unpin(22×22)、Search(26×26)都清掉了继承自 controlStyle() 的 paddingVertical: 8,但紧挨着 Search 的 Room actions(more,26×26,14px 图标)依然带着 ...controlStyle() 且缺少 paddingVertical: 0、alignItems: 'center'、justifyContent: 'center'。

顺手可收的小点(可选):

  • SettingsSection trailing 按钮随信号更新重建: nsh 会把 trailing={cond ? <SettingsButton /> : undefined} 编译成响应式 getter;当 owner.runtimes()(ExternalAgentSettings.tsx)、composerToolbar.layout()(ComposerToolbarSettings.tsx)或 desktop() / host()(SystemPermissionSettings.tsx)更新但布尔结果仍为 true 时,按钮会被卸载重建(例如键盘聚焦在 Refresh 上回车刷新后焦点会丢)。把布尔条件包一层 computed(() => ...) 即可避免无谓重建。
  • 未使用的 externalAgents.title(): 删掉 plugins/settings/settings/ui.tsx 里唯一的调用点后,products/maka/workbench/app/externalAgentSettingsState.ts(L408–L409)的 title() 已无其他调用方,可以顺手清理。

…Dialog and remove ghost section spacing

- Convert ExternalAgentConfirmation (Codex / Claude Code / Antigravity) and
  SignInRiskConfirmation (ChatGPT sign-in) from sparse full-page subpages into
  centered ModalDialog alertdialogs using SettingsConfirm + SettingsConsentCheck,
  keeping the parent OpenAI/Anthropic page visible in context and matching
  Removal/Discard dialogs and DESIGN.md.
- Replace the pre-submit acknowledgement SettingsSwitch with a full-row
  clickable Checkbox (ChoiceIndicator kind="checkbox"), reserving switches for
  immediately-applied settings.
- Extend DialogHeader with an optional brand icon and remove confirmation
  overrides from the connections page header/nested state.
- Fix truthy `<If when={false}>` elements passed to SettingsSection `trailing`
  (removing the 36pt invisible header row above the Codex/Claude Code switch
  card, plus matching cleanup in ComposerToolbarSettings and
  SystemPermissionSettings).
- Update headless workbench tests to assert alertdialog/checkbox semantics and
  the absence of the ghost spacing gap.

Generated-by: Antigravity
…n padding, and primary action hierarchy

- Composer: use muted icon ink when the disabled desktop Send button drops to
  the hover fill layer, matching RoomComposer and StageFloatingComposer.
- RecallSearch / WorkspacePicker / WorkspaceLocations: add visible input borders
  and accent focus rings on light-mode floating cards, highlight the active
  RecallSearch scope button, add Cancel and fix disabled primary button text
  contrast and row background in WorkspacePicker, and bind Escape + DialogFooter
  in WorkspaceLocations.
- RoomPanels / RoomWorkspace: wrap RoomMembersModal body in Scroll to prevent
  clipping DialogFooter, standardize Room modals onto SettingsButton and
  inputBorderRadius() with focus rings, and convert Delete room to an alert
  dialog with Cancel auto-focused.
- WorkspaceBrowser / SessionTree / RoomPanels: clear inherited controlStyle()
  padding on fixed-size icon buttons so icons are not squeezed.
- Automations: keep a single primary action per view by dropping primary tone on
  split-view Run now and hiding the header New automation button in empty state.

Generated-by: Antigravity
@sunrioa
sunrioa force-pushed the fix/settings-confirmation-dialogs branch from b9e289b to 69e213f Compare December 4, 2026 18:52

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rechecked the settings confirmations, Room actions, and the other workbench changes on this commit. The settings changes now keep the underlying form mounted and gate confirmation on an explicit checkbox. Two earlier issues still reproduce in the current code. In particular, the same view can now hide both New automation buttons.

The six focused JavaScript suites passed 68/68 both on the PR and on its merge base. Separately, I ran the actual visibility predicates against narrow desktop, terminal, and wide desktop cases. This commit merges cleanly into current main. I did not run the native dialog and focus tests or verify the long Room member list visually. The Room actions button still retains its old vertical padding, unlike its siblings.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

browser={props.browserHeader()}
actions={
<If when={!editor() && !globalEmpty()}>
<If when={!editor() && counts().all > 0}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Keep a way to create an automation in an empty session. In a narrow desktop pane or the terminal, an empty session filter keeps the detail pane unmounted. This condition hides the header action as well. The same happens after a narrow-pane list error. The current main baseline still shows the header action in all three cases. Hide it only when the other New automation button is actually present.

<Text
style={{
color: currentDirectory(read) && !error() ? C.onAction : C.muted,
color: C.onAction,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Keep readable disabled text in the terminal workspace picker. The terminal disabled style paints the background with C.background, while this now paints the label with C.onAction. Those are both white in the light palette and nearly the same shade in dark. Keep the muted label for that terminal state or route the footer through SettingsButton.

@github-actions github-actions Bot added the effort/L Under 1000 readable lines label Dec 5, 2026
…, WorkspacePicker, RoomPanels, and SettingsSection
@sunrioa

sunrioa commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all review items in the latest commit:

  1. **\Automations.tsx**: Guarded the header \New automation\ button on !editor() && !detailEmptyAction()\ (where \detailEmptyAction\ checks \showDetailColumn() && !editor() && !selectedSummary() && !loading() && counts().all === 0) so narrow desktop panes, terminal mode, empty session filters, and list-error states always keep a create action visible.
  2. **\WorkspacePicker.tsx**: Preserved \C.muted\ label ink when \platform.idiom === 'terminal'\ and the primary action is disabled (keeping desktop disabled contrast on \C.onAction).
  3. **\RoomPanels.tsx**: Cleared inherited vertical padding and centered the 4th fixed-size \Room actions\ (\26×26) icon button to match its siblings.
  4. Minor cleanups: Wrapped the \SettingsSection\ \ railing\ visibility predicates in \computed(() => ...)\ across \ExternalAgentSettings, \ComposerToolbarSettings, and \SystemPermissionSettings\ to prevent reactive remounts, and removed the unused \ itle()\ helper from \�xternalAgentSettingsState.ts.

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Cleaned up the leftover unused SettingsButton import in RoomWorkspace.tsx and switched WorkspaceLocations.tsx to ActionButton directly.

@M4n5ter
M4n5ter merged commit df2f27b into apache:main Dec 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/L Under 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants