Skip to main content
1

dsh-workspace-decor

1736castle/dsh-workspace-decor

Sidebar colour coding plus a project switcher — one emoji icon and one colour per workspace; the project row and its session block are tinted in that colour, the workspace picker and the chat badges stay in sync, and the composer chip opens a list of projects whose every row is filled with that project's own colour, the current one deeper and ticked, with a + on each row to start a new conversation inside that project and an automatic sidebar jump to the project you picked. Unconfigured projects get a colour automatically.

Install

dsh plugin --profile web add github:1736castle/dsh-workspace-decor

README

项目图标与颜色 · Workspace icon & colour

给 DeepSeek Harness 侧栏里的每个项目配上图标和颜色:项目行、它自己的会话区块、新建会话时的项目列表、输入框工具栏、会话标题栏和最新一条消息末尾,都会用同一个颜色标出来,不用重绘整个窗口。 Give every project in the DeepSeek Harness sidebar an icon and a colour — on its row, on its own block of sessions, in the workspace picker, in the composer toolbar, in the session header and at the end of the newest message — without repainting the whole window.

中文 · English

输入框里的项目切换器:点标签、按颜色挑项目、点 + 新建会话 · The project switcher in the composer: open the chip, pick a project by colour, or start a new chat with +

侧栏里的项目颜色 · Sidebar project blocks tinted with the project colour

设置图标与颜色 · The icon & colour picker

新建会话时选项目 · Picking the project for a new chat

标签出现的三个位置 · The project label in three places around the chat

输入框里的项目切换器 · The switcher inside the composer toolbar

动图取自仓库自带的 test/switch.html(把宿主侧栏和输入框做成可交互的假界面,跑的是真实的 client.js);静态截图来自 test/case.html 和真实客户端界面。项目名均为示例数据。 The animation is recorded in the bundled test/switch.html harness, which plays the real client.js against a fake host sidebar and composer; the stills come from test/case.html and the live client. The project names are demo data.

搜索关键词 · Search keywords:工作区、项目、图标、颜色、侧栏、配色、会话、着色、选择器、输入框、标签 · workspace、project、icon、colour、sidebar、tint、session、picker、composer chip、chat badge

插件市场详情页的截图由本仓库根目录的 screenshots.json 声明(指向 assets/ 下的图片),市场构建时自动抓取。 The screenshots on the market detail page are declared by screenshots.json at the repository root (pointing at the images under assets/); the market build picks them up automatically.


中文

这是什么

DSH 侧栏里每个工作区是一个项目块:项目行 + 它下面的会话。这个插件让每个项目拥有自己的图标和颜色,并把这个颜色带到所有"你可能选错项目"的地方,让侧栏读起来像分好颜色的章节,而不是一长串同名条目。

0.9.2 更新要点

  • 输入框工具栏新增项目切换器:点标签弹出项目组列表,每行铺满该项目自己的颜色;点整行进入它的最新会话,每行右侧 + 在那个项目下新建会话。
  • 切换后自动补跳:侧栏先跳到该项目,等布局稳定(最多 8 趟)再补一次跳转,落在真正可见的位置。
  • 切换器滚动条改成细线:磨砂卡片里不再透出系统滚动条,深浅主题一致。
  • 新增动图与交互演示页 test/switch.html:侧栏可滚动、会话行可点、+ 会插入新会话,切换与跳转都能在上面复现。

