Skip to content

Commit 76056d3

Browse files
authored
chore(dev): add collapsible header to dev app (#2650)
Adds a toggle to hide the dev app header, giving full vertical space to the editor. Click the slim bar above the toolbar to bring it back.
1 parent fa0cf5e commit 76056d3

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

packages/superdoc/src/dev/components/SuperdocDev.vue

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ let closeActivityStream = null;
7575
const superdocLogo = SuperdocLogo;
7676
const uploadedFileName = ref('');
7777
const uploadDisplayName = computed(() => uploadedFileName.value || 'No file chosen');
78+
const headerCollapsed = ref(false);
7879
7980
const DEV_THEME_CLASSES = ['sd-theme-docs', 'sd-theme-word', 'sd-theme-blueprint', 'sd-theme-neon-night'];
8081
@@ -1323,7 +1324,8 @@ if (scrollTestMode.value) {
13231324
<template>
13241325
<div class="dev-app" :class="{ 'dev-app--scroll-test': scrollTestMode }">
13251326
<div class="dev-app__layout">
1326-
<div class="dev-app__header">
1327+
<div v-if="!headerCollapsed" class="dev-app__header">
1328+
<button class="dev-app__header-toggle" title="Hide header" @click="headerCollapsed = true">▲</button>
13271329
<div class="dev-app__brand">
13281330
<div class="dev-app__logo">
13291331
<img :src="superdocLogo" alt="SuperDoc logo" />
@@ -1487,6 +1489,9 @@ if (scrollTestMode.value) {
14871489
</div>
14881490
</div>
14891491
1492+
<button v-if="headerCollapsed" class="dev-app__header-show" title="Show header" @click="headerCollapsed = false">
1493+
▼ SuperDoc Dev
1494+
</button>
14901495
<div class="dev-app__toolbar-ruler-container">
14911496
<div id="toolbar" class="sd-toolbar"></div>
14921497
<div id="ruler-container" class="sd-ruler"></div>
@@ -1610,6 +1615,42 @@ if (scrollTestMode.value) {
16101615
z-index: 120;
16111616
}
16121617
1618+
.dev-app__header-toggle {
1619+
position: absolute;
1620+
right: 12px;
1621+
top: 8px;
1622+
background: none;
1623+
border: none;
1624+
color: #94a3b8;
1625+
cursor: pointer;
1626+
font-size: 12px;
1627+
padding: 4px 8px;
1628+
border-radius: 4px;
1629+
z-index: 1;
1630+
}
1631+
1632+
.dev-app__header-toggle:hover {
1633+
color: #e2e8f0;
1634+
background: rgba(255, 255, 255, 0.1);
1635+
}
1636+
1637+
.dev-app__header-show {
1638+
background: #0f172a;
1639+
color: #94a3b8;
1640+
border: none;
1641+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
1642+
cursor: pointer;
1643+
font-size: 11px;
1644+
padding: 4px 16px;
1645+
text-align: center;
1646+
width: 100%;
1647+
}
1648+
1649+
.dev-app__header-show:hover {
1650+
color: #e2e8f0;
1651+
background: #1e293b;
1652+
}
1653+
16131654
.dev-app__header::after {
16141655
content: '';
16151656
position: absolute;

0 commit comments

Comments
 (0)