Merge pull request #1209 from Henvy-Mango/fix/sidechat-to-latest-pill

fix(sidechat): keep the back-to-latest pill at its content height and round its ends
This commit is contained in:
naomi233 authored and GitHub committed 2026-11-17 23:00:55 +08:00
1 parent 2647fbac2d
commit cbc2f575f9
3 files changed
+17

No files matched your search

+3
View File
@@ -4,6 +4,9 @@
### 未发布
- 🎯 **侧边对话「回到最新」胶囊不再塌成细条、端部恢复正圆**([#1208](https://github.com/omdsh-dev/DSH-better-sidebar/issues/1208)):胶囊所在的 `.sidechatToLatestSlot` 是 `height: 0` 的绝对定位 flex 槽位(抄宿主 `ui-chat` 的 `.toBottomSlot` 配方),但子项没有尺寸约束——默认 `align-items: stretch` 会在零高容器里把它拉到 0 高,内容高度被丢掉,只剩 `padding + border` 的 10px,文字于是溢出到胶囊外。宿主自己的 `.toBottom` 靠显式 `34px` 高度绕开了同一个坑,这里改用 `align-items: flex-end` + `flex: none` 让胶囊保持自身内容高度(30px)。同时补上 `corner-shape: round`:宿主 `corner-shape.css` 对 `*` 施加 `superellipse(1.5)`,会把 `border-radius: 999px` 的胶囊端部削平,宿主的全圆元素都成对声明退出该效果,本插件此前漏了这条。该按钮在 v0.31.0 引入,v0.31.0–v0.32.1 均受影响。
- 🧪 真实宿主 + Chromium 挂载冒烟确认侧边对话渲染无回归;修复前后在 Chrome 157 用宿主真实 token 样式表做过 A/B 对照(高度 10px→30px、文字溢出 true→false、`corner-shape` 恢复 `superellipse(1)`)。
- 🌿 **多仓库工作区的仓库切换器改成响应式**(贡献者 PR [#1130](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1130) @iasiv5):容器工作区发现多个仓库时,「更改」上方一行在宽度足够时横排仓库胶囊,放不下时自动改为「仓库 ▾」下拉;两种形态共用位置消歧标签(深层仓库显示 `名 (相对父路径)`,如 `knowhow (ob-harness/contexts)`),当前根始终可见,服务端回退根以禁用项如实显示实际根而不是冒充候选。单仓库工作区不显示;「更多操作 → 仓库」保留为兜底;切换仍走既有 `chooseRepo`,读数、写操作与提交图继续钉在选中的根上。
- 🧪 测试:`tests/git-repo-labels.spec.ts`(32 例:POSIX / Windows / UNC / 扩展路径、同名消歧、顺序与输入不变)与 `tests/git-repo-switcher.spec.tsx`(宽时胶囊、窄时下拉、标签与回退禁用项、单仓不显示)。
+3
View File
@@ -6,6 +6,9 @@
### Unreleased
- 🎯 **The side chat's "back to latest" pill no longer collapses into a sliver, and its ends are round again** ([#1208](https://github.com/omdsh-dev/DSH-better-sidebar/issues/1208)): the pill's `.sidechatToLatestSlot` is a `height: 0` absolutely-positioned flex slot (the host's `ui-chat` `.toBottomSlot` recipe), but its child carried no size constraint — the default `align-items: stretch` pulled it to zero height inside a zero-height box, discarding its content height and leaving only the `padding + border` 10px, so the label overflowed outside the capsule. The host's own `.toBottom` sidesteps the same trap with an explicit `34px` height; this uses `align-items: flex-end` + `flex: none` so the pill keeps its own content height (30px). `corner-shape: round` is added alongside: the host's `corner-shape.css` applies `superellipse(1.5)` to `*`, which squares off the ends of a `border-radius: 999px` capsule, and the host's own full-round elements opt out in pairs — this plugin had missed that. The button shipped in v0.31.0 and every release from v0.31.0 through v0.32.1 is affected.
- 🧪 The real-host + Chromium mount smoke confirms side-chat rendering has no regression; the before/after was A/B-checked in Chrome 157 against the host's real token sheets (height 10px → 30px, text overflow true → false, `corner-shape` back to `superellipse(1)`).
- 🌿 **The multi-repository switcher is now responsive** (contributor PR [#1130](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1130) @iasiv5): when a container workspace discovers several repositories, the row above Changes renders natural-width chips while every root fits on one line and switches to a `Repository ▾` select once it does not. Both forms share the same location labels (deeper roots show `name (relative/parent)`, e.g. `knowhow (ob-harness/contexts)`), the current root stays visible, and a server-fallback root appears as a disabled stand-in instead of masquerading as a candidate. Single-repository workspaces render nothing; the ⋯ → Repository submenu stays as the fallback; switching still goes through `chooseRepo`, so reads, mutations and the commit graph stay pinned to the chosen root.
- 🧪 `tests/git-repo-labels.spec.ts` (32 cases: POSIX / Windows / UNC / extended paths, duplicate disambiguation, order and input immutability) and `tests/git-repo-switcher.spec.tsx` (chips when wide, select when narrow, labels and the disabled fallback, single-repo absence).
+11
View File
@@ -268,6 +268,12 @@
z-index: 2;
height: 0;
display: flex;
/* A zero-height flex box stretches its children to zero height, so the slot
must bottom-align them: the pill then keeps its own content height instead
of collapsing into its own padding/border. The host's `.toBottom` escapes
the same trap with an explicit 34px height; this pill has none, so the
alignment is what preserves it. */
align-items: flex-end;
justify-content: flex-end;
padding-right: max(
calc(var(--dsh-composer-side-clearance, 16px) + 16px),
@@ -279,9 +285,14 @@
/* Return-to-latest pill: floats over the transcript's bottom edge while the
reader is away from the tail. */
.sidechatToLatest {
flex: none;
padding: 4px 12px;
border: 1px solid var(--dsw-alias-border-l2, var(--dsw-alias-border-l1));
border-radius: 999px;
/* The host's corner-shape.css applies superellipse(1.5) to every element,
which squares off a capsule's ends. Full-round shapes opt out in pairs —
the host's own `.toBottom` does the same — so the pill must too. */
corner-shape: round;
background: var(--dsw-alias-bg-base);
color: var(--dsw-alias-label-secondary);
font: var(--dsw-font-xs-13);