Skip to content

fix(workbench): keep flexDirection column on display-toggled conversation and workspace surfaces - #7569

Merged
M4n5ter merged 2 commits into
apache:mainfrom
sunrioa:fix/conversation-stage-column-layout
Dec 3, 2026
Merged

M4n5ter merged 2 commits into
apache:mainfrom
sunrioa:fix/conversation-stage-column-layout

Conversation

@sunrioa

@sunrioa sunrioa commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes two NSH display: 'flex' layout bugs where containers omitted flexDirection: 'column':

In NSH (third-party/nsh/crates/nsh-core/src/style.rs), explicitly setting display: 'flex' without a flexDirection defaults flex_direction to FlexDirection::Row (CSS flex semantics), causing children to lay out side-by-side instead of stacking vertically.

  • plugins/agent/conversations/ui/SessionSurface.tsx: Add flexDirection: 'column' to the conversation stage wrapper introduced in feat(workbench): redesign Automations workspace and scheduler controls #7563 (d5d8cf4b8), so <ComposerView> stays stacked below <Conversation> instead of being pushed horizontally to the top-right corner beside the window controls.
  • products/maka/workbench/app/App.tsx: Add flexDirection: 'column' to WorkspaceSurface, fixing the same horizontal-row bug when it renders multiple siblings (the narrow-window !shell.sidebarDocked() All computers bar below <Workbench>, and the disconnected remote-root Rooms view with {modeSwitch()} above <MirrorBrowser />).

Refs #7563

Verification

  • node node_modules/@biomejs/biome/bin/biome check plugins/agent/conversations/ui/SessionSurface.tsx products/maka/workbench/app/App.tsx — passed (0 issues).
  • Verified locally on Windows desktop (maka-desktop-shell.exe): conversation composer renders vertically at the bottom of the conversation pane instead of overlapping the top-right window controls.
  • Full workspace CI suites covered by GitHub Actions.

AI use

Select exactly one:

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

Tool(s) and scope: Antigravity — root-cause investigation, fixes in SessionSurface.tsx and App.tsx, and 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

…omations is closed

In apache#7563 (d5d8cf4), SessionSurface wrapped Conversation and ComposerView in a
View styled with `display: automationsOpen() ? 'none' : 'flex'` without setting
`flexDirection: 'column'`. Because NSH switches a View to `FlexDirection::Row`
whenever `display: 'flex'` is explicitly set without a direction, the composer
was laid out horizontally to the top-right beside the conversation instead of
stacked below it.

Extract `conversationStageStyle` with explicit `flexDirection: 'column'` and
add a headless NSH layout regression test covering both visible and hidden
states.

Generated-by: Antigravity

@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

Root cause is spot-on, and adding flexDirection: 'column' cleanly fixes the regression in SessionSurface.tsx. Two review comments:

  1. Same display: 'flex' bug in a peer component: WorkspaceSurface in products/maka/workbench/app/App.tsx
    Auditing other display: ... 'flex' call sites across the repo, WorkspaceSurface (products/maka/workbench/app/App.tsx, around line 1708) also sets display: props.visible() ? 'flex' : 'none' without flexDirection: 'column'. Two of its call sites render multiple direct children:

    • Conversations surface when !shell.sidebarDocked(): <Workbench> and the bottom All computers action bar are siblings inside WorkspaceSurface.
    • Rooms surface when a remote root is disconnected: {modeSwitch()} and <MirrorBrowser /> are siblings inside WorkspaceSurface.

    In both cases NSH switches the container to FlexDirection::Row and lays those children out side-by-side. Worth adding flexDirection: 'column' to WorkspaceSurface in the same fix so we don't leave the identical pitfall behind.

  2. Avoid exporting an internal style helper just for a synthetic layout test
    The actual fix is one line (flexDirection: 'column'), while exporting conversationStageStyle from SessionSurface.tsx exists solely so automations_tests.rs can plug that 5-line style object into a hand-built <View> with two dummy child <View>s.

    • Because the test never mounts SessionSurface (or <Conversation> / <ComposerView>), it wouldn't catch a real regression in SessionSurface itself (e.g., switching back to an inline style or adding another wrapper without flexDirection: 'column').
    • Meanwhile, importing from ../../../plugins/agent/conversations/ui/SessionSurface.tsx makes nsh-bundler bundle the entire 3,700-line SessionSurface.tsx module graph just to read a style literal.

    Suggest keeping the style inline in SessionSurface.tsx (just adding flexDirection: 'column'), dropping the conversationStageStyle export and the synthetic test—or, if a regression test is warranted, asserting layout on an actually mounted SessionSurface rather than an exported style object.

