revert: 回退「只在未展开时显示底部入口」——把「没展开」理解成了底栏,实际是指右侧面板
This commit is contained in:
1 parent
f7a70d1aae
commit
8e3447b27a
5 files changed
+10
-42
No files matched your search
+6
-11
@@ -771,30 +771,25 @@ export function Sidebar(props: { ctx: Context; store: SidebarStore }) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* The control that EXPANDS the bottom workbench (see
|
||||
* sidebar/bottom-toggle.tsx — registered into DSH's session header).
|
||||
*
|
||||
* **只在未展开时出现**:展开态由面板自己的收起控件(`.bottomClose`,面板页签条
|
||||
* 右端那个 ×)负责,头部再来一个「收起」既冗余、又多一个要跟宿主 chrome 抢位置的
|
||||
* 状态。收起后本按钮重新出现。
|
||||
*/
|
||||
/** The header control that expands/collapses the bottom workbench (see
|
||||
* sidebar/bottom-toggle.tsx — registered into DSH's session header). */
|
||||
export function BottomDockToggle(props: { store: SidebarStore }) {
|
||||
const { store } = props
|
||||
const snapshot = useSyncExternalStore(
|
||||
useCallback((callback: () => void) => store.subscribe(callback), [store]),
|
||||
useCallback(() => store.getSnapshot(), [store]),
|
||||
)
|
||||
if (snapshot.state?.bottomOpen === true) return null
|
||||
const label = t('expandBottomPanel')
|
||||
const open = snapshot.state?.bottomOpen === true
|
||||
const label = open ? t('collapseBottomPanel') : t('expandBottomPanel')
|
||||
return (
|
||||
<Tooltip label={label} side="bottom" delayMs={500}>
|
||||
<button
|
||||
type="button"
|
||||
className={css.toggleButton}
|
||||
data-dsh-bottom-toggle
|
||||
data-active={open ? 'true' : undefined}
|
||||
aria-label={label}
|
||||
aria-pressed={false}
|
||||
aria-pressed={open}
|
||||
onClick={() => { store.reduce(toggleBottomPanel) }}
|
||||
>
|
||||
<IconPanelBottomOutline16 size={15} />
|
||||
|
||||
@@ -163,9 +163,6 @@ export function DockFallback({ store }: { store: SidebarStore }): ReactNode {
|
||||
if (phase === undefined || !phase.blank) return null
|
||||
// 兜底:相位说 blank、但会话头的入口确实在 DOM 里 —— 让位,绝不叠出第二套。
|
||||
if (headerEntry) return null
|
||||
// 底栏已经展开时不渲染(里面那个按钮本身也会返回 null,这里连空壳一起省掉):
|
||||
// 收起由面板自己的 × 负责。
|
||||
if (snapshot.state?.bottomOpen === true) return null
|
||||
// portal 到 body:面板宿主(z 20-30)的层叠上下文压不过会话头,按钮会被 titleRow
|
||||
// 拦截点击。40 高于 AppFrame(20) 与会话头、低于 DSH 浮层(100+)。
|
||||
return createPortal(
|
||||
|
||||
Reference in new issue
Block a user