Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Give the desktop app's window no title bar

Fei2411727f563bef0a
diff --git a/app/README.md b/app/README.md
index a02ce4dd..24b09232 100644
--- a/app/README.md
+++ b/app/README.md
@@ -38,7 +38,7 @@ Never point `DS_BOT_HOME` at `~/.dsh` or at the data of an app that you use.
| File | What it does |
|---|---|
-| `src/main.mjs` | Main process: one instance, the `dsh-app://app` scheme (the window's build, and `/api/` forwarded to the Host), the window |
+| `src/main.mjs` | Main process: one instance, the `dsh-app://app` scheme (the window's build, and `/api/` forwarded to the Host), the window. The window has no title bar: a band along the top of the page moves it, and the system's window buttons sit in that band |
| `src/host-process.mjs` | Starts the Host in Electron's Node mode and owns its exit |
| `src/host.mjs` | The Host: creates the profile `ds-bot` (`dsh-base`, `dsh-web-app`, `ds-bot`), boots it with `runProfile()` on a loopback port and reports the launch URL |
| `src/web.mjs` | The window's files, the launch-token cookie exchange and the request forwarding |
diff --git a/app/src/main.mjs b/app/src/main.mjs
index fa2b91a4..bff5d8e8 100644
--- a/app/src/main.mjs
+++ b/app/src/main.mjs
@@ -1,7 +1,7 @@
// Electron main process: one window for the Bot team, served by the app's own DSH Host.
// The dsh-app scheme and the request forwarding follow DeepSeek Harness
// apps/desktop/src/main.ts (MIT); see NOTICE.
-import { app, BrowserWindow, dialog, Menu, nativeTheme, protocol, shell } from 'electron'
+import { app, BrowserWindow, dialog, Menu, nativeTheme, protocol, screen, shell } from 'electron'
import { existsSync, mkdirSync } from 'node:fs'
import { homedir } from 'node:os'
import { dirname, join } from 'node:path'
@@ -11,6 +11,9 @@ import { APP_ORIGIN, authenticateWebHost, forwardWebRequest, serveFile } from '.
// DSH writes dsh-app://app/ into workspace file URLs and Markdown file links, so the window keeps that scheme.
const SCHEME = 'dsh-app'
+// The window has no title bar: its page draws a band this high along the top (--dsb-band
+// in ui/src/app.css), and the system's window buttons sit in it.
+const BAND = 48
const here = dirname(fileURLToPath(import.meta.url))
// The window is the app's own build (ui/, `npm run build`); everything under /api/ goes to the Host.
@@ -74,13 +77,28 @@ function start() {
setMenu()
createWindow()
+ nativeTheme.on('updated', () => {
+ if (mainWindow === undefined) return
+ mainWindow.setBackgroundColor(windowFill())
+ if (process.platform !== 'darwin') mainWindow.setTitleBarOverlay(windowButtons())
+ })
}
+const windowFill = () => (nativeTheme.shouldUseDarkColors ? '#141414' : '#fcfcfc')
+// Clear, so the buttons sit on the page's own colors; the symbols take its text color.
+const windowButtons = () => ({ color: '#00000000', symbolColor: nativeTheme.shouldUseDarkColors ? '#f2f2f2' : '#141414', height: BAND })
+
function createWindow() {
+ const area = screen.getPrimaryDisplay().workAreaSize
mainWindow = new BrowserWindow({
- width: 1320, height: 860, minWidth: 720, minHeight: 480,
+ width: Math.min(1320, Math.round(area.width * 0.9)), height: Math.min(860, Math.round(area.height * 0.9)),
+ minWidth: 720, minHeight: 480,
title: 'DeepSeek Bot', show: false,
- backgroundColor: nativeTheme.shouldUseDarkColors ? '#141414' : '#fcfcfc',
+ titleBarStyle: 'hidden',
+ // macOS keeps its traffic lights, centered in the band; Windows and Linux draw their
+ // buttons over the band's right end.
+ ...(process.platform === 'darwin' ? { trafficLightPosition: { x: 18, y: (BAND - 12) / 2 } } : { titleBarOverlay: windowButtons() }),
+ backgroundColor: windowFill(),
webPreferences: { contextIsolation: true, sandbox: true },
})
mainWindow.once('ready-to-show', () => { mainWindow?.show() })
diff --git a/app/ui/src/app.css b/app/ui/src/app.css
index e55af0fd..91e42d80 100644
--- a/app/ui/src/app.css
+++ b/app/ui/src/app.css
@@ -11,13 +11,25 @@ body[data-ds-dark-theme]{color-scheme:dark}
.dsb-frame{display:grid;grid-template-columns:280px minmax(0,1fr);height:100%}
.dsb-frame[data-rail]{grid-template-columns:56px minmax(0,1fr)}
+/* The window has no title bar. A band along the top of the sidebar and of the conversation
+ moves the window (BAND in src/main.mjs); its first row of controls sits centered in it.
+ The system draws its window buttons over the band: at the right end on Windows and Linux
+ (--dsb-buttons-w wide), at the left end on macOS. */
+:root{--dsb-band:48px;--dsb-buttons-w:calc(100vw - env(titlebar-area-x,0px) - env(titlebar-area-width,100vw));--dsh-frame-overlay-top:calc(var(--dsb-band) + 8px)}
+.dsb-band{position:absolute;inset:0 0 auto;height:var(--dsb-band);pointer-events:none;-webkit-app-region:drag;app-region:drag}
+.dsb-frame :is(button,a,input,textarea,select,label,[role=button]),body>:not(#root){-webkit-app-region:no-drag;app-region:no-drag}
+.bt-panel .bt-drawer-top{padding-top:6px;padding-right:calc(17px + var(--dsb-buttons-w))}
+.bt-panel .bt-ptabs{padding-right:calc(6px + var(--dsb-buttons-w))}
+.bt-pane :is(.bt-to,.bt-create-head){padding-right:calc(12px + var(--dsb-buttons-w))}
+
/* Sidebar; collapsed, a rail of marks under the brand, which expands it again. */
-.dsb-side{display:flex;flex-direction:column;min-width:0;min-height:0;padding:6px 12px;background:var(--bt-sidebar);border-right:1px solid color-mix(in srgb,var(--bt-ink) 12%,transparent);box-sizing:border-box}
+.dsb-side{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding:0 12px 6px;background:var(--bt-sidebar);border-right:1px solid color-mix(in srgb,var(--bt-ink) 12%,transparent);box-sizing:border-box}
.dsb-side-list{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;margin:0 -12px 0 -4px;padding-left:4px}
.dsb-side .bt-list{overflow-x:hidden}
-.dsb-frame[data-rail] .dsb-side{padding:6px 10px}
+.dsb-frame[data-rail] .dsb-side{padding:0 10px 6px}
.dsb-frame[data-rail] .dsb-side-list{margin:0;padding:0;align-items:center}
-.dsb-expand{flex:none;width:36px;height:36px;margin:12px 0;padding:0;border:0;border-radius:50%;background:none;display:inline-grid;place-items:center;cursor:pointer;transition:background-color .12s ease}
+.dsb-expand{flex:none;width:36px;height:36px;margin:6px 0 12px;padding:0;border:0;border-radius:50%;background:none;display:inline-grid;place-items:center;cursor:pointer;transition:background-color .12s ease}
+html[data-mac] .dsb-frame .dsb-side{padding-top:var(--dsb-band)}
.dsb-expand:hover{background:color-mix(in srgb,var(--bt-ink) 6%,transparent)}
.dsb-side-foot{display:flex;align-items:center;gap:9px;padding:8px 6px 6px}
.dsb-frame[data-rail] .dsb-side-foot{margin:0 -5px;padding:8px 0 6px}
@@ -26,7 +38,7 @@ body[data-ds-dark-theme]{color-scheme:dark}
/* Conversation: a floating header pill over the transcript, and the composer below. */
.dsb-main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bt-main);--dsh-chat-content-width:min(960px,100%)}
-.dsb-head{position:absolute;top:0;left:0;right:0;z-index:8;display:flex;justify-content:center;padding:10px 0 0;pointer-events:none}
+.dsb-head{position:absolute;top:0;left:0;right:0;z-index:8;display:flex;justify-content:center;padding:4px 0 0;pointer-events:none}
.dsb-head::before{content:"";position:absolute;inset:0 0 auto;height:60px;background:linear-gradient(to bottom,var(--bt-main),color-mix(in srgb,var(--bt-main) 0%,transparent));pointer-events:none;z-index:-1}
.dsb-head .bt-head{flex:1 1 auto;width:100%}
.dsb-chat{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
diff --git a/app/ui/src/app.js b/app/ui/src/app.js
index 2d71c821..ba932ade 100644
--- a/app/ui/src/app.js
+++ b/app/ui/src/app.js
@@ -61,6 +61,7 @@ export function App() {
}
return h('div', { className: 'dsb-frame', 'data-rail': wide ? undefined : '' },
h('aside', { className: 'dsb-side' },
+ h('div', { className: 'dsb-band' }),
h('div', { className: 'dsb-side-list' },
wide ? null : h('button', { type: 'button', className: 'dsb-expand', 'aria-label': t('Expand sidebar'), title: t('Expand sidebar'), onClick: () => actions.toggleSidebar() }, h(BrandMark, { size: 22 })),
h(TeamSidebar, { ...views, wide })),
@@ -68,6 +69,7 @@ export function App() {
h('button', { type: 'button', className: 'dsb-settings', title: t('Settings'), onClick: () => actions.openSettings() }, h(YouAvatar)))),
// The details panel makes room by giving the shell's `_centerCol` column a right margin.
h('main', { className: 'dsb-main dsb_centerCol' },
+ h('div', { className: 'dsb-band' }),
shown ? h(Fragment, { key: shown },
h('div', { className: 'dsb-head' }, h(HeaderPill, { ...views, sessionId: shown, useSession: team.sessionHook(shown) })),
h(Chat, { sessionId: shown, team })) : null),
diff --git a/app/ui/src/main.js b/app/ui/src/main.js
index c2159b97..2dd687ad 100644
--- a/app/ui/src/main.js
+++ b/app/ui/src/main.js
@@ -19,6 +19,8 @@ import './app.css'
installLocale(createLocale(navigator.language))
document.documentElement.lang = navigator.language
+// macOS puts the window buttons at the band's left end, over the sidebar (app.css).
+if (/mac/iu.test(navigator.userAgentData?.platform ?? navigator.platform)) document.documentElement.dataset.mac = ''
// The Bot views' own stylesheets, the same ones the plugin puts in DSH.
for (const [tag, text] of [
diff --git a/docs/plans/2026-10-16-desktop-app.md b/docs/plans/2026-10-16-desktop-app.md
index bb5e018e..c3452b50 100644
--- a/docs/plans/2026-10-16-desktop-app.md
+++ b/docs/plans/2026-10-16-desktop-app.md
@@ -18,7 +18,7 @@
| 部分 | 做什么 |
|---|---|
-| 壳 | Electron 主进程。只开一个实例;窗口用 `dsh-app://app` 加载页面,把请求转发给引擎;管引擎进程的启动和退出 |
+| 壳 | Electron 主进程。只开一个实例;窗口用 `dsh-app://app` 加载页面,把请求转发给引擎;管引擎进程的启动和退出。窗口无边框:没有标题栏,页面顶部一条带子用来拖动窗口,系统的窗口按钮放在这条带子里 |
| 引擎 | 子进程,用 Electron 自带的 Node 运行。通过 `@deepseek-ai/dsh/profile-boot` 的 `runProfile()` 启动 profile `ds-bot`,只监听 `127.0.0.1` 上系统分配的端口。环境变量 `DS_BOT_APP=1` 告诉 ds-bot 它跑在桌面应用里 |
| 界面 | DS Bot 自己写的网页(React + Vite)。只认 DS Bot 自己的接口:引擎里的 ds-bot 用 HTTP 和事件流提供团队、对话和设置的数据,界面不直接调 DSH 的接口,也不引用 `@deepseek-ai/*` 的包。DSH 只出现在引擎这一层。Bot 界面(侧栏、对话、详情、弹窗和它们的样式)和插件版是同一套代码,两边长得一样;插件版里由 DSH 画的部分(Markdown 排版、会话框架),窗口自己画 |
@@ -74,4 +74,4 @@
## 变更
- 2026-10-17:电脑操作和浏览器操作的提供方由用户选,PR #278。
-- 2026-10-17:窗口换成自己的界面,用插件版的 Bot 界面画:团队侧栏、Bot 的私聊、详情、搜索、新建和设置,PR #279。
+- 2026-10-17:窗口换成自己的界面,用插件版的 Bot 界面画:团队侧栏、Bot 的私聊、详情、搜索、新建和设置;窗口无边框,PR #279。