feat(sidebar): keep only the bloom, drop the branch stem and per-row dots
The dashed ghost route, the grown stroke and the dot on every row read as a stray black line down the sidebar, and depth is already carried by the 16px indent step. FlowerBranch now measures rows as before but renders just the bloom on the active row (spinning while that session works); the stroke and dot CSS is gone. branch.ts keeps computing the full geometry and stays unit-tested, so the stem can come back without re-deriving it.
This commit is contained in:
parent
7c6d8c2a0d
commit
15976d7e51
|
|
@ -58,7 +58,7 @@ git 历史里 `942babe` 及更早的提交原样保留;重建工作作为 `b30
|
|||
| `tree.ts` | 纯派生:分类文件夹 → 项目文件夹 → 会话行;可见性规则对齐官方树 |
|
||||
| `locales.ts` | `workspaceGroups` 命名空间词典(zh/en + key 联合类型) |
|
||||
| `styles.css` | 全部样式,`?inline` 导入后由构建期 lightningcss 压缩内联 |
|
||||
| `branch.ts` / `FlowerBranch.tsx` | 侧栏「花枝」SVG 曲线(移植自 RewampUI Flower Sidebar) |
|
||||
| `branch.ts` / `FlowerBranch.tsx` | 侧栏当前行的「花朵」标记(几何计算在 `branch.ts`,仍由单测覆盖;连线与逐行圆点已移除,只画花朵) |
|
||||
| `tabs.ts` | 标签条**纯**状态:打开顺序、激活项、派生展示 |
|
||||
| `tab-store.ts` | `defineStore` 绑定(只做绑定,变换留在 `tabs.ts`) |
|
||||
| `tab-seat.ts` | DOM 挂载点:标签条要贴在会话列顶部(ui-layout `AppFrame` 的 `.centerCol` 是 `pI_x6G_centerCol`,没有对应 slot) |
|
||||
|
|
|
|||
|
|
@ -73,9 +73,9 @@
|
|||
erroring, so data and client versions can move independently
|
||||
- **Pin groups**: pinned groups sort to the front of the tree; dragging a group across the pin
|
||||
boundary re-pins it in the same write, so the drop lands where the indicator showed it
|
||||
- **Animated folding**: expanding/collapsing a group or project animates rows and fades the
|
||||
flower-branch overlay while they move, so the vine never drifts; animation is skipped for
|
||||
large subtrees, during drag folding, and under `prefers-reduced-motion`
|
||||
- **Animated folding**: expanding/collapsing a group or project animates rows and hides the
|
||||
flower marker while they move, so the bloom never lags behind its row; animation is
|
||||
skipped for large subtrees, during drag folding, and under `prefers-reduced-motion`
|
||||
- Stored in the overlay's `appearance` map — **never in the rule YAML** (see below)
|
||||
|
||||
### Search & operations
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ DeepSeek峰谷小组件 等)归入一个「DSH 插件」分类文件夹,点
|
|||
未知值降级为默认文件夹图标而不是报错,数据与客户端版本因此可以各自演进
|
||||
- **置顶分组**:置顶分组排到树的最前面;把分组拖过置顶边界时会在同一次写入里翻转
|
||||
置顶状态,落点就是指示线显示的位置
|
||||
- **折叠动画**:展开/收起分组或项目时行高与透明度过渡,动画期间花枝覆盖层淡出,
|
||||
藤蔓不会漂移;大树、拖动折叠中、`prefers-reduced-motion` 下自动跳过动画
|
||||
- **折叠动画**:展开/收起分组或项目时行高与透明度过渡,动画期间隐藏花朵标记,
|
||||
花不会滞后于所在行;大树、拖动折叠中、`prefers-reduced-motion` 下自动跳过动画
|
||||
- 存放在 overlay 的 `appearance` 里,**绝不写进规则 YAML**
|
||||
|
||||
### 搜索与操作
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,25 +1,24 @@
|
|||
/**
|
||||
* The flower branch: an SVG overlay that draws one continuous curly stem down
|
||||
* the sidebar tree, growing to the row you are currently on.
|
||||
* The flower marker: an SVG overlay that draws a single bloom on the row you are
|
||||
* currently on.
|
||||
*
|
||||
* Ported from the RewampUI *Flower Sidebar* reference. The mechanism, verified
|
||||
* against that page's live DOM:
|
||||
* Originally ported from the RewampUI *Flower Sidebar* reference, which drew a
|
||||
* continuous curly stem down the whole tree — a dashed "ghost" route plus a
|
||||
* solid stroke "grown" to the active row — with a dot on every row and the bloom
|
||||
* at its tip. **The stem and the dots are gone**: they read as a stray black line
|
||||
* down the sidebar, and depth is already carried by the row indentation. Only the
|
||||
* bloom remains, still spinning while the current session works and resting when
|
||||
* it is idle.
|
||||
*
|
||||
* - TWO paths share one `d` prefix: a **ghost** (dashed, faded) drawing the
|
||||
* whole route, and a **grown** solid stroke drawn only as far as the active
|
||||
* row. The grown one is what makes the branch look like it grew to you.
|
||||
* - A **dot per row**, sitting exactly on the curve.
|
||||
* - A **flower at the endpoint**: the stem grows into a bloom on the row you
|
||||
* are on, which is where the grown stroke stops. The bloom TURNS while that
|
||||
* session is working and rests when it is idle.
|
||||
* - The whole SVG is `pointer-events: none` and `overflow: visible`, so it is
|
||||
* pure decoration over the real rows and never intercepts a click.
|
||||
* The SVG is `pointer-events: none` and `overflow: visible`, so it is pure
|
||||
* decoration over the real rows and never intercepts a click.
|
||||
*
|
||||
* Measurement, not layout: the rows are rendered by the tree itself (they carry
|
||||
* drag handlers, menus and hover state), so this component reads each row's
|
||||
* vertical centre from the DOM and feeds plain numbers to `buildBranch`. That
|
||||
* keeps the geometry unit-tested (`branch.ts`) while the SVG stays a dumb
|
||||
* renderer of it.
|
||||
* vertical centre and anchor from the DOM and feeds plain numbers to
|
||||
* `buildBranch`. That keeps the geometry unit-tested (`branch.ts`) while the SVG
|
||||
* stays a dumb renderer of it — and leaves the branch math intact should the stem
|
||||
* ever come back.
|
||||
*
|
||||
* Re-measured on: row count changes (expand/collapse, new session), the active
|
||||
* row changing, and container resize. A `ResizeObserver` on the scroll body
|
||||
|
|
@ -29,7 +28,7 @@
|
|||
* and is applied as a class, so a status flip never re-runs the DOM measurement
|
||||
* above (the tree is the expensive part, not the class swap).
|
||||
*/
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { buildBranch, type Branch, type BranchRow } from './branch.ts'
|
||||
|
||||
/**
|
||||
|
|
@ -220,45 +219,26 @@ export function FlowerBranch({ scope, spinning }: { scope: HTMLElement | null; s
|
|||
}
|
||||
}, [scope])
|
||||
|
||||
// Dots are rendered from the measured rows; keep the memo keyed on identity so
|
||||
// a re-render with the same branch does not rebuild the element list.
|
||||
const dots = useMemo(() => branch?.dots ?? [], [branch])
|
||||
// The endpoint dot gives way to the bloom.
|
||||
const flowerKey = branch?.flower?.key
|
||||
|
||||
if (branch === null || rows.length === 0) return null
|
||||
|
||||
// Only the bloom is drawn. The stem (ghost + grown stroke) and the per-row
|
||||
// dots were removed on request: they read as a stray black line down the
|
||||
// sidebar and the depth is already carried by the indentation, so the flower
|
||||
// alone marks the row you are on. `branch` is still BUILT from the measured
|
||||
// rows — it is what gives the bloom its position — but its path geometry is
|
||||
// no longer rendered.
|
||||
if (branch.flower === null) return null
|
||||
|
||||
return (
|
||||
<svg
|
||||
className="wgBranch"
|
||||
// The box covers the measured span; `overflow: visible` lets the kink draw
|
||||
// outside it without clipping (the reference does the same).
|
||||
width={48}
|
||||
height={Math.max(1, Math.ceil(branch.height))}
|
||||
viewBox={`0 0 48 ${Math.max(1, Math.ceil(branch.height))}`}
|
||||
aria-hidden="true"
|
||||
focusable="false"
|
||||
>
|
||||
<path className="wgBranchGhost" d={branch.ghostPath} />
|
||||
<path className="wgBranchGrown" d={branch.grownPath} />
|
||||
{dots.map(dot => {
|
||||
// The bloom REPLACES the endpoint's dot rather than stacking on it: a
|
||||
// dot left underneath would show through the petals' notches and read
|
||||
// as a second, smaller flower.
|
||||
if (dot.key === flowerKey) return null
|
||||
return (
|
||||
<circle
|
||||
key={dot.key}
|
||||
className={dot.active ? 'wgBranchDot wgBranchDotActive' : 'wgBranchDot'}
|
||||
cx={dot.cx}
|
||||
cy={dot.cy}
|
||||
r={dot.active ? 3.2 : 2}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
{branch.flower !== null && (
|
||||
<Flower cx={branch.flower.cx} cy={branch.flower.cy} spinning={spinning} />
|
||||
)}
|
||||
<Flower cx={branch.flower.cx} cy={branch.flower.cy} spinning={spinning} />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,6 +303,8 @@
|
|||
position:relative;
|
||||
}
|
||||
|
||||
/* The flower overlay holds only the bloom now; the stem and per-row dots were
|
||||
removed, so no stroke rules live here any more. */
|
||||
.wgBranch {
|
||||
z-index:2;
|
||||
pointer-events:none;
|
||||
|
|
@ -314,7 +316,7 @@
|
|||
}
|
||||
|
||||
/* Disclosure animation moves rows before FlowerBranch re-measures: hide the
|
||||
vine overlay while any RowGroup animates so the stem never lags behind. */
|
||||
bloom while any RowGroup animates so it never lags behind its row. */
|
||||
.wgTreeWrap:has([data-wg-animating]) .wgBranch {
|
||||
opacity:0;
|
||||
}
|
||||
|
|
@ -324,32 +326,6 @@
|
|||
position:relative;
|
||||
}
|
||||
|
||||
.wgBranchGhost {
|
||||
fill:none;
|
||||
stroke:var(--dsw-alias-border-l2,#7f7f7f47);
|
||||
stroke-width:1.5px;
|
||||
stroke-dasharray:2 3;
|
||||
vector-effect:non-scaling-stroke;
|
||||
}
|
||||
|
||||
.wgBranchGrown {
|
||||
fill:none;
|
||||
stroke:var(--dsw-alias-label-primary,currentColor);
|
||||
stroke-width:2px;
|
||||
stroke-linecap:round;
|
||||
vector-effect:non-scaling-stroke;
|
||||
transition:stroke .16s;
|
||||
}
|
||||
|
||||
.wgBranchDot {
|
||||
fill:var(--dsw-alias-border-l2,#7f7f7f80);
|
||||
transition:r .16s,fill .16s;
|
||||
}
|
||||
|
||||
.wgBranchDotActive {
|
||||
fill:var(--dsw-alias-label-primary,currentColor);
|
||||
}
|
||||
|
||||
.wgFlowerArt {
|
||||
transform-box:fill-box;
|
||||
transform-origin:50%;
|
||||
|
|
@ -365,7 +341,7 @@
|
|||
}
|
||||
|
||||
@media (prefers-reduced-motion:reduce) {
|
||||
.wgBranchGrown,.wgBranchDot{transition:none}.wgFlowerArt{animation:none}.wgRowsOpening,.wgRowsClosing{animation:none}.wgBranch{transition:none};
|
||||
.wgFlowerArt{animation:none}.wgRowsOpening,.wgRowsClosing{animation:none}.wgBranch{transition:none};
|
||||
}
|
||||
|
||||
/* Animated disclosure body (RowGroup): 0fr ↔ 1fr interpolates the row box
|
||||
|
|
|
|||
Loading…
Reference in New Issue