@agent-native/core 0.43.0 → 0.44.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.
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +71 -10
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.js +1 -1
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +2 -13
- package/dist/cli/recap.js.map +1 -1
- package/dist/cli/skills.d.ts +2 -2
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +13 -13
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +76 -18
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/blocks/index.d.ts +0 -2
- package/dist/client/blocks/index.d.ts.map +1 -1
- package/dist/client/blocks/index.js +0 -2
- package/dist/client/blocks/index.js.map +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.js +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -1
- package/dist/client/blocks/library/ApiEndpointBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/ApiEndpointBlock.js +1 -1
- package/dist/client/blocks/library/ApiEndpointBlock.js.map +1 -1
- package/dist/client/blocks/library/DiffBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/DiffBlock.js +68 -24
- package/dist/client/blocks/library/DiffBlock.js.map +1 -1
- package/dist/client/blocks/library/FileTreeBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/FileTreeBlock.js +4 -0
- package/dist/client/blocks/library/FileTreeBlock.js.map +1 -1
- package/dist/client/blocks/library/annotation-rail.d.ts +0 -19
- package/dist/client/blocks/library/annotation-rail.d.ts.map +1 -1
- package/dist/client/blocks/library/annotation-rail.js +0 -19
- package/dist/client/blocks/library/annotation-rail.js.map +1 -1
- package/dist/client/blocks/library/code-tabs.js +1 -1
- package/dist/client/blocks/library/code-tabs.js.map +1 -1
- package/dist/client/blocks/library/server-specs.d.ts.map +1 -1
- package/dist/client/blocks/library/server-specs.js +0 -10
- package/dist/client/blocks/library/server-specs.js.map +1 -1
- package/dist/client/blocks/library/specs.d.ts.map +1 -1
- package/dist/client/blocks/library/specs.js +0 -2
- package/dist/client/blocks/library/specs.js.map +1 -1
- package/dist/client/blocks/library/wireframe.config.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe.config.js +19 -2
- package/dist/client/blocks/library/wireframe.config.js.map +1 -1
- package/dist/client/blocks/mdx.d.ts.map +1 -1
- package/dist/client/blocks/mdx.js +11 -0
- package/dist/client/blocks/mdx.js.map +1 -1
- package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/DragHandle.js +35 -72
- package/dist/client/rich-markdown-editor/DragHandle.js.map +1 -1
- package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/RegistryBlockNode.js +1 -1
- package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +1 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +9 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.js +3 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -1
- package/dist/client/rich-markdown-editor/extensions.d.ts +13 -1
- package/dist/client/rich-markdown-editor/extensions.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/extensions.js +4 -2
- package/dist/client/rich-markdown-editor/extensions.js.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js +11 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +30 -14
- package/dist/server/poll.js.map +1 -1
- package/dist/styles/blocks.css +10 -2
- package/dist/templates/default/.agents/skills/storing-data/SKILL.md +2 -0
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +141 -0
- package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +2 -0
- package/package.json +1 -1
- package/src/templates/default/.agents/skills/storing-data/SKILL.md +2 -0
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +141 -0
- package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +2 -0
- package/dist/client/blocks/library/decision.config.d.ts +0 -37
- package/dist/client/blocks/library/decision.config.d.ts.map +0 -1
- package/dist/client/blocks/library/decision.config.js +0 -32
- package/dist/client/blocks/library/decision.config.js.map +0 -1
- package/dist/client/blocks/library/decision.d.ts +0 -19
- package/dist/client/blocks/library/decision.d.ts.map +0 -1
- package/dist/client/blocks/library/decision.js +0 -119
- package/dist/client/blocks/library/decision.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
3
3
|
import { IconChevronRight, IconColumns, IconDotsVertical, IconFileDiff, IconList, IconPlus, IconTrash, } from "@tabler/icons-react";
|
|
4
4
|
import { common, createLowlight } from "lowlight";
|
|
5
5
|
import { cn } from "../../utils.js";
|
|
6
|
-
import { AnnotationGutterMarker,
|
|
6
|
+
import { AnnotationGutterMarker, buildLineMarkerMap, hasRailAnnotations, rangeLabel, resolveAnnotations, } from "./annotation-rail.js";
|
|
7
7
|
import { DevInput, DevLabel, DevTextarea, DevSelect } from "./dev-doc-ui.js";
|
|
8
8
|
/**
|
|
9
9
|
* Split text into lines, each KEEPING its trailing newline (so the change
|
|
@@ -440,14 +440,56 @@ function DiffRead({ data, blockId, title, summary, ctx, }) {
|
|
|
440
440
|
? beforeLineCount
|
|
441
441
|
: afterLineCount), [data.annotations, beforeLineCount, afterLineCount]);
|
|
442
442
|
const hasAnnotations = hasRailAnnotations(resolved);
|
|
443
|
-
// Effective render mode.
|
|
444
|
-
//
|
|
445
|
-
//
|
|
446
|
-
//
|
|
447
|
-
// hidden whenever split is unavailable.
|
|
443
|
+
// Effective render mode. The right-margin popover works in both unified and
|
|
444
|
+
// split, so annotations no longer force a mode; only a container narrower than
|
|
445
|
+
// SPLIT_MIN_WIDTH falls back to unified so split's doubled gutters never crush
|
|
446
|
+
// the code. `canSplit` also gates the mode toggle (hidden when unavailable).
|
|
448
447
|
const narrow = containerWidth != null && containerWidth < SPLIT_MIN_WIDTH;
|
|
449
|
-
const canSplit = !
|
|
448
|
+
const canSplit = !narrow;
|
|
450
449
|
const effectiveMode = canSplit ? mode : "unified";
|
|
450
|
+
// Annotation popover (diff): a marked line shows its note as a hover popover
|
|
451
|
+
// pinned in the diff's right margin and aligned to that line — no inline notes
|
|
452
|
+
// and no permanent side rail, so the code keeps its full width. A short
|
|
453
|
+
// hover-intent delay lets the pointer travel from the line into the popover.
|
|
454
|
+
const clearTimer = useRef(null);
|
|
455
|
+
const handleActiveChange = useCallback((index) => {
|
|
456
|
+
if (clearTimer.current) {
|
|
457
|
+
clearTimeout(clearTimer.current);
|
|
458
|
+
clearTimer.current = null;
|
|
459
|
+
}
|
|
460
|
+
if (index == null) {
|
|
461
|
+
clearTimer.current = setTimeout(() => setActiveIndex(null), 120);
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
setActiveIndex(index);
|
|
465
|
+
}
|
|
466
|
+
}, []);
|
|
467
|
+
useEffect(() => () => {
|
|
468
|
+
if (clearTimer.current)
|
|
469
|
+
clearTimeout(clearTimer.current);
|
|
470
|
+
}, []);
|
|
471
|
+
const activeAnnotation = activeIndex == null
|
|
472
|
+
? null
|
|
473
|
+
: (resolved.find((r) => r.index === activeIndex && r.range) ?? null);
|
|
474
|
+
// Vertical center of the active marker's anchor row within the section, so the
|
|
475
|
+
// popover sits beside that line. Rows are in page flow (no inner vertical
|
|
476
|
+
// scroll), so a DOM measure on activeIndex change is stable.
|
|
477
|
+
const [popoverTop, setPopoverTop] = useState(null);
|
|
478
|
+
useLayoutEffect(() => {
|
|
479
|
+
const host = containerRef.current;
|
|
480
|
+
if (activeIndex == null || !host) {
|
|
481
|
+
setPopoverTop(null);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const rowEl = host.querySelector(`[data-annot-row="${activeIndex}"]`);
|
|
485
|
+
if (!rowEl) {
|
|
486
|
+
setPopoverTop(null);
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
const hostRect = host.getBoundingClientRect();
|
|
490
|
+
const rowRect = rowEl.getBoundingClientRect();
|
|
491
|
+
setPopoverTop(rowRect.top - hostRect.top + rowRect.height / 2);
|
|
492
|
+
}, [activeIndex, containerRef]);
|
|
451
493
|
// Side-scoped line → markers maps so a row only lights from its own side.
|
|
452
494
|
const beforeMarkers = useMemo(() => buildLineMarkerMap(resolved.filter((r) => annotationSide(r.annotation) === "before")), [resolved]);
|
|
453
495
|
const afterMarkers = useMemo(() => buildLineMarkerMap(resolved.filter((r) => annotationSide(r.annotation) !== "before")), [resolved]);
|
|
@@ -503,9 +545,9 @@ function DiffRead({ data, blockId, title, summary, ctx, }) {
|
|
|
503
545
|
next.add(index);
|
|
504
546
|
return next;
|
|
505
547
|
});
|
|
506
|
-
return (_jsxs("section", { ref: containerRef, className: "plan-block group/diff-block", "data-block-id": blockId, children: [title && _jsx("div", { className: "plan-block-label", children: title }), summary && (_jsx("p", { className: "mb-3 text-sm leading-relaxed text-plan-muted", children: summary })), _jsxs("div", { className: "overflow-hidden rounded-md border border-border bg-background", children: [_jsxs("div", { className: "flex min-h-10 flex-wrap items-center gap-2 border-b border-border bg-muted/60 px-3 py-1.5", children: [_jsx(IconFileDiff, { className: "size-4 shrink-0 text-muted-foreground" }), _jsxs("span", { className: "flex min-w-0 flex-1 items-baseline gap-1.5 font-mono", title: data.filename || undefined, children: [_jsx("span", { className: "min-w-0 max-w-[16rem] truncate text-[13px] font-semibold leading-5 text-foreground", children: fileParts.basename }), fileParts.directory && (_jsx("span", { className: "min-w-0 flex-1 truncate text-[11px] leading-5 text-muted-foreground/70", children: fileParts.directory }))] }), _jsxs("span", { className: "ml-1 flex shrink-0 items-center gap-2 font-mono text-xs", children: [_jsxs("span", { className: "text-emerald-700 dark:text-emerald-300", children: ["+", added] }), _jsxs("span", { className: "text-destructive", children: ["\u2212", removed] })] }), canSplit && (_jsxs("div", { className: "pointer-events-none ml-auto flex shrink-0 items-center overflow-hidden rounded-md border border-border bg-background opacity-0 transition-opacity group-hover/diff-block:pointer-events-auto group-hover/diff-block:opacity-100 group-focus-within/diff-block:pointer-events-auto group-focus-within/diff-block:opacity-100", children: [_jsx(ModeButton, { active: mode === "unified", onClick: () => setMode("unified"), icon: _jsx(IconList, { className: "size-3.5" }), label: "Unified" }), _jsx(ModeButton, { active: mode === "split", onClick: () => setMode("split"), icon: _jsx(IconColumns, { className: "size-3.5" }), label: "Split" })] }))] }), unchanged ? (_jsx("div", { className: "px-4 py-6 text-center font-mono text-sm text-muted-foreground", children: "No changes" })) : effectiveMode === "split" ? (_jsx(SplitView, { rows: rows, language: language, rowLimit: rowLimit, markersForRow: markersForRow, activeIndex: activeIndex, onActiveChange:
|
|
548
|
+
return (_jsxs("section", { ref: containerRef, className: "relative plan-block group/diff-block", "data-block-id": blockId, children: [title && _jsx("div", { className: "plan-block-label", children: title }), summary && (_jsx("p", { className: "mb-3 text-sm leading-relaxed text-plan-muted", children: summary })), _jsxs("div", { className: "overflow-hidden rounded-md border border-border bg-background", children: [_jsxs("div", { className: "flex min-h-10 flex-wrap items-center gap-2 border-b border-border bg-muted/60 px-3 py-1.5", children: [_jsx(IconFileDiff, { className: "size-4 shrink-0 text-muted-foreground" }), _jsxs("span", { className: "flex min-w-0 flex-1 items-baseline gap-1.5 font-mono", title: data.filename || undefined, children: [_jsx("span", { className: "min-w-0 max-w-[16rem] truncate text-[13px] font-semibold leading-5 text-foreground", children: fileParts.basename }), fileParts.directory && (_jsx("span", { className: "min-w-0 flex-1 truncate text-[11px] leading-5 text-muted-foreground/70", children: fileParts.directory }))] }), _jsxs("span", { className: "ml-1 flex shrink-0 items-center gap-2 font-mono text-xs", children: [_jsxs("span", { className: "text-emerald-700 dark:text-emerald-300", children: ["+", added] }), _jsxs("span", { className: "text-destructive", children: ["\u2212", removed] })] }), canSplit && (_jsxs("div", { className: "pointer-events-none ml-auto flex shrink-0 items-center overflow-hidden rounded-md border border-border bg-background opacity-0 transition-opacity group-hover/diff-block:pointer-events-auto group-hover/diff-block:opacity-100 group-focus-within/diff-block:pointer-events-auto group-focus-within/diff-block:opacity-100", children: [_jsx(ModeButton, { active: mode === "unified", onClick: () => setMode("unified"), icon: _jsx(IconList, { className: "size-3.5" }), label: "Unified" }), _jsx(ModeButton, { active: mode === "split", onClick: () => setMode("split"), icon: _jsx(IconColumns, { className: "size-3.5" }), label: "Split" })] }))] }), unchanged ? (_jsx("div", { className: "px-4 py-6 text-center font-mono text-sm text-muted-foreground", children: "No changes" })) : effectiveMode === "split" ? (_jsx(SplitView, { rows: rows, language: language, rowLimit: rowLimit, markersForRow: markersForRow, activeIndex: activeIndex, onActiveChange: handleActiveChange })) : (_jsx(UnifiedView, { rows: displayedRows, language: language, expanded: expanded, onToggleRun: toggleRun, markersForRow: markersForRow, anchoredRow: anchoredRow, activeIndex: activeIndex, onActiveChange: handleActiveChange })), !unchanged && shouldLimitRows && (_jsxs("button", { type: "button", "data-plan-interactive": true, "aria-expanded": showAllRows, onClick: () => setShowAllRows((current) => !current), className: "flex h-7 w-full items-center justify-center gap-1.5 border-t border-border bg-background px-2 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground", children: [_jsx(IconChevronRight, { className: cn("size-3 shrink-0 transition-transform", showAllRows ? "-rotate-90" : "rotate-90") }), showAllRows
|
|
507
549
|
? "Show fewer"
|
|
508
|
-
: `Show all ${totalVisibleLineCount} lines`] }))] })] }));
|
|
550
|
+
: `Show all ${totalVisibleLineCount} lines`] }))] }), activeAnnotation && popoverTop != null && (_jsx(AnnotationPopover, { item: activeAnnotation, top: popoverTop, onActiveChange: handleActiveChange, ctx: ctx }))] }));
|
|
509
551
|
}
|
|
510
552
|
function ModeButton({ active, onClick, icon, label, }) {
|
|
511
553
|
return (_jsxs("button", { type: "button", "data-plan-interactive": true, onClick: onClick, "aria-pressed": active, className: cn("flex cursor-pointer items-center gap-1 px-2 py-1 text-xs font-medium transition-colors", active
|
|
@@ -545,7 +587,7 @@ function isMarkerRangeStart(row, marker) {
|
|
|
545
587
|
return lineNo === marker.range.start;
|
|
546
588
|
}
|
|
547
589
|
/* ── Unified view ──────────────────────────────────────────────────────────── */
|
|
548
|
-
function UnifiedView({ rows, language, expanded, onToggleRun, markersForRow, anchoredRow, activeIndex, onActiveChange,
|
|
590
|
+
function UnifiedView({ rows, language, expanded, onToggleRun, markersForRow, anchoredRow, activeIndex, onActiveChange, }) {
|
|
549
591
|
const segments = useMemo(() => segmentRows(rows, anchoredRow), [rows, anchoredRow]);
|
|
550
592
|
// Any annotation present ⇒ reserve the marker column so rows stay aligned.
|
|
551
593
|
const showMarkerColumn = useMemo(() => rows.some((row) => markersForRow(row).length > 0), [rows, markersForRow]);
|
|
@@ -556,30 +598,22 @@ function UnifiedView({ rows, language, expanded, onToggleRun, markersForRow, anc
|
|
|
556
598
|
onActiveChange,
|
|
557
599
|
showMarkerColumn,
|
|
558
600
|
};
|
|
559
|
-
// A diff row plus any notes anchored to it: each annotation renders ONE
|
|
560
|
-
// full-width inline note directly under the FIRST line of its range (matched
|
|
561
|
-
// by `isMarkerRangeStart`), so the row's numbered pip and its note read as a
|
|
562
|
-
// single GitHub-style unit and the note never repeats down a multi-line span.
|
|
563
|
-
const renderRow = (row, key) => {
|
|
564
|
-
const notes = markersForRow(row).filter((marker) => isMarkerRangeStart(row, marker));
|
|
565
|
-
return (_jsxs("div", { children: [_jsx(UnifiedRow, { row: row, ...rowProps }), notes.map((item) => (_jsx(InlineAnnotationNote, { item: item, active: item.index === activeIndex, onActiveChange: onActiveChange, ctx: ctx }, `note-${item.index}`)))] }, key));
|
|
566
|
-
};
|
|
567
601
|
let runIndex = 0;
|
|
568
602
|
return (_jsx("div", { className: "overflow-x-auto", children: _jsx("div", { className: "w-max min-w-full font-mono [font-size:var(--plan-code-size)] leading-5", children: segments.map((segment, idx) => {
|
|
569
603
|
if ("collapsed" in segment) {
|
|
570
604
|
const key = runIndex++;
|
|
571
605
|
const open = expanded.has(key);
|
|
572
606
|
return (_jsxs("div", { children: [_jsx(CollapsedRow, { count: segment.rows.length, open: open, onClick: () => onToggleRun(key) }), open &&
|
|
573
|
-
segment.rows.map((row, ri) =>
|
|
607
|
+
segment.rows.map((row, ri) => (_jsx(UnifiedRow, { row: row, ...rowProps }, `run-${key}-${ri}`)))] }, `run-${key}`));
|
|
574
608
|
}
|
|
575
|
-
return
|
|
609
|
+
return _jsx(UnifiedRow, { row: segment, ...rowProps }, idx);
|
|
576
610
|
}) }) }));
|
|
577
611
|
}
|
|
578
612
|
function UnifiedRow({ language, row, markersForRow, activeIndex, onActiveChange, showMarkerColumn, }) {
|
|
579
613
|
const markers = markersForRow(row);
|
|
580
614
|
const info = rowMarkerInfo(markers, activeIndex);
|
|
581
615
|
const startMarker = markers.find((marker) => isMarkerRangeStart(row, marker));
|
|
582
|
-
return (_jsxs("div", { className: cn("flex min-h-5 min-w-full", ROW_BG[row.kind], annotatedRowBg(info)), onMouseEnter: info ? () => onActiveChange(info.primaryIndex) : undefined, onMouseLeave: info ? () => onActiveChange(null) : undefined, children: [_jsx("span", { className: cn(LINE_NO_CLASS, "w-[52px]"), children: row.oldNo ?? "" }), _jsx("span", { className: cn(LINE_NO_CLASS, "w-[52px]"), children: row.newNo ?? "" }), _jsx("span", { className: cn("w-6 shrink-0 select-none py-0 text-center font-semibold leading-5", GUTTER_BG[row.kind], SIGN_COLOR[row.kind]), children: SIGN[row.kind] }), showMarkerColumn && (_jsx(MarkerCell, { startMarker: startMarker, active: startMarker != null && startMarker.index === activeIndex })), _jsx(DiffLineText, { text: row.text, language: language })] }));
|
|
616
|
+
return (_jsxs("div", { "data-annot-row": startMarker ? startMarker.index : undefined, className: cn("flex min-h-5 min-w-full", ROW_BG[row.kind], annotatedRowBg(info)), onMouseEnter: info ? () => onActiveChange(info.primaryIndex) : undefined, onMouseLeave: info ? () => onActiveChange(null) : undefined, children: [_jsx("span", { className: cn(LINE_NO_CLASS, "w-[52px]"), children: row.oldNo ?? "" }), _jsx("span", { className: cn(LINE_NO_CLASS, "w-[52px]"), children: row.newNo ?? "" }), _jsx("span", { className: cn("w-6 shrink-0 select-none py-0 text-center font-semibold leading-5", GUTTER_BG[row.kind], SIGN_COLOR[row.kind]), children: SIGN[row.kind] }), showMarkerColumn && (_jsx(MarkerCell, { startMarker: startMarker, active: startMarker != null && startMarker.index === activeIndex })), _jsx(DiffLineText, { text: row.text, language: language })] }));
|
|
583
617
|
}
|
|
584
618
|
/**
|
|
585
619
|
* The fixed-width marker column rendered between the sign gutter and the code.
|
|
@@ -591,6 +625,16 @@ function UnifiedRow({ language, row, markersForRow, activeIndex, onActiveChange,
|
|
|
591
625
|
function MarkerCell({ startMarker, active, }) {
|
|
592
626
|
return (_jsx("span", { className: "flex w-6 shrink-0 select-none items-center justify-center py-0", children: startMarker != null && (_jsx(AnnotationGutterMarker, { marker: startMarker.marker, active: active })) }));
|
|
593
627
|
}
|
|
628
|
+
/**
|
|
629
|
+
* The hover popover for a diff annotation, pinned in the diff's right margin and
|
|
630
|
+
* vertically centered on the annotated line (`top` is measured by the caller).
|
|
631
|
+
* It shows the marker pip, line range, optional label, and the markdown note —
|
|
632
|
+
* beside the code instead of interrupting the diff flow — and keeps the
|
|
633
|
+
* annotation active while hovered so the pointer can travel from line to note.
|
|
634
|
+
*/
|
|
635
|
+
function AnnotationPopover({ item, top, onActiveChange, ctx, }) {
|
|
636
|
+
return (_jsxs("div", { role: "tooltip", style: { top }, onMouseEnter: () => onActiveChange(item.index), onMouseLeave: () => onActiveChange(null), className: "absolute right-2 z-20 w-[min(17rem,calc(100%-3rem))] -translate-y-1/2 rounded-lg border border-amber-400/70 bg-background px-3 py-2.5 shadow-xl dark:border-amber-300/45", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-0.5", children: [_jsx(AnnotationGutterMarker, { marker: item.marker, active: true }), _jsx("span", { className: "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: rangeLabel(item) }), item.annotation.label && (_jsx("span", { className: "text-[13px] font-semibold text-foreground", children: item.annotation.label }))] }), _jsx("div", { className: "plan-annotation-note mt-1 text-[13px] leading-relaxed text-foreground/85", children: ctx.renderMarkdown ? (ctx.renderMarkdown(item.annotation.note)) : (_jsx("p", { children: item.annotation.note })) })] }));
|
|
637
|
+
}
|
|
594
638
|
function CollapsedRow({ count, open, onClick, }) {
|
|
595
639
|
return (_jsxs("button", { type: "button", "data-plan-interactive": true, onClick: onClick, className: "flex w-full cursor-pointer items-center gap-2 border-y border-border bg-muted/70 px-3 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", children: [_jsx(IconDotsVertical, { className: "size-3.5 shrink-0" }), _jsxs("span", { children: [open ? "Hide" : "Show", " ", count, " unchanged line", count === 1 ? "" : "s"] })] }));
|
|
596
640
|
}
|
|
@@ -641,10 +685,10 @@ function SplitCell({ language, row, side, markersForRow, activeIndex, onActiveCh
|
|
|
641
685
|
const markers = markersForRow(row, side);
|
|
642
686
|
const info = rowMarkerInfo(markers, activeIndex);
|
|
643
687
|
const startMarker = markers.find((marker) => isMarkerRangeStart(row, marker));
|
|
644
|
-
return (_jsxs("div", { className: cn("flex min-h-5 min-w-full", ROW_BG[row.kind], annotatedRowBg(info)), onMouseEnter: info ? () => onActiveChange(info.primaryIndex) : undefined, onMouseLeave: info ? () => onActiveChange(null) : undefined, children: [_jsx("span", { className: cn(LINE_NO_CLASS, "w-[52px]"), children: side === "old" ? (row.oldNo ?? "") : (row.newNo ?? "") }), _jsx("span", { className: cn("w-6 shrink-0 select-none py-0 text-center font-semibold leading-5", GUTTER_BG[row.kind], SIGN_COLOR[row.kind]), children: showSign ? sign : " " }), showMarkerColumn && (_jsx(MarkerCell, { startMarker: startMarker, active: startMarker != null && startMarker.index === activeIndex })), _jsx(DiffLineText, { text: row.text, language: language })] }));
|
|
688
|
+
return (_jsxs("div", { "data-annot-row": startMarker ? startMarker.index : undefined, className: cn("flex min-h-5 min-w-full", ROW_BG[row.kind], annotatedRowBg(info)), onMouseEnter: info ? () => onActiveChange(info.primaryIndex) : undefined, onMouseLeave: info ? () => onActiveChange(null) : undefined, children: [_jsx("span", { className: cn(LINE_NO_CLASS, "w-[52px]"), children: side === "old" ? (row.oldNo ?? "") : (row.newNo ?? "") }), _jsx("span", { className: cn("w-6 shrink-0 select-none py-0 text-center font-semibold leading-5", GUTTER_BG[row.kind], SIGN_COLOR[row.kind]), children: showSign ? sign : " " }), showMarkerColumn && (_jsx(MarkerCell, { startMarker: startMarker, active: startMarker != null && startMarker.index === activeIndex })), _jsx(DiffLineText, { text: row.text, language: language })] }));
|
|
645
689
|
}
|
|
646
690
|
/* ── Edit (panel) ──────────────────────────────────────────────────────────── */
|
|
647
|
-
const codeAreaClass = "min-h-[140px] font-mono
|
|
691
|
+
const codeAreaClass = "min-h-[140px] font-mono [font-size:var(--plan-code-size)] leading-5";
|
|
648
692
|
function DiffEdit({ data, onChange, editable }) {
|
|
649
693
|
const patch = (next) => onChange({ ...data, ...next });
|
|
650
694
|
const mode = data.mode ?? "unified";
|