功能

  • 图标选择器:每个项目行可以挑一个内置表情图标,行首显示图标、彩色圆环和左侧细色条,项目一眼就能找到。
  • 项目块着色:项目行和它下面的所有会话铺一层该项目的淡色;当前所在的项目颜色略深并带一圈细描边,不用整窗换色也能看出当前在哪个项目。
  • 项目列表带颜色:新建会话时打开的"选择工作区"菜单里,每个项目都带同色圆点加整行淡色底,选中前就能认出是哪个项目,而不是只读标题。
  • 选完自动跳转:在列表里选中一个项目后,侧栏会自动滚动到该项目所在的彩色区块,即使它在列表下方看不见的位置,也能立刻确认"我刚选的是哪个"。
  • 输入框工具栏项目切换器:输入框左侧、标准 模式后面有一颗项目标签,带颜色圆点和项目名。点一下弹出项目组列表,每一行都用该项目自己的颜色铺满整行底色并带左侧色条,当前项目颜色更深并打勾——不用读名字,扫一眼颜色就知道要选哪个。点整行会进入那个项目最新的会话;每行右侧还有一个 + 按钮,直接在那个项目下新建会话(项目还没有会话时,点整行也会新建)。所以在会话中途也能换项目,不必先退出;选的是当前项目时仍然只是跳转侧栏。切换或新建之后,侧栏都会滚到该项目的彩色区块——进入另一个项目会让下面的块整体位移,所以布局稳定后还会补一次跳转。输入框太窄时标签收成只剩圆点,工具栏不会换行。
  • 会话窗口里的标签:会话打开期间,顶部标题栏右侧和最新一条消息末尾(紧挨 token 数与时间)各有一枚项目色标签,颜色与侧栏一致,选错项目在开口之前就能发现。
  • 自动配色:新项目按工作区 id 自动得到一个颜色,重启不变;新增或删除项目不会让其他项目换色。
  • 子项目独立:嵌套的子项目用自己的颜色,不继承父项目。
  • 本地存储:选择只存在本机浏览器(dsh-workspace-decor.v1),不会写进工作区文件。

安装

在 DSH 插件市场搜索 dsh-workspace-decor 安装,或把本仓库作为本地 bundle 安装。浏览器代码已预构建,无需构建步骤、无运行时依赖。

客户端注册 id(打包自检)

客户端 bundle 的注册 id 必须等于包名。 DSH Web 客户端模块表用包名作为引导行 id,client.js 必须用同一个字符串调用 window.__ModuleLoader__.load({ id });package.json 的 name、cordis.patch.yml 里 insert 条目的 name、client.js 的 id 三者必须完全一致。三者不一致时,整段客户端代码不会执行(控制台出现 could not load),但插件列表仍显示 enabled / active,因为 index.js 的 apply() 是空实现。

打包前运行 npm run check:client-id 可断言三者相等,不相等会直接报错退出;prepack 已挂上这条检查,npm pack / 发布时会自动执行。

搜索关键词

插件市场的搜索按名称和描述匹配(中文按连续的词串匹配,词与词之间不会自动拆分),插件条目里的中英文描述已经写进下面这些词,搜其中任意一个都能命中:

  • 中文:工作区、项目、图标、颜色、侧栏、配色、会话、着色、选择器、输入框、标签
  • English:workspace、project、icon、colour、sidebar、tint、session、picker、composer chip

使用

  • 右键项目行 → 图标与颜色,或点项目行行首的图标。
  • 挑一个图标、12 种颜色之一;项目行、会话区块、项目列表、输入框标签和会话标签立即同步更新。
  • 恢复默认 让该项目回到按 id 自动生成的颜色。

存储与兼容

  • 存储键:dsh-workspace-decor.v1(浏览器 localStorage)。
  • 诊断:dsh-workspace-decor.v1.diagnostics 会记录当前着色了多少项目、标签挂载数等,用来判断插件是否真的在这个窗口里生效。
  • 扁平("在一个列表里")分组模式下没有项目块,但行图标和颜色照常可用。

更多

  • docs/DETAIL.zh.md — 中文细节:工作原理、选择器实现、诊断字段、卸载说明。
  • test/case.html — 镜像宿主侧栏结构的独立测试页,前两张截图即用它和真实界面生成。
  • test/switch.html — 输入框切换器的独立测试页:项目行带「新会话」按钮、会话行可点、侧栏可滚动,切换项目、点+新建、自动跳转都能在这页上验证。

许可

MIT


English

What it is

Every workspace in the DSH sidebar renders as one project block: the project row plus the sessions below it. This plugin gives each project its own icon and colour and carries that colour everywhere you might pick or mis-pick a project, so the sidebar reads as colour-coded sections instead of one long list of similar titles.

What's new in 0.9.2

  • A project switcher in the composer toolbar — the chip opens the list of projects, each row filled with that project's own colour; picking a row opens its latest conversation and a + per row starts a new chat inside that project.
  • The sidebar follows the pick — it jumps to the project first, then repeats the jump once the layout has settled (at most 8 passes) so it lands where the block really is.
  • A hairline scrollbar in the switcher — no platform scrollbar shows through the frosted card, in the light theme and the dark one.
  • A recorded animation and the interactive test/switch.html harness — the sidebar scrolls, session rows are clickable and + inserts a session, so switching and the jump can be replayed there.

