@agy-daddy/plugin-chat-nav 1.1.0 → 1.1.2
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/README.md +109 -1
- package/agy-plugin.json +122 -20
- package/locales/en.json +8 -1
- package/locales/zh-CN.json +8 -1
- package/package.json +1 -1
- package/settings.schema.json +42 -0
- package/src/code-block-enhancer.js +664 -0
- package/src/node.js +26 -1
- package/src/outline-rail.js +599 -0
- package/src/renderer.js +115 -6
- package/src/styles.js +341 -0
package/src/renderer.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { CHAT_NAV_STYLES } = require('./styles');
|
|
4
|
+
const { createCodeBlockEnhancer } = require('./code-block-enhancer');
|
|
5
|
+
const { isEditableElement, createOutlineRail } = require('./outline-rail');
|
|
4
6
|
|
|
5
7
|
const DEFAULT_SETTINGS = Object.freeze({
|
|
6
8
|
showFloatDock: true,
|
|
7
9
|
keepThinkingExpanded: false,
|
|
8
10
|
enableInlineFileEditor: true,
|
|
9
11
|
enableCmdClickLinks: true,
|
|
12
|
+
enableCodeBlockSticky: true,
|
|
13
|
+
enableCodeBlockFold: true,
|
|
14
|
+
codeFoldMinLines: 48,
|
|
15
|
+
showOutlineRail: true,
|
|
16
|
+
enableTurnShortcuts: true,
|
|
10
17
|
searchRegexMode: false,
|
|
11
18
|
searchCaseSensitive: false,
|
|
12
19
|
exportSaveBehavior: 'dialog',
|
|
@@ -41,6 +48,12 @@ function normalizeRendererSettings(raw = {}) {
|
|
|
41
48
|
...DEFAULT_SETTINGS,
|
|
42
49
|
...(raw && typeof raw === 'object' ? raw : {})
|
|
43
50
|
};
|
|
51
|
+
const minLines = Number(merged.codeFoldMinLines);
|
|
52
|
+
merged.codeFoldMinLines = Number.isFinite(minLines) && minLines >= 12 ? Math.min(500, Math.round(minLines)) : 48;
|
|
53
|
+
merged.enableCodeBlockSticky = merged.enableCodeBlockSticky !== false;
|
|
54
|
+
merged.enableCodeBlockFold = merged.enableCodeBlockFold !== false;
|
|
55
|
+
merged.showOutlineRail = merged.showOutlineRail !== false;
|
|
56
|
+
merged.enableTurnShortcuts = merged.enableTurnShortcuts !== false;
|
|
44
57
|
merged.exportSaveBehavior = merged.exportSaveBehavior === 'direct' ? 'direct' : 'dialog';
|
|
45
58
|
merged.exportSaveDir = typeof merged.exportSaveDir === 'string' ? merged.exportSaveDir.trim() : '';
|
|
46
59
|
merged.exportFormats = normalizeExportFormats(merged.exportFormats);
|
|
@@ -173,6 +186,8 @@ async function mount(ctx, options = {}) {
|
|
|
173
186
|
let editorTextareaEl = null;
|
|
174
187
|
let activeEditorPath = '';
|
|
175
188
|
let activeConvIndex = 0;
|
|
189
|
+
let codeBlockEnhancer = null;
|
|
190
|
+
let outlineRail = null;
|
|
176
191
|
|
|
177
192
|
function clearNodes(list) {
|
|
178
193
|
while (list.length > 0) {
|
|
@@ -684,18 +699,21 @@ async function mount(ctx, options = {}) {
|
|
|
684
699
|
}
|
|
685
700
|
|
|
686
701
|
function syncDockDialogLayering() {
|
|
687
|
-
if (!dockEl) return false;
|
|
688
702
|
const open = hasOpenDialog();
|
|
689
|
-
dockEl
|
|
690
|
-
|
|
691
|
-
|
|
703
|
+
if (dockEl) {
|
|
704
|
+
dockEl.setAttribute?.('data-under-dialog', open ? 'true' : 'false');
|
|
705
|
+
if (open && exportMenuOpen) {
|
|
706
|
+
setExportMenuOpen(false);
|
|
707
|
+
}
|
|
692
708
|
}
|
|
709
|
+
outlineRail?.syncPosition?.();
|
|
693
710
|
return open;
|
|
694
711
|
}
|
|
695
712
|
|
|
696
713
|
function syncDockPosition() {
|
|
697
|
-
if (!dockEl) return false;
|
|
698
714
|
syncDockDialogLayering();
|
|
715
|
+
outlineRail?.syncPosition?.();
|
|
716
|
+
if (!dockEl) return false;
|
|
699
717
|
const areaEl = findChatAreaElement();
|
|
700
718
|
if (dockResizeObserver && areaEl && observedAreaEl !== areaEl) {
|
|
701
719
|
if (observedAreaEl) {
|
|
@@ -723,7 +741,7 @@ async function mount(ctx, options = {}) {
|
|
|
723
741
|
}
|
|
724
742
|
|
|
725
743
|
function scheduleSyncDockPosition() {
|
|
726
|
-
if (!dockEl || dockRafId !== null) return;
|
|
744
|
+
if ((!dockEl && !outlineRail) || dockRafId !== null) return;
|
|
727
745
|
const raf = (win && typeof win.requestAnimationFrame === 'function')
|
|
728
746
|
? win.requestAnimationFrame.bind(win)
|
|
729
747
|
: (typeof globalThis.requestAnimationFrame === 'function' ? globalThis.requestAnimationFrame : null);
|
|
@@ -1301,11 +1319,13 @@ async function mount(ctx, options = {}) {
|
|
|
1301
1319
|
}
|
|
1302
1320
|
lastTurnNav = { top: target, ts: now };
|
|
1303
1321
|
scrollViewportTo(vp, target);
|
|
1322
|
+
outlineRail?.syncActiveTurnFromScroll?.();
|
|
1304
1323
|
return true;
|
|
1305
1324
|
}
|
|
1306
1325
|
}
|
|
1307
1326
|
const cur = Number(vp.scrollTop || 0);
|
|
1308
1327
|
vp.scrollTop = Math.max(0, cur + delta * 360);
|
|
1328
|
+
outlineRail?.syncActiveTurnFromScroll?.();
|
|
1309
1329
|
return true;
|
|
1310
1330
|
}
|
|
1311
1331
|
|
|
@@ -1569,8 +1589,21 @@ async function mount(ctx, options = {}) {
|
|
|
1569
1589
|
return true;
|
|
1570
1590
|
}
|
|
1571
1591
|
|
|
1592
|
+
function isGroupFileRowWithoutViewerLabel(headerEl) {
|
|
1593
|
+
if (!headerEl) return false;
|
|
1594
|
+
const rawClass = typeof headerEl.className === 'string'
|
|
1595
|
+
? headerEl.className
|
|
1596
|
+
: String(headerEl.getAttribute?.('class') || '');
|
|
1597
|
+
const hasFileRowClass = Boolean(headerEl.classList?.contains?.('group/file-row'))
|
|
1598
|
+
|| rawClass.split(/\s+/).includes('group/file-row');
|
|
1599
|
+
if (!hasFileRowClass) return false;
|
|
1600
|
+
const ariaLabel = String(headerEl.getAttribute?.('aria-label') || '').trim();
|
|
1601
|
+
return !(/^file viewer header$/i.test(ariaLabel) || ariaLabel === '文件查看器标题栏');
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1572
1604
|
function attachFileEditorControl(headerEl) {
|
|
1573
1605
|
if (!settings.enableInlineFileEditor || !headerEl || !doc?.createElement) return;
|
|
1606
|
+
if (isGroupFileRowWithoutViewerLabel(headerEl)) return;
|
|
1574
1607
|
if (headerEl.querySelector?.('#agy-file-editor-controls')) return;
|
|
1575
1608
|
editorControlEl = doc.createElement('button');
|
|
1576
1609
|
editorControlEl.type = 'button';
|
|
@@ -1588,6 +1621,17 @@ async function mount(ctx, options = {}) {
|
|
|
1588
1621
|
|
|
1589
1622
|
const stopViewportObserver = ctx.anchors.observe('chat.scrollViewport', () => {
|
|
1590
1623
|
scheduleSyncDockPosition();
|
|
1624
|
+
codeBlockEnhancer?.scheduleRefresh?.();
|
|
1625
|
+
outlineRail?.refresh?.();
|
|
1626
|
+
});
|
|
1627
|
+
|
|
1628
|
+
const stopMessageListObserver = ctx.anchors.observe('chat.messageList', () => {
|
|
1629
|
+
codeBlockEnhancer?.scheduleRefresh?.();
|
|
1630
|
+
outlineRail?.refresh?.();
|
|
1631
|
+
});
|
|
1632
|
+
|
|
1633
|
+
const stopSendBtnObserver = ctx.anchors.observe('composer.sendButton', () => {
|
|
1634
|
+
codeBlockEnhancer?.scheduleRefresh?.();
|
|
1591
1635
|
});
|
|
1592
1636
|
|
|
1593
1637
|
const stopComposerObserver = ctx.anchors.observe('composer.root', () => {
|
|
@@ -1606,6 +1650,17 @@ async function mount(ctx, options = {}) {
|
|
|
1606
1650
|
setSearchOpen(false, { silent: true, reason: 'external-close' });
|
|
1607
1651
|
});
|
|
1608
1652
|
|
|
1653
|
+
const stopNavCmdSub = ctx.events?.on?.('chat-nav:command@1', (payload) => {
|
|
1654
|
+
const cmd = payload?.command;
|
|
1655
|
+
if (cmd === 'scroll-top') scrollTop();
|
|
1656
|
+
else if (cmd === 'scroll-bottom') scrollBottom();
|
|
1657
|
+
else if (cmd === 'expand-thinking') expandThinking();
|
|
1658
|
+
else if (cmd === 'turn-prev') stepTurn(-1);
|
|
1659
|
+
else if (cmd === 'turn-next') stepTurn(1);
|
|
1660
|
+
else if (cmd === 'toggle-outline') outlineRail?.setPopoverOpen?.(!outlineRail.isPopoverOpen());
|
|
1661
|
+
else if (cmd === 'collapse-long-code') codeBlockEnhancer?.toggleAllLongBlocks?.();
|
|
1662
|
+
});
|
|
1663
|
+
|
|
1609
1664
|
const stopContextSub = ctx.state?.subscribe?.('state:context.snapshot@1', (snap) => {
|
|
1610
1665
|
latestContextCascadeId = snap?.cascadeId ? String(snap.cascadeId) : null;
|
|
1611
1666
|
});
|
|
@@ -1620,6 +1675,23 @@ async function mount(ctx, options = {}) {
|
|
|
1620
1675
|
e.stopPropagation?.();
|
|
1621
1676
|
return;
|
|
1622
1677
|
}
|
|
1678
|
+
if (e.key === 'Escape' && outlineRail?.isPopoverOpen?.()) {
|
|
1679
|
+
outlineRail.setPopoverOpen(false);
|
|
1680
|
+
e.preventDefault?.();
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
if (settings.enableTurnShortcuts && e.altKey && !e.metaKey && !e.ctrlKey && !e.shiftKey) {
|
|
1684
|
+
const isUp = e.key === 'ArrowUp' || e.code === 'ArrowUp';
|
|
1685
|
+
const isDown = e.key === 'ArrowDown' || e.code === 'ArrowDown';
|
|
1686
|
+
if (isUp || isDown) {
|
|
1687
|
+
if (!hasOpenDialog() && !isEditableElement(e.target, doc)) {
|
|
1688
|
+
if (stepTurn(isUp ? -1 : 1)) {
|
|
1689
|
+
e.preventDefault?.();
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
return;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1623
1695
|
// 按住 ⌘(无其他修饰键)浮现左侧 1~9 序号角标
|
|
1624
1696
|
if ((e.key === 'Meta' || (e.metaKey && !e.key)) && !e.shiftKey && !e.ctrlKey && !e.altKey) {
|
|
1625
1697
|
showConvBadges();
|
|
@@ -1713,6 +1785,29 @@ async function mount(ctx, options = {}) {
|
|
|
1713
1785
|
|
|
1714
1786
|
ensureDock();
|
|
1715
1787
|
|
|
1788
|
+
outlineRail = createOutlineRail({
|
|
1789
|
+
doc,
|
|
1790
|
+
win,
|
|
1791
|
+
anchors: ctx.anchors,
|
|
1792
|
+
findChatAreaElement,
|
|
1793
|
+
hasOpenDialog,
|
|
1794
|
+
scrollViewportTo,
|
|
1795
|
+
getSettings: () => settings
|
|
1796
|
+
});
|
|
1797
|
+
|
|
1798
|
+
codeBlockEnhancer = createCodeBlockEnhancer({
|
|
1799
|
+
doc,
|
|
1800
|
+
win,
|
|
1801
|
+
anchors: ctx.anchors,
|
|
1802
|
+
hostDom: ctx.hostDom,
|
|
1803
|
+
copyText: copyTextToClipboard,
|
|
1804
|
+
showToast: showDockToast,
|
|
1805
|
+
getSettings: () => settings,
|
|
1806
|
+
onDomMutated: () => {
|
|
1807
|
+
outlineRail?.refresh?.();
|
|
1808
|
+
}
|
|
1809
|
+
});
|
|
1810
|
+
|
|
1716
1811
|
const stopSvc = ctx.services.provide('chat-nav', {
|
|
1717
1812
|
scrollTop,
|
|
1718
1813
|
scrollBottom,
|
|
@@ -1739,6 +1834,13 @@ async function mount(ctx, options = {}) {
|
|
|
1739
1834
|
exportAllConversations,
|
|
1740
1835
|
setExportMenuOpen,
|
|
1741
1836
|
getConfiguredExportFormats,
|
|
1837
|
+
refreshCodeBlocks: () => codeBlockEnhancer?.refresh?.() ?? 0,
|
|
1838
|
+
toggleAllLongCodeBlocks: (forceState) => codeBlockEnhancer?.toggleAllLongBlocks?.(forceState) ?? 0,
|
|
1839
|
+
setCodeBlockCollapsed: (preEl, collapsed) => codeBlockEnhancer?.setBlockCollapsed?.(preEl, collapsed) ?? false,
|
|
1840
|
+
refreshOutlineRail: () => outlineRail?.refresh?.() ?? [],
|
|
1841
|
+
setOutlineOpen: (open) => outlineRail?.setPopoverOpen?.(open) ?? false,
|
|
1842
|
+
setOutlineFilter: (mode) => outlineRail?.setFilterMode?.(mode),
|
|
1843
|
+
getOutlineItems: () => outlineRail?.getOutlineItems?.() ?? [],
|
|
1742
1844
|
getSettings: () => ({ ...settings }),
|
|
1743
1845
|
registerNavButton(def) {
|
|
1744
1846
|
if (!def?.id) throw new Error('registerNavButton requires id');
|
|
@@ -1754,6 +1856,8 @@ async function mount(ctx, options = {}) {
|
|
|
1754
1856
|
const stopSettingsChange = ctx.settings?.onChange?.((nextValues) => {
|
|
1755
1857
|
settings = normalizeRendererSettings(nextValues || {});
|
|
1756
1858
|
ensureDock();
|
|
1859
|
+
codeBlockEnhancer?.refresh?.();
|
|
1860
|
+
outlineRail?.refresh?.();
|
|
1757
1861
|
updateExportButtonMeta();
|
|
1758
1862
|
if (exportMenuOpen) {
|
|
1759
1863
|
if (getConfiguredExportFormats().length <= 1) {
|
|
@@ -1783,10 +1887,13 @@ async function mount(ctx, options = {}) {
|
|
|
1783
1887
|
stopStyles,
|
|
1784
1888
|
stopThinkingGuard,
|
|
1785
1889
|
stopViewportObserver,
|
|
1890
|
+
stopMessageListObserver,
|
|
1891
|
+
stopSendBtnObserver,
|
|
1786
1892
|
stopComposerObserver,
|
|
1787
1893
|
stopFileHeaderObserver,
|
|
1788
1894
|
stopDialogObserver,
|
|
1789
1895
|
stopSearchCloseSub,
|
|
1896
|
+
stopNavCmdSub,
|
|
1790
1897
|
stopContextSub,
|
|
1791
1898
|
() => doc?.removeEventListener?.('click', onDocClick),
|
|
1792
1899
|
() => doc?.removeEventListener?.('keydown', onKeyDown, true),
|
|
@@ -1796,6 +1903,8 @@ async function mount(ctx, options = {}) {
|
|
|
1796
1903
|
hideConvBadges,
|
|
1797
1904
|
() => closeInlineEditor(false),
|
|
1798
1905
|
clearHighlights,
|
|
1906
|
+
() => { codeBlockEnhancer?.dispose?.(); codeBlockEnhancer = null; },
|
|
1907
|
+
() => { outlineRail?.dispose?.(); outlineRail = null; },
|
|
1799
1908
|
teardownDock,
|
|
1800
1909
|
() => { if (editorControlEl?.remove) editorControlEl.remove(); editorControlEl = null; },
|
|
1801
1910
|
() => { customButtons.clear(); }
|
package/src/styles.js
CHANGED
|
@@ -419,6 +419,347 @@ const CHAT_NAV_STYLES = `
|
|
|
419
419
|
background-color: rgba(245, 158, 11, 0.08);
|
|
420
420
|
border-radius: 6px;
|
|
421
421
|
}
|
|
422
|
+
|
|
423
|
+
/* Sticky Code Block Headers & Smart Folding */
|
|
424
|
+
[data-agy-code-wrap="1"] {
|
|
425
|
+
overflow: visible !important;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
[data-agy-code-wrap="1"] > pre {
|
|
429
|
+
overflow-x: auto;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.agy-code-header,
|
|
433
|
+
[data-agy-code-header="native"],
|
|
434
|
+
[data-agy-code-header="injected"] {
|
|
435
|
+
position: sticky;
|
|
436
|
+
top: 0;
|
|
437
|
+
z-index: 4;
|
|
438
|
+
display: flex;
|
|
439
|
+
align-items: center;
|
|
440
|
+
justify-content: space-between;
|
|
441
|
+
gap: 8px;
|
|
442
|
+
min-height: 30px;
|
|
443
|
+
padding: 4px 10px;
|
|
444
|
+
background: var(--ag-bg-card, #ffffff);
|
|
445
|
+
border-bottom: 1px solid var(--ag-border-subcard, rgba(15, 23, 42, 0.09));
|
|
446
|
+
backdrop-filter: blur(8px);
|
|
447
|
+
color: var(--ag-text-secondary, #3f3f46);
|
|
448
|
+
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
|
|
449
|
+
font-size: 11.5px;
|
|
450
|
+
box-sizing: border-box;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
[data-agy-code-header="injected"] {
|
|
454
|
+
border: 1px solid var(--ag-border-card, rgba(15, 23, 42, 0.10));
|
|
455
|
+
border-bottom: 1px solid var(--ag-border-subcard, rgba(15, 23, 42, 0.09));
|
|
456
|
+
border-top-left-radius: 8px;
|
|
457
|
+
border-top-right-radius: 8px;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
[data-agy-code-header="static"],
|
|
461
|
+
[data-agy-sticky-ended="true"] {
|
|
462
|
+
position: relative;
|
|
463
|
+
top: auto;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.agy-code-header[hidden],
|
|
467
|
+
.agy-code-fold-btn[hidden],
|
|
468
|
+
.agy-code-collapsed-bar[hidden] {
|
|
469
|
+
display: none !important;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.agy-code-header-left,
|
|
473
|
+
.agy-code-header-actions {
|
|
474
|
+
display: inline-flex;
|
|
475
|
+
align-items: center;
|
|
476
|
+
gap: 6px;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.agy-code-lang {
|
|
480
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
481
|
+
font-size: 11px;
|
|
482
|
+
font-weight: 600;
|
|
483
|
+
color: var(--ag-text-primary, #18181b);
|
|
484
|
+
text-transform: lowercase;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.agy-code-lines {
|
|
488
|
+
font-size: 10.5px;
|
|
489
|
+
color: var(--ag-text-muted, #71717a);
|
|
490
|
+
font-variant-numeric: tabular-nums;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.agy-code-fold-btn,
|
|
494
|
+
.agy-code-copy-btn {
|
|
495
|
+
display: inline-flex;
|
|
496
|
+
align-items: center;
|
|
497
|
+
gap: 4px;
|
|
498
|
+
height: 22px;
|
|
499
|
+
padding: 0 7px;
|
|
500
|
+
border-radius: 6px;
|
|
501
|
+
border: none;
|
|
502
|
+
background: var(--ag-bg-control, rgba(113, 113, 122, 0.10));
|
|
503
|
+
color: var(--ag-text-secondary, #3f3f46);
|
|
504
|
+
font-size: 11px;
|
|
505
|
+
font-weight: 500;
|
|
506
|
+
cursor: pointer;
|
|
507
|
+
white-space: nowrap;
|
|
508
|
+
transition: background-color 140ms cubic-bezier(0.22, 1, 0.36, 1), color 140ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.agy-code-fold-btn:hover,
|
|
512
|
+
.agy-code-copy-btn:hover {
|
|
513
|
+
background: var(--ag-bg-control-hover, rgba(113, 113, 122, 0.18));
|
|
514
|
+
color: var(--ag-text-primary, #18181b);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.agy-code-fold-btn:focus-visible,
|
|
518
|
+
.agy-code-copy-btn:focus-visible,
|
|
519
|
+
.agy-code-collapsed-bar:focus-visible {
|
|
520
|
+
outline: 2px solid var(--ag-focus-ring, rgba(113, 113, 122, 0.45));
|
|
521
|
+
outline-offset: 1px;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
pre[data-agy-code-collapsed="true"] {
|
|
525
|
+
max-height: 0 !important;
|
|
526
|
+
min-height: 0 !important;
|
|
527
|
+
height: 0 !important;
|
|
528
|
+
padding-top: 0 !important;
|
|
529
|
+
padding-bottom: 0 !important;
|
|
530
|
+
margin-top: 0 !important;
|
|
531
|
+
margin-bottom: 0 !important;
|
|
532
|
+
overflow: hidden !important;
|
|
533
|
+
border-top: none !important;
|
|
534
|
+
border-bottom: none !important;
|
|
535
|
+
opacity: 0;
|
|
536
|
+
pointer-events: none;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.agy-code-collapsed-bar {
|
|
540
|
+
display: flex;
|
|
541
|
+
align-items: center;
|
|
542
|
+
justify-content: center;
|
|
543
|
+
width: 100%;
|
|
544
|
+
height: 28px;
|
|
545
|
+
padding: 0 12px;
|
|
546
|
+
border: 1px dashed var(--ag-border-card, rgba(113, 113, 122, 0.24));
|
|
547
|
+
border-bottom-left-radius: 8px;
|
|
548
|
+
border-bottom-right-radius: 8px;
|
|
549
|
+
background: var(--ag-bg-subcard, rgba(113, 113, 122, 0.05));
|
|
550
|
+
color: var(--ag-text-muted, #71717a);
|
|
551
|
+
font-size: 11.5px;
|
|
552
|
+
cursor: pointer;
|
|
553
|
+
transition: background-color 140ms cubic-bezier(0.22, 1, 0.36, 1), color 140ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.agy-code-collapsed-bar:hover {
|
|
557
|
+
background: var(--ag-bg-control-hover, rgba(113, 113, 122, 0.14));
|
|
558
|
+
color: var(--ag-text-primary, #18181b);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/* Left Conversation Outline Rail & Hover Popover */
|
|
562
|
+
#agy-chat-outline-rail {
|
|
563
|
+
position: fixed;
|
|
564
|
+
left: 8px;
|
|
565
|
+
top: 72px;
|
|
566
|
+
width: 18px;
|
|
567
|
+
min-height: 120px;
|
|
568
|
+
z-index: 19;
|
|
569
|
+
display: flex;
|
|
570
|
+
align-items: stretch;
|
|
571
|
+
justify-content: center;
|
|
572
|
+
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
#agy-chat-outline-rail[data-native-rail="true"] {
|
|
576
|
+
position: relative;
|
|
577
|
+
left: auto;
|
|
578
|
+
top: auto;
|
|
579
|
+
height: 100%;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
#agy-chat-outline-rail[data-under-dialog="true"] {
|
|
583
|
+
z-index: 1;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
#agy-chat-outline-rail[hidden],
|
|
587
|
+
#agy-chat-outline-popover[hidden] {
|
|
588
|
+
display: none !important;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.agy-chat-outline-tracks {
|
|
592
|
+
position: relative;
|
|
593
|
+
width: 100%;
|
|
594
|
+
height: 100%;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.agy-rail-tick {
|
|
598
|
+
position: absolute;
|
|
599
|
+
left: 2px;
|
|
600
|
+
width: 10px;
|
|
601
|
+
height: 3px;
|
|
602
|
+
padding: 0;
|
|
603
|
+
border: none;
|
|
604
|
+
border-radius: 999px;
|
|
605
|
+
background: var(--ag-text-muted, rgba(113, 113, 122, 0.45));
|
|
606
|
+
opacity: 0.52;
|
|
607
|
+
cursor: pointer;
|
|
608
|
+
transform: translateY(-50%);
|
|
609
|
+
transition: width 140ms cubic-bezier(0.22, 1, 0.36, 1), opacity 140ms cubic-bezier(0.22, 1, 0.36, 1), background-color 140ms ease;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.agy-rail-tick[data-key-question="true"] {
|
|
613
|
+
width: 13px;
|
|
614
|
+
background: var(--ag-ring-warn, #f59e0b);
|
|
615
|
+
opacity: 0.72;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.agy-rail-tick:hover,
|
|
619
|
+
.agy-rail-tick[data-active="true"] {
|
|
620
|
+
width: 16px;
|
|
621
|
+
opacity: 1;
|
|
622
|
+
background: var(--ag-text-primary, #18181b);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.agy-rail-tick[data-key-question="true"][data-active="true"] {
|
|
626
|
+
background: var(--ag-ring-warn, #f59e0b);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
#agy-chat-outline-popover {
|
|
630
|
+
position: absolute;
|
|
631
|
+
left: calc(100% + 8px);
|
|
632
|
+
top: 0;
|
|
633
|
+
width: 288px;
|
|
634
|
+
max-height: min(460px, 72vh);
|
|
635
|
+
display: flex;
|
|
636
|
+
flex-direction: column;
|
|
637
|
+
gap: 6px;
|
|
638
|
+
padding: 10px;
|
|
639
|
+
border-radius: 12px;
|
|
640
|
+
background: var(--ag-bg-panel, #ffffff);
|
|
641
|
+
border: 1px solid var(--ag-border-panel, rgba(15, 23, 42, 0.12));
|
|
642
|
+
box-shadow: var(--ag-shadow-panel, 0 12px 30px rgba(15, 23, 42, 0.16));
|
|
643
|
+
backdrop-filter: blur(12px);
|
|
644
|
+
color: var(--ag-text-primary, #18181b);
|
|
645
|
+
z-index: 25;
|
|
646
|
+
box-sizing: border-box;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.agy-outline-header {
|
|
650
|
+
display: flex;
|
|
651
|
+
align-items: center;
|
|
652
|
+
justify-content: space-between;
|
|
653
|
+
padding: 0 2px;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.agy-outline-title {
|
|
657
|
+
font-size: 12px;
|
|
658
|
+
font-weight: 600;
|
|
659
|
+
color: var(--ag-text-primary, #18181b);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.agy-outline-filters {
|
|
663
|
+
display: flex;
|
|
664
|
+
align-items: center;
|
|
665
|
+
gap: 4px;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.agy-outline-filter-btn {
|
|
669
|
+
height: 22px;
|
|
670
|
+
padding: 0 8px;
|
|
671
|
+
border-radius: 999px;
|
|
672
|
+
border: 1px solid var(--ag-border-card, rgba(113, 113, 122, 0.2));
|
|
673
|
+
background: transparent;
|
|
674
|
+
color: var(--ag-text-secondary, #3f3f46);
|
|
675
|
+
font-size: 11px;
|
|
676
|
+
font-weight: 500;
|
|
677
|
+
cursor: pointer;
|
|
678
|
+
transition: background-color 140ms ease, color 140ms ease;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.agy-outline-filter-btn[data-active="true"] {
|
|
682
|
+
background: var(--ag-bg-control-hover, rgba(113, 113, 122, 0.16));
|
|
683
|
+
color: var(--ag-text-primary, #18181b);
|
|
684
|
+
border-color: var(--ag-accent-border-hover, rgba(113, 113, 122, 0.35));
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.agy-outline-list {
|
|
688
|
+
display: flex;
|
|
689
|
+
flex-direction: column;
|
|
690
|
+
gap: 2px;
|
|
691
|
+
overflow-y: auto;
|
|
692
|
+
max-height: 360px;
|
|
693
|
+
padding-right: 2px;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.agy-outline-item,
|
|
697
|
+
.agy-outline-subheading {
|
|
698
|
+
display: flex;
|
|
699
|
+
align-items: center;
|
|
700
|
+
gap: 6px;
|
|
701
|
+
width: 100%;
|
|
702
|
+
padding: 5px 7px;
|
|
703
|
+
border: none;
|
|
704
|
+
border-radius: 7px;
|
|
705
|
+
background: transparent;
|
|
706
|
+
color: var(--ag-text-primary, #18181b);
|
|
707
|
+
font-size: 11.5px;
|
|
708
|
+
text-align: left;
|
|
709
|
+
cursor: pointer;
|
|
710
|
+
transition: background-color 120ms ease;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.agy-outline-item:hover,
|
|
714
|
+
.agy-outline-subheading:hover,
|
|
715
|
+
.agy-outline-item[data-active="true"] {
|
|
716
|
+
background: var(--ag-bg-control-hover, rgba(113, 113, 122, 0.14));
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.agy-outline-idx {
|
|
720
|
+
flex-shrink: 0;
|
|
721
|
+
font-size: 10.5px;
|
|
722
|
+
font-weight: 600;
|
|
723
|
+
color: var(--ag-text-muted, #71717a);
|
|
724
|
+
font-variant-numeric: tabular-nums;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.agy-outline-item[data-key-question="true"] .agy-outline-idx {
|
|
728
|
+
color: var(--ag-ring-warn, #f59e0b);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.agy-outline-text {
|
|
732
|
+
flex: 1 1 auto;
|
|
733
|
+
min-width: 0;
|
|
734
|
+
overflow: hidden;
|
|
735
|
+
text-overflow: ellipsis;
|
|
736
|
+
white-space: nowrap;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.agy-outline-code-tag {
|
|
740
|
+
flex-shrink: 0;
|
|
741
|
+
font-size: 10px;
|
|
742
|
+
padding: 1px 5px;
|
|
743
|
+
border-radius: 999px;
|
|
744
|
+
background: var(--ag-bg-control, rgba(113, 113, 122, 0.12));
|
|
745
|
+
color: var(--ag-text-muted, #71717a);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.agy-outline-subheading {
|
|
749
|
+
padding-left: 22px;
|
|
750
|
+
font-size: 11px;
|
|
751
|
+
color: var(--ag-text-secondary, #3f3f46);
|
|
752
|
+
white-space: nowrap;
|
|
753
|
+
overflow: hidden;
|
|
754
|
+
text-overflow: ellipsis;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.agy-outline-empty {
|
|
758
|
+
padding: 14px 8px;
|
|
759
|
+
text-align: center;
|
|
760
|
+
font-size: 11.5px;
|
|
761
|
+
color: var(--ag-text-muted, #71717a);
|
|
762
|
+
}
|
|
422
763
|
`.trim();
|
|
423
764
|
|
|
424
765
|
module.exports = {
|