Repository navigation
Conversation
New client-only plugin @klarkxy/dsh-sidebar-layout. It tags the host
AppFrame and its centre column with plugin-owned attributes (a tagged
node instead of a :has() selector — better-sidebar documents the restyle
cost during streaming), and one injected stylesheet drives the layouts:
- drawer: centre spans the right track so the panel overlays a
conversation that keeps full width; an ::after mask dims it and a
click on the mask collapses the panel via ctx.sidebarRight.
- swap ("正文"): the columns trade grid positions — the panel fills the
centre as the body, the conversation becomes the right column, and
the host's drag handle resizes the conversation. Windows/macOS chrome
radii and macOS leading clearance follow the surfaces.
Mode persists browser-local (localStorage) and is shared by three
entry points: a header utilities menu, a Settings > General row
(id sidebar-layout/40), and the sidebar.layout.cycle command bound to
primary+alt+shift+B on every admissible profile. Fullscreen and the
<768px auto-fullscreen are excluded everywhere. Compatible with
dsh-better-sidebar's native tabs and centre-column rules.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
klarkxy
pushed a commit
that referenced
this pull request
Nov 21, 2026
Contributor
Comment on lines
+131
to
+142
| it('retags a replaced frame', async () => { | ||
| const { dom } = mountClient() | ||
| const root = dom.window.document.getElementById('root')! | ||
| const old = dom.window.document.getElementById('frame')! | ||
| const next = old.cloneNode(true) as Element | ||
| next.id = 'frame-2' | ||
| old.replaceWith(next) | ||
| // The MutationObserver delivery is asynchronous. | ||
| await new Promise(resolve => setTimeout(resolve, 0)) | ||
| expect(next.getAttribute(FRAME_ATTRIBUTE)).toBe('push') | ||
| expect(next.querySelector('.centre')!.hasAttribute(CENTER_ATTRIBUTE)).toBe(true) | ||
| expect(root.contains(old)).toBe(false) |
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动 / Change
新增客户端插件
@klarkxy/dsh-sidebar-layout(生命周期draft),把宿主原生右侧边栏(dsh-client-ui-sidebar-right)在三种呈现方式间切换:实现:给宿主 AppFrame 与中间列打插件自有属性标记(替代
:has()选择器——better-sidebar 记载过流式更新时的 restyle 开销),注入一份按属性分组的样式表驱动三种布局;不修补宿主内部 API,不覆盖dsh-better-sidebar的任何属性与规则,可与dsh-better-sidebar同时使用。切换入口(同一份全局状态,浏览器本地持久化):
conversation.session.header.utilities图标按钮弹出菜单(常规/抽屉/正文,当前勾选);选抽屉或正文时若面板收起会自动展开。sidebar-layout/40 行,原生select(dsh-ui-select)。sidebar.layout.cycle,默认Ctrl/Cmd+Alt+Shift+B循环三种方式(web:linux 不支持三修饰键默认,留空由用户自绑)。约束:面板全屏与 <768px 自动全屏在所有方式下保持宿主原样;宿主在空间不足时的自动收起行为不变。
Standalone client plugin: three presentations for the native right Sidebar — push, drawer overlay with a click-to-dismiss mask, and an IDE-style swap where the panel becomes the body and the conversation moves right. Driven by a tagged-attribute stylesheet; no host internals patched; works alongside dsh-better-sidebar.
测试 / Tests
pnpm --filter @klarkxy/dsh-sidebar-layout test:27/27(mode store 持久化/非法值回退/storage 同步、frame 定位与重挂、遮罩点击边界、快捷键循环与会话缺失容错、席位注册形态)pnpm --filter @klarkxy/dsh-sidebar-layout typecheck/buildnode --test scripts/plugin-settings.test.mjs4/4、pnpm test:editor-build62、pnpm release:check78、pnpm pack:check、git diff --check界面验收 / UI acceptance
ba09e7b(GIF 录制于提交前,工作区代码与本分支 head 完全相同,无后续界面改动)。.agents/skills/dsh-web-acceptance/隔离dsh web(临时HOME/DSH_HOME/DSH_AGENTS_HOME),安装dsh-better-sidebar@0.32.1;qa-report.json无页面错误、控制台错误和 HTTP 错误。Ctrl+Alt+Shift+B循环。Generated with Devin