简体中文

根因定位准确,补上 flexDirection: 'column' 能直接修掉 SessionSurface.tsx 的回归。有两点建议:

  1. 同类路径漏审:products/maka/workbench/app/App.tsx 中的 WorkspaceSurface 存在一模一样的坑
    全仓排查了所有 display: ... 'flex' 用法,WorkspaceSurface(products/maka/workbench/app/App.tsx 第 1708 行附近)同样写了 display: props.visible() ? 'flex' : 'none' 而未显式指定 flexDirection: 'column'。它有两处调用方传了多个直接子节点:

    • 会话视图在 !shell.sidebarDocked()(窄窗未停靠侧边栏)时:<Workbench> 和底部的「All computers」按钮条是兄弟节点;
    • Rooms 视图在远端 root 断开连接时:{modeSwitch()} 和 <MirrorBrowser /> 是兄弟节点。

    这两处都会触发 NSH 隐式切 FlexDirection::Row 导致横排错位,建议这次顺手把 WorkspaceSurface 也补上 flexDirection: 'column'。

  2. 不建议为了手搓假壳测试导出内部样式函数
    实际修复只有 flexDirection: 'column' 这一行,从 SessionSurface.tsx 抽出并 export conversationStageStyle 只是为了让 automations_tests.rs 把这个 5 行样式对象塞进两个写死的 dummy <View> 里测:

    • 该测试并没有挂载真实的 SessionSurface(也没有 <Conversation> / <ComposerView>),后续如果 SessionSurface.tsx 里改回内联 style 或多套一层漏写 column 的 <View>,测试仍会通过,防不住真实回归;
    • 同时为了 import 这个样式字面量,nsh-bundler 会把整份 3700 多行的 SessionSurface.tsx 及其依赖打包一遍。

    建议直接删掉 conversationStageStyle 导出和这个假壳测试,在 SessionSurface.tsx 原地内联补一行 flexDirection: 'column'(顺带修掉 WorkspaceSurface)即可;若确实需要回归测试,建议基于真实渲染的 SessionSurface 断言,而不是测导出的样式对象。

… synthetic style test

Address review feedback on apache#7569:
- Add flexDirection: 'column' to WorkspaceSurface in products/maka/workbench/app/App.tsx
  where display: props.visible() ? 'flex' : 'none' also triggered NSH's implicit
  FlexDirection::Row for multi-child surfaces.
- Keep flexDirection: 'column' inline in SessionSurface.tsx and remove the exported
  conversationStageStyle helper and synthetic layout test in automations_tests.rs.

Generated-by: Antigravity
@sunrioa sunrioa changed the title fix(workbench): keep conversation stage flexDirection column when Automations is closed fix(workbench): keep flexDirection column on display-toggled conversation and workspace surfaces Dec 3, 2026
@sunrioa

sunrioa commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review, @M4n5ter! Both suggestions make total sense and have been applied:

  1. Added flexDirection: 'column' to WorkspaceSurface in products/maka/workbench/app/App.tsx to cover both multi-child call sites (!shell.sidebarDocked() and disconnected Rooms).
  2. Kept flexDirection: 'column' inline in plugins/agent/conversations/ui/SessionSurface.tsx and dropped the exported conversationStageStyle helper along with the synthetic test in automations_tests.rs.

The PR description has been updated accordingly.

@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, super clean!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants