@ai-setting/roy-plugin-task-show 2.1.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,11 +56,17 @@
56
56
  const DEFAULT_ID_PREFIX = "mmr";
57
57
  // v2.0.8 (feat/mermaid-zoom): zoom-in / zoom-out step and
58
58
  // sanity bounds. We default to 10% per click (matching the
59
- // common browser zoom UX) and clamp to a range that keeps the
60
- // diagram readable on both directions.
59
+ // common browser zoom UX) and clamp to a minimum that keeps
60
+ // the diagram visible (going below 0.25× renders a black
61
+ // screen and is not useful).
62
+ //
63
+ // v2.3.0 (feat/task-show-v230-worktree-zoom): the upper bound
64
+ // (formerly `ZOOM_MAX = 3.0`) was REMOVED. Users asked for
65
+ // unbounded zoom-in so dense Mermaid diagrams stay readable on
66
+ // high-DPI screens. There is no upper cap now — `clampZoom(z)`
67
+ // only enforces `z >= ZOOM_MIN`.
61
68
  const DEFAULT_ZOOM_STEP = 0.1;
62
69
  const ZOOM_MIN = 0.25;
63
- const ZOOM_MAX = 3.0;
64
70
  const ZOOM_DEFAULT = 1.0;
65
71
 
66
72
  function escapeHtml(s) {
@@ -154,7 +160,7 @@
154
160
  // independent of the rendering state. Keyed by the same
155
161
  // container reference so that re-rendering a diagram does
156
162
  // not reset the user's zoom level.
157
- const zoomState = new WeakMap(); // container -> number (0.25..3.0)
163
+ const zoomState = new WeakMap(); // container -> number (>=0.25, no upper cap in v2.3.0+)
158
164
 
159
165
  function nextSeq(container) {
160
166
  const cur = seq.get(container) || 0;
@@ -201,8 +207,12 @@
201
207
 
202
208
  function clampZoom(z) {
203
209
  if (!Number.isFinite(z)) return ZOOM_DEFAULT;
210
+ // v2.3.0: only enforce the lower bound. The upper bound was
211
+ // removed so zoom-in can grow unboundedly (see the
212
+ // v2.0.8 / v2.3.0 history comment near the ZOOM_MIN
213
+ // constant above). zoom-out at >= ZOOM_MIN stays useful;
214
+ // anything below renders a black screen and is rejected.
204
215
  if (z < ZOOM_MIN) return ZOOM_MIN;
205
- if (z > ZOOM_MAX) return ZOOM_MAX;
206
216
  return z;
207
217
  }
208
218
 
package/public/style.css CHANGED
@@ -15,6 +15,14 @@
15
15
  --code-bg: #0f172a;
16
16
  --border: #1e293b;
17
17
  --link: #38bdf8;
18
+ /* v2.3.0: mermaid 占位倍数 (Task #2771).
19
+ --mermaid-base-width / --mermaid-base-height 是 mermaid SVG
20
+ 默认 viewBox 尺寸。乘以 --mermaid-placeholder-multiplier 后
21
+ 得到 .mermaid / .mermaid-zoom-stage 的 min-*。
22
+ 直接改这三个变量就能调节占位大小,无需碰 rule。 */
23
+ --mermaid-base-width: 1280px;
24
+ --mermaid-base-height: 480px;
25
+ --mermaid-placeholder-multiplier: 5;
18
26
  }
19
27
 
20
28
  * {
@@ -337,6 +345,13 @@ table.toolcalls tr.tool-row.highlight:hover {
337
345
  padding: 14px;
338
346
  color: #0f172a;
339
347
  overflow-x: auto;
348
+ /* v2.3.0: placeholder 至少扩大到原来的 5 倍 (Task #2771).
349
+ Base = mermaid SVG 默认 viewBox 高度 (≈480px) × multiplier (5) = 2400px。
350
+ 设为 min-height 而不是 height,避免 zoom in 后被裁剪。
351
+ 通过 :root 自定义属性调节,详见 --mermaid-* 变量定义。 */
352
+ min-height: calc(
353
+ var(--mermaid-base-height) * var(--mermaid-placeholder-multiplier)
354
+ );
340
355
  }
341
356
 
342
357
  /* v0.6.11: error fallback when Mermaid rendering fails (or Mermaid library
@@ -440,6 +455,17 @@ table.toolcalls tr.tool-row.highlight:hover {
440
455
  /* Allow the zoomed content to overflow horizontally; the
441
456
  surrounding container will get its own scroll bar if needed. */
442
457
  max-width: 100%;
458
+ /* v2.3.0: placeholder 至少扩大到原来的 5 倍 (Task #2771).
459
+ min-width = 1280px × multiplier (5) = 6400px(zoom in 后能装下更大画布)
460
+ min-height = 480px × multiplier (5) = 2400px
461
+ 用 min-* 而不是 *:避免实际内容 < 占位时被压缩。
462
+ 通过 :root 自定义属性调节,详见 --mermaid-* 变量定义。 */
463
+ min-width: calc(
464
+ var(--mermaid-base-width) * var(--mermaid-placeholder-multiplier)
465
+ );
466
+ min-height: calc(
467
+ var(--mermaid-base-height) * var(--mermaid-placeholder-multiplier)
468
+ );
443
469
  }
444
470
 
445
471
  .hint {
@@ -1272,6 +1298,56 @@ details summary {
1272
1298
  border-radius: 8px;
1273
1299
  background: rgba(24, 36, 66, 0.45);
1274
1300
  }
1301
+ /* v2.2.0+: tree indentation for session-row based on data-depth.
1302
+ Depth 0 = session root task; depth 1+ = children of ancestors
1303
+ pulled in via the session-scope ancestor walk. Each level gets
1304
+ a left border + padding so the hierarchy reads as a tree. */
1305
+ .session-row[data-depth="0"] {
1306
+ border-left: 3px solid var(--accent, #6ec1ff);
1307
+ margin-left: 0;
1308
+ }
1309
+ .session-row[data-depth="1"] {
1310
+ border-left: 3px solid var(--accent-soft, #4a8ec0);
1311
+ margin-left: 1.5rem;
1312
+ }
1313
+ .session-row[data-depth="2"] {
1314
+ border-left: 3px solid var(--accent-softer, #2e6080);
1315
+ margin-left: 3rem;
1316
+ }
1317
+ .session-row[data-depth="3"] {
1318
+ border-left: 3px solid var(--border);
1319
+ margin-left: 4.5rem;
1320
+ }
1321
+ .session-row[data-depth="4"],
1322
+ .session-row[data-depth="5"],
1323
+ .session-row[data-depth="6"] {
1324
+ border-left: 3px solid var(--border);
1325
+ margin-left: 6rem;
1326
+ }
1327
+ /* Subtree container — nested ul that holds children of a session row */
1328
+ .session-forest > ul > li > ul {
1329
+ list-style: none;
1330
+ margin: 6px 0 0;
1331
+ padding: 0;
1332
+ border-left: 1px dashed var(--border);
1333
+ margin-left: 0.75rem;
1334
+ padding-left: 0.75rem;
1335
+ }
1336
+ /* v2.2.0+: nested children container — gives each subtree a dashed
1337
+ vertical rail so the hierarchy reads as a tree */
1338
+ .session-children {
1339
+ list-style: none;
1340
+ margin: 8px 0 0 1.25rem;
1341
+ padding: 0 0 0 0.75rem;
1342
+ border-left: 1px dashed var(--border);
1343
+ }
1344
+ .session-children > .session-row {
1345
+ margin-top: 6px;
1346
+ }
1347
+ .session-row[data-leaf="1"] {
1348
+ outline: 2px solid var(--accent, #6ec1ff);
1349
+ outline-offset: -2px;
1350
+ }
1275
1351
  .session-row .session-title {
1276
1352
  display: inline-block;
1277
1353
  font-weight: 600;