You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let side-panel plugins suggest a content width for the right panel
#10183
We are building Mobile Preview Plugin, an open-source DSH plugin for mobile developers. It shows and controls Android emulators and phones, iOS Simulators and USB-connected iPhones in the DSH side panel, so developers can watch and operate the app their agent is working on without leaving the conversation. This is our second report from qualifying it on DSH Web and Desktop; the first was #10024.
Where we hit this
A phone screen is tall and narrow, so the right panel's width decides how large the preview can be. The panel opens at its saved width, which suits text panels but either leaves wide empty margins beside the phone or shrinks it. Today the user must drag the divider every time the preview opens, after switching tabs, or when the window changes size. A plugin can measure the width its content needs, but it has no way to ask the layout for it.
Proposal
Add a temporary width request to ctx.layout, plus one fact about the pane the tab is in:
ctx.layout.requestRightbarWidth(width) suggests a normal right-panel width and returns a handle with update(width) and dispose(). It never replaces the user's saved width, and it stays under the frame's existing limits: the 300-pixel minimum, at most 70% of the frame, and the 400-pixel reservation for the conversation.
The latest request wins; superseded handles become inactive. A manual drag clears the request before saving the dragged width, so later measurements cannot fight the user. Disposing the request, or unloading the layout, restores the saved width.
tabInfo.panel.isSoleDockedPane tells a tab whether it is the only docked pane, so a plugin only requests a width when it owns the whole panel, and not in split or floating layouts or in fullscreen.
A non-finite width throws RangeError without changing the current request or the saved width.
The change is in packages/client/ui-layout (layout store, controller, AppFrame) and packages/client/ui-sidebar-right (TabInfo.panel), with the English and Chinese READMEs and their translation records updated. It adds rightbar-width.client.spec.ts and extends the layout store, service, AppFrame and tab-info tests; fixtures in other packages gain the new isSoleDockedPane field. The 111 affected test files (1,315 tests) pass, as do build:artifacts, build:check and the commit hooks. doc-sync passes except verify-repository-references, which already fails at 687f282 on python/sdk/uv.lock:113 (also noted in #10024).
How a plugin uses it
Mobile Preview Plugin detects the method and falls back to manual sizing when it is absent. While its tab is visible, not in fullscreen and the sole docked pane, it computes the width that fits the phone screen at the available height and keeps one request updated as the window or content changes. It disposes the request when the tab is hidden, enters fullscreen, or is split or floated. After a manual drag it stops requesting until the preview is shown again.
Result
DSH Web in a 1440 × 900 viewport with an iOS Simulator preview. The comparison uses stock DSH Web 0.2.1-alpha.1, which opens the panel at its default 45%, and this commit run from source:
Stock DSH Web
With requestRightbarWidth
Right panel width
648 px
339 px
Phone preview
287 × 626 px
287 × 624 px
Unused width beside the phone
361 px
53 px (frame and padding)
The preview keeps its size while the conversation column gains 309 px. Dragging the divider to 539 px afterwards kept 539 px; the plugin did not reassert its width.
Stock DSH Web 0.2.1-alpha.1:
With requestRightbarWidth (abfc7b9 from source):
Both screenshots were captured at 1440 × 900 with the host name in the plugin panel hidden.
The change is MIT-licensed like DSH. Please feel free to take the commit as-is or redesign the API in whatever form fits; we will adapt the plugin to it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Background
We are building Mobile Preview Plugin, an open-source DSH plugin for mobile developers. It shows and controls Android emulators and phones, iOS Simulators and USB-connected iPhones in the DSH side panel, so developers can watch and operate the app their agent is working on without leaving the conversation. This is our second report from qualifying it on DSH Web and Desktop; the first was #10024.
Where we hit this
A phone screen is tall and narrow, so the right panel's width decides how large the preview can be. The panel opens at its saved width, which suits text panels but either leaves wide empty margins beside the phone or shrinks it. Today the user must drag the divider every time the preview opens, after switching tabs, or when the window changes size. A plugin can measure the width its content needs, but it has no way to ask the layout for it.
Proposal
Add a temporary width request to
ctx.layout, plus one fact about the pane the tab is in:ctx.layout.requestRightbarWidth(width)suggests a normal right-panel width and returns a handle withupdate(width)anddispose(). It never replaces the user's saved width, and it stays under the frame's existing limits: the 300-pixel minimum, at most 70% of the frame, and the 400-pixel reservation for the conversation.tabInfo.panel.isSoleDockedPanetells a tab whether it is the only docked pane, so a plugin only requests a width when it owns the whole panel, and not in split or floating layouts or in fullscreen.RangeErrorwithout changing the current request or the saved width.Reference implementation
Commit on
dsh-v0.2.1-rc.2: mobile-dev-harness/deepseek-harness@abfc7b9 (compare with master)The change is in
packages/client/ui-layout(layout store, controller,AppFrame) andpackages/client/ui-sidebar-right(TabInfo.panel), with the English and Chinese READMEs and their translation records updated. It addsrightbar-width.client.spec.tsand extends the layout store, service,AppFrameand tab-info tests; fixtures in other packages gain the newisSoleDockedPanefield. The 111 affected test files (1,315 tests) pass, as dobuild:artifacts,build:checkand the commit hooks.doc-syncpasses exceptverify-repository-references, which already fails at687f282onpython/sdk/uv.lock:113(also noted in #10024).How a plugin uses it
Mobile Preview Plugin detects the method and falls back to manual sizing when it is absent. While its tab is visible, not in fullscreen and the sole docked pane, it computes the width that fits the phone screen at the available height and keeps one request updated as the window or content changes. It disposes the request when the tab is hidden, enters fullscreen, or is split or floated. After a manual drag it stops requesting until the preview is shown again.
Result
DSH Web in a 1440 × 900 viewport with an iOS Simulator preview. The comparison uses stock DSH Web
0.2.1-alpha.1, which opens the panel at its default 45%, and this commit run from source:requestRightbarWidthThe preview keeps its size while the conversation column gains 309 px. Dragging the divider to 539 px afterwards kept 539 px; the plugin did not reassert its width.
Stock DSH Web
0.2.1-alpha.1:With
requestRightbarWidth(abfc7b9from source):Both screenshots were captured at 1440 × 900 with the host name in the plugin panel hidden.
The change is MIT-licensed like DSH. Please feel free to take the commit as-is or redesign the API in whatever form fits; we will adapt the plugin to it.
cc @tianyicui @imccyu
All reactions