What it does

  • Icon picker — every workspace row gets an emoji icon chosen from a built-in set, plus a colour ring and a left colour bar, so the row is easy to find.
  • Per-project block tint — the project row and every session under it sit on a panel of that project's own colour. Every project gets a light tint; the project you are currently in gets a slightly stronger tint and a thin outline, so the active section is obvious without any full-window recolouring.
  • Colour in the workspace picker — the list you open when you start a new chat (the "选择工作区" menu) shows the same colour on every project: a dot in the project colour plus a faint row tint, so you can see which project you are about to pick instead of reading titles only.
  • Sidebar jump on pick — picking a project scrolls the sidebar straight to that project's coloured block, even when it sits below the fold, so "which one did I just pick" is answerable at a glance.
  • A project switcher in the composer toolbar — the empty seat at the left of the composer toolbar, after the 标准 preset, holds a chip with the active project's colour dot and title. Clicking it opens the list of projects, and every row is filled with that project's own colour plus a left colour strip — the current project deeper, outlined and ticked, so the right project can be recognised by colour without reading titles. Picking a row enters that project's latest conversation; a + button at the right of each row starts a new conversation inside that project (a project with no conversations starts one when the row itself is picked). So a conversation can move to the right project without leaving it. Picking the current project still just jumps the sidebar. Either way the sidebar scrolls to that project's coloured block, and because entering another project shifts every block below it, the jump is repeated once the layout has settled. When the composer is too narrow to keep one row, the chip collapses to the colour dot alone so the toolbar never wraps.
  • Project badges inside the chat window — while a conversation is open, the project it belongs to is labelled with a colour pill: one in the session header (top right) and one at the end of the latest message, right next to the token count and time. The colour matches the sidebar, so a mis-scoped session is obvious before you type.
  • Automatic colours — a new project starts with a colour derived from its workspace id, so nothing has to be configured, and adding a project never recolours existing ones. Nested sub-projects keep their own colour instead of inheriting the parent's.
  • Storage — choices are saved in this machine's browser storage only (dsh-workspace-decor.v1); nothing is written into the workspace files.

Install

Install it from the DSH plugin market (search for dsh-workspace-decor), or install this repository as a bundle. The package ships its browser code prebuilt: zero runtime dependencies and no build step.

Client registration id (pre-pack check)

The client bundle's registration id must equal the package name. The DSH Web client module table uses the package name as the bootstrap row id, so client.js must call window.__ModuleLoader__.load({ id }) with that exact string. Three values must match: package.json's name, the insert entry's name in cordis.patch.yml, and the id in client.js. When they drift apart the whole client half silently never runs (the console shows could not load) while the plugin row still reads enabled / active, because index.js's apply() is empty.

Run npm run check:client-id before packing to assert the three are equal; it exits non-zero on a mismatch. prepack runs it automatically for npm pack and publishing.

Search keywords

The market searches a plugin's name and description. A Chinese query matches a contiguous run of characters, so use a single term rather than a phrase; both descriptions in the entry carry the words below and either one hits:

  • Chinese: 工作区、项目、图标、颜色、侧栏、配色、会话、着色、选择器、输入框、标签
  • English: workspace, project, icon, colour, sidebar, tint, session, picker, composer chip

Use

  • Right-click a workspace row → Icon & color, or click the icon at the start of the row.
  • Pick an icon and one of 12 colours; the row, that project's session block, the picker, the composer chip and the chat badges update immediately.
  • Restore defaults puts the project back on its automatic colour.

Details

  • docs/DETAIL.md — behaviour, the dsh-workspace-decor.v1 storage key, the diagnostics view and uninstall notes.
  • test/case.html — a standalone harness that mirrors the host's sidebar structure; the screenshots above were taken from it and from the live client, so the names and projects in them are examples rather than a real workspace list.
  • test/switch.html — a harness for the composer switcher: project rows carry the "new conversation" button, session rows are clickable and the sidebar scrolls, so switching, + and the automatic jump can all be replayed here.

License

MIT

Related plugins