@vibe-forge/client 0.11.3 → 1.0.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/cli.cjs +6 -11
- package/dist/assets/{arc-h39NrT24.js → arc-CbOXL0l9.js} +1 -1
- package/dist/assets/{blockDiagram-c4efeb88-CaDg46I6.js → blockDiagram-c4efeb88-CqxINvsS.js} +1 -1
- package/dist/assets/{c4Diagram-c83219d4-CDqjcF9U.js → c4Diagram-c83219d4-BKazU0hb.js} +1 -1
- package/dist/assets/channel-Dnopc5A6.js +1 -0
- package/dist/assets/{classDiagram-beda092f-BDnZm8nO.js → classDiagram-beda092f-fAFX5BpB.js} +1 -1
- package/dist/assets/{classDiagram-v2-2358418a-BUi85KJW.js → classDiagram-v2-2358418a-w1VkNGJj.js} +1 -1
- package/dist/assets/clone-sQthahUA.js +1 -0
- package/dist/assets/{createText-1719965b-Ca5dEwfo.js → createText-1719965b-CEinakVP.js} +1 -1
- package/dist/assets/{cssMode-Ysz7NfYo.js → cssMode-DPqRki4y.js} +1 -1
- package/dist/assets/{edges-96097737-CdSKqxZt.js → edges-96097737-Cb0F1_3K.js} +1 -1
- package/dist/assets/{erDiagram-0228fc6a-B-veAUv_.js → erDiagram-0228fc6a-C-N2fx-J.js} +1 -1
- package/dist/assets/{flowDb-c6c81e3f-DD8Cx7_9.js → flowDb-c6c81e3f-D1Xz_8Gf.js} +1 -1
- package/dist/assets/{flowDiagram-50d868cf-9f-_x1ET.js → flowDiagram-50d868cf-DyPSZyAj.js} +1 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-OazrdWQO.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-5RhpQM4M.js → flowchart-elk-definition-6af322e1-Dr1DDXwE.js} +1 -1
- package/dist/assets/{freemarker2-SgMdIXw4.js → freemarker2-C3DvPFaK.js} +1 -1
- package/dist/assets/{ganttDiagram-a2739b55-DnxNghZA.js → ganttDiagram-a2739b55-DmvY1GRj.js} +1 -1
- package/dist/assets/{gitGraphDiagram-82fe8481-CBvS3Tf9.js → gitGraphDiagram-82fe8481-CoXfPYYi.js} +1 -1
- package/dist/assets/{graph-CkHF299-.js → graph-BkDQy7Qt.js} +1 -1
- package/dist/assets/{handlebars-C57IyLUe.js → handlebars-BcTFdqjl.js} +1 -1
- package/dist/assets/{html-YsDy5wvW.js → html-Dg-O6XFr.js} +1 -1
- package/dist/assets/{htmlMode-7o_VDODD.js → htmlMode-B_wqYWvn.js} +1 -1
- package/dist/assets/{index-5325376f-BzOVQPu-.js → index-5325376f-kxPTR3_e.js} +1 -1
- package/dist/assets/index-o93dlo92.css +32 -0
- package/dist/assets/{index-BHFpctk6.js → index-wkhI4dr6.js} +357 -337
- package/dist/assets/{infoDiagram-8eee0895-DJ-UI1h4.js → infoDiagram-8eee0895-BEvqkwPI.js} +1 -1
- package/dist/assets/{javascript-BHQ9NEZr.js → javascript-DhlOH8_z.js} +1 -1
- package/dist/assets/{journeyDiagram-c64418c1-DwfykcG9.js → journeyDiagram-c64418c1-gKtLYmmp.js} +1 -1
- package/dist/assets/{jsonMode-3QjftkMM.js → jsonMode-DxTbF9OD.js} +1 -1
- package/dist/assets/{layout-CbViRb_b.js → layout-CDaZEk6E.js} +1 -1
- package/dist/assets/{line-DBdBvv9D.js → line-DNRQu8iq.js} +1 -1
- package/dist/assets/{linear-BDAfhcjn.js → linear-Cph9Z6_j.js} +1 -1
- package/dist/assets/{liquid-B0cPPzIR.js → liquid-ByZ6JgRG.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-IOxbobOz.js → lspLanguageFeatures-DzvhkgnM.js} +1 -1
- package/dist/assets/{mdx-Dma_RA8P.js → mdx-D8RGHTl6.js} +1 -1
- package/dist/assets/{mermaid.core-Cvn8Go4x.js → mermaid.core-BgcryF__.js} +4 -4
- package/dist/assets/{mindmap-definition-8da855dc-DEnYq0Lc.js → mindmap-definition-8da855dc-WrxK0FcB.js} +1 -1
- package/dist/assets/{pieDiagram-a8764435-ZC4j8sHU.js → pieDiagram-a8764435-VsZBsiQy.js} +1 -1
- package/dist/assets/{python-Be0WX4q5.js → python-CXVtk_cg.js} +1 -1
- package/dist/assets/{quadrantDiagram-1e28029f-DUaqHlIB.js → quadrantDiagram-1e28029f-BVlgwOvU.js} +1 -1
- package/dist/assets/{razor-Tjhny-uT.js → razor-0tind7h2.js} +1 -1
- package/dist/assets/{requirementDiagram-08caed73-DjSal3es.js → requirementDiagram-08caed73-CpPMPoYp.js} +1 -1
- package/dist/assets/{sankeyDiagram-a04cb91d-BMDXMrMz.js → sankeyDiagram-a04cb91d-Cm5nnRmc.js} +1 -1
- package/dist/assets/{sequenceDiagram-c5b8d532-CQl9YUlH.js → sequenceDiagram-c5b8d532-DpMlJvJB.js} +1 -1
- package/dist/assets/{stateDiagram-1ecb1508-DG7mU9jD.js → stateDiagram-1ecb1508-DU1zc7vq.js} +1 -1
- package/dist/assets/{stateDiagram-v2-c2b004d7-DTbR_azy.js → stateDiagram-v2-c2b004d7-D-0RgmAp.js} +1 -1
- package/dist/assets/{styles-b4e223ce-C9aS3zb8.js → styles-b4e223ce-BSO-yNWV.js} +1 -1
- package/dist/assets/{styles-ca3715f6-Bh3keVTZ.js → styles-ca3715f6-CHnsn2Ro.js} +1 -1
- package/dist/assets/{styles-d45a18b0-BDcLLa65.js → styles-d45a18b0-B-rVGjEq.js} +1 -1
- package/dist/assets/{svgDrawCommon-b86b1483-B9H5ZS_9.js → svgDrawCommon-b86b1483-CA3Pl89f.js} +1 -1
- package/dist/assets/{timeline-definition-faaaa080-DCMYCBhK.js → timeline-definition-faaaa080-BcihLR6s.js} +1 -1
- package/dist/assets/{tsMode-DVqLsn98.js → tsMode-D9GGa5Ur.js} +1 -1
- package/dist/assets/{typescript-wMVyXw7G.js → typescript-BT9CK_EL.js} +1 -1
- package/dist/assets/{xml-w0gzmn0c.js → xml-DNO75J-T.js} +1 -1
- package/dist/assets/{xychartDiagram-f5964ef8-CdxyD3K5.js → xychartDiagram-f5964ef8-DJTwe32X.js} +1 -1
- package/dist/assets/{yaml-C29TL1ed.js → yaml-7CVzhiP2.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +13 -10
- package/src/api/git.ts +12 -0
- package/src/api/sessions.ts +61 -3
- package/src/api.ts +8 -0
- package/src/components/ArchiveView.scss +143 -54
- package/src/components/ArchiveView.tsx +181 -167
- package/src/components/CodeBlock.scss +5 -0
- package/src/components/ConfigView.scss +142 -31
- package/src/components/ConfigView.tsx +161 -86
- package/src/components/MarkdownContent.tsx +7 -0
- package/src/components/NavRail.scss +248 -0
- package/src/components/NavRail.tsx +80 -107
- package/src/components/NavRailCompact.tsx +107 -0
- package/src/components/NavRailCompactMoreSheet.tsx +141 -0
- package/src/components/ShortcutTooltip.tsx +4 -2
- package/src/components/Sidebar.scss +51 -0
- package/src/components/Sidebar.tsx +43 -16
- package/src/components/automation-view/RuleFormPanel.scss +40 -13
- package/src/components/automation-view/RuleSidebar.scss +73 -47
- package/src/components/automation-view/RuleSidebar.tsx +9 -13
- package/src/components/automation-view/RunHistoryPanel.scss +141 -13
- package/src/components/automation-view/RunHistoryPanel.tsx +203 -161
- package/src/components/automation-view/TaskList.scss +44 -13
- package/src/components/automation-view/TriggerList.scss +46 -14
- package/src/components/automation-view/index.scss +82 -10
- package/src/components/automation-view/index.tsx +108 -55
- package/src/components/benchmark-view/BenchmarkCasePanel.scss +36 -16
- package/src/components/benchmark-view/BenchmarkSidebar.scss +44 -22
- package/src/components/benchmark-view/BenchmarkSidebar.tsx +0 -6
- package/src/components/benchmark-view/BenchmarkView.scss +63 -20
- package/src/components/benchmark-view/index.tsx +71 -34
- package/src/components/chat/ChatComposerCard.scss +4 -0
- package/src/components/chat/ChatHeader.scss +187 -0
- package/src/components/chat/ChatHeader.tsx +206 -56
- package/src/components/chat/ChatHistoryView.tsx +63 -2
- package/src/components/chat/ChatTimelineView.scss +94 -1
- package/src/components/chat/ChatTimelineView.tsx +42 -0
- package/src/components/chat/NewSessionGuide.scss +139 -1
- package/src/components/chat/NewSessionGuide.tsx +57 -100
- package/src/components/chat/NewSessionGuideCompactPanel.tsx +130 -0
- package/src/components/chat/NewSessionGuideGrid.tsx +141 -0
- package/src/components/chat/git-controls/BranchSwitcherDropdown.tsx +61 -56
- package/src/components/chat/git-controls/BranchSwitcherResults.tsx +167 -0
- package/src/components/chat/git-controls/BranchTreeEntries.tsx +99 -0
- package/src/components/chat/git-controls/ChatGitControls.scss +437 -5
- package/src/components/chat/git-controls/ChatGitControls.tsx +136 -109
- package/src/components/chat/git-controls/DraftGitControls.tsx +91 -0
- package/src/components/chat/git-controls/GitOperationsDropdown.tsx +10 -2
- package/src/components/chat/git-controls/GitWorktreeDropdown.tsx +301 -28
- package/src/components/chat/git-controls/git-branch-tree.ts +148 -0
- package/src/components/chat/git-controls/use-chat-draft-git-controls.ts +168 -0
- package/src/components/chat/git-controls/use-chat-git-controls.ts +76 -3
- package/src/components/chat/messages/MessageContextMenu.tsx +3 -1
- package/src/components/chat/messages/MessageItem.scss +78 -4
- package/src/components/chat/messages/MessageItem.tsx +47 -3
- package/src/components/chat/sender/@components/adapter-select/AdapterSelectControl.scss +15 -0
- package/src/components/chat/sender/@components/reference-actions/ReferenceActionsControl.scss +17 -0
- package/src/components/chat/sender/@components/reference-actions/ReferencePermissionActionsPopover.tsx +4 -1
- package/src/components/chat/sender/@components/sender-attachments/SenderAttachments.scss +15 -2
- package/src/components/chat/sender/@components/sender-body/SenderBody.tsx +3 -0
- package/src/components/chat/sender/@components/sender-monaco-editor/use-sender-monaco-theme.ts +52 -3
- package/src/components/chat/sender/@components/sender-submit-action/SenderSubmitAction.scss +12 -0
- package/src/components/chat/sender/@components/sender-toolbar/SenderSelectBase.scss +21 -0
- package/src/components/chat/sender/@components/sender-toolbar/SenderSelectShared.scss +21 -0
- package/src/components/chat/sender/@components/sender-toolbar/SenderToolbar.scss +63 -0
- package/src/components/chat/sender/@core/get-sender-runtime-state.ts +1 -1
- package/src/components/chat/sender/@hooks/use-model-select-browser.tsx +4 -2
- package/src/components/chat/sender/@types/sender-props.ts +1 -0
- package/src/components/chat/sender/Sender.scss +1 -1
- package/src/components/chat/sender/Sender.tsx +1 -0
- package/src/components/chat/session-timeline-panel/EventList.scss +88 -0
- package/src/components/chat/session-timeline-panel/EventList.tsx +99 -47
- package/src/components/chat/session-timeline-panel/gantt.ts +23 -7
- package/src/components/chat/session-timeline-panel/git-graph.ts +6 -1
- package/src/components/chat/session-timeline-panel/index.scss +14 -1
- package/src/components/chat/session-timeline-panel/index.tsx +86 -10
- package/src/components/chat/session-timeline-panel/types.ts +4 -0
- package/src/components/chat/status-bar/ChatStatusBar.scss +27 -0
- package/src/components/chat/status-bar/ChatStatusBar.tsx +39 -0
- package/src/components/chat/terminal/ChatTerminalView.tsx +6 -0
- package/src/components/chat/tools/core/ToolCallBox.scss +19 -0
- package/src/components/chat/tools/core/ToolGroup.scss +32 -0
- package/src/components/chat/tools/task/components/TaskToolCard.scss +59 -1
- package/src/components/config/ConfigEditors.scss +20 -6
- package/src/components/config/ConfigFieldRow.scss +57 -17
- package/src/components/config/ConfigSectionForm.scss +10 -4
- package/src/components/config/ConfigSectionPanel.tsx +18 -11
- package/src/components/config/configSchema.ts +1 -0
- package/src/components/config/record-editors/RecordEditors.scss +42 -9
- package/src/components/dock-panel/DockPanel.scss +6 -2
- package/src/components/dock-panel/DockPanel.tsx +12 -16
- package/src/components/knowledge-base/KnowledgeBaseView.scss +180 -6
- package/src/components/knowledge-base/KnowledgeBaseView.tsx +98 -26
- package/src/components/knowledge-base/components/ActionButton.scss +4 -0
- package/src/components/knowledge-base/components/EmptyState.scss +5 -8
- package/src/components/knowledge-base/components/EntitiesTab.tsx +8 -2
- package/src/components/knowledge-base/components/EntityItem.scss +10 -3
- package/src/components/knowledge-base/components/FilterBar.scss +13 -2
- package/src/components/knowledge-base/components/FlowsTab.tsx +8 -2
- package/src/components/knowledge-base/components/KnowledgeBaseHeader.scss +2 -23
- package/src/components/knowledge-base/components/KnowledgeBaseHeader.tsx +0 -5
- package/src/components/knowledge-base/components/KnowledgeList.scss +15 -6
- package/src/components/knowledge-base/components/LoadingState.scss +4 -0
- package/src/components/knowledge-base/components/RuleItem.scss +86 -0
- package/src/components/knowledge-base/components/RuleItem.tsx +2 -0
- package/src/components/knowledge-base/components/RulesTab.tsx +8 -2
- package/src/components/knowledge-base/components/SectionHeader.scss +3 -18
- package/src/components/knowledge-base/components/SectionHeader.tsx +3 -7
- package/src/components/knowledge-base/components/SkillsTab.tsx +8 -3
- package/src/components/knowledge-base/components/SpecItem.scss +16 -7
- package/src/components/layout/@hooks/use-mobile-sidebar-modal.ts +190 -0
- package/src/components/layout/AppShell.scss +106 -6
- package/src/components/layout/AppShell.tsx +118 -10
- package/src/components/layout/PageShell.scss +41 -0
- package/src/components/layout/PageShell.tsx +32 -0
- package/src/components/layout/mobile-sidebar-constants.ts +1 -0
- package/src/components/nav-rail-compact-config.ts +114 -0
- package/src/components/nav-rail-items.tsx +181 -0
- package/src/components/sidebar/SessionContextMenu.tsx +3 -1
- package/src/components/sidebar/SessionItem.scss +62 -0
- package/src/components/sidebar/SessionItem.tsx +97 -52
- package/src/components/sidebar/SessionList.tsx +6 -0
- package/src/components/sidebar/SidebarHeader.scss +49 -0
- package/src/components/sidebar/SidebarHeader.tsx +27 -5
- package/src/components/sidebar/SidebarHeaderBatchActions.tsx +8 -4
- package/src/components/sidebar/SidebarHeaderSearchActions.tsx +6 -3
- package/src/components/sidebar/SidebarUtilityFooter.tsx +69 -0
- package/src/components/workspace/ContextFilePicker.tsx +12 -4
- package/src/hooks/chat/chat-session-workspace-draft.ts +25 -0
- package/src/hooks/chat/use-chat-scroll.ts +24 -7
- package/src/hooks/chat/use-chat-session-actions.ts +19 -2
- package/src/hooks/use-responsive-layout.ts +115 -0
- package/src/resources/adapters.ts +15 -0
- package/src/resources/locales/en.json +52 -0
- package/src/resources/locales/zh.json +52 -0
- package/src/routes/ChatRoute.scss +113 -14
- package/src/routes/ChatRoute.tsx +29 -35
- package/src/store/index.ts +2 -0
- package/dist/assets/channel-CBULQbJz.js +0 -1
- package/dist/assets/clone-dkS7LczW.js +0 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-1miffU4x.js +0 -1
- package/dist/assets/index-D_XqxIvp.css +0 -32
|
@@ -17,6 +17,7 @@ interface EntitiesTabProps {
|
|
|
17
17
|
query: string
|
|
18
18
|
tagOptions: Array<{ label: string; value: string }>
|
|
19
19
|
tagFilter: string[]
|
|
20
|
+
onRefresh: () => void
|
|
20
21
|
onQueryChange: (value: string) => void
|
|
21
22
|
onTagFilterChange: (value: string[]) => void
|
|
22
23
|
onCreate: () => void
|
|
@@ -30,6 +31,7 @@ export function EntitiesTab({
|
|
|
30
31
|
query,
|
|
31
32
|
tagOptions,
|
|
32
33
|
tagFilter,
|
|
34
|
+
onRefresh,
|
|
33
35
|
onQueryChange,
|
|
34
36
|
onTagFilterChange,
|
|
35
37
|
onCreate,
|
|
@@ -40,10 +42,14 @@ export function EntitiesTab({
|
|
|
40
42
|
return (
|
|
41
43
|
<TabContent className='knowledge-base-view__entities-tab'>
|
|
42
44
|
<SectionHeader
|
|
43
|
-
title={t('knowledge.entities.title')}
|
|
44
|
-
description={t('knowledge.entities.desc')}
|
|
45
45
|
actions={
|
|
46
46
|
<Space>
|
|
47
|
+
<ActionButton
|
|
48
|
+
icon={<span className='material-symbols-rounded'>refresh</span>}
|
|
49
|
+
onClick={onRefresh}
|
|
50
|
+
>
|
|
51
|
+
{t('knowledge.actions.refresh')}
|
|
52
|
+
</ActionButton>
|
|
47
53
|
<ActionButton
|
|
48
54
|
icon={<span className='material-symbols-rounded'>download</span>}
|
|
49
55
|
onClick={onImport}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
gap:
|
|
6
|
-
padding:
|
|
5
|
+
gap: 10px;
|
|
6
|
+
padding: var(--subpage-tertiary-padding);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.knowledge-base-view__item-row {
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
gap: 8px;
|
|
27
|
-
font-
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
line-height: 1.35;
|
|
29
|
+
font-weight: 500;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
.knowledge-base-view__item-icon {
|
|
@@ -56,6 +58,9 @@
|
|
|
56
58
|
gap: 4px;
|
|
57
59
|
padding: 0 8px;
|
|
58
60
|
height: 28px;
|
|
61
|
+
border-radius: 6px;
|
|
62
|
+
border: 1px solid var(--border-color);
|
|
63
|
+
background: var(--bg-color);
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
.knowledge-base-view__meta-pill-icon {
|
|
@@ -74,6 +79,8 @@
|
|
|
74
79
|
display: inline-flex;
|
|
75
80
|
align-items: center;
|
|
76
81
|
gap: 4px;
|
|
82
|
+
margin: 0;
|
|
83
|
+
border-radius: 4px;
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
.knowledge-base-view__tag-icon {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.knowledge-base-view__filters {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
|
-
gap:
|
|
4
|
+
gap: 8px;
|
|
5
5
|
align-items: center;
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -16,6 +16,17 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.knowledge-base-view__filter-icon {
|
|
19
|
-
font-size:
|
|
19
|
+
font-size: 14px;
|
|
20
20
|
color: var(--sub-text-color);
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
.knowledge-base-view__filter-input .ant-input-affix-wrapper,
|
|
24
|
+
.knowledge-base-view__filter-select .ant-select-selector {
|
|
25
|
+
height: 30px !important;
|
|
26
|
+
border-radius: 6px !important;
|
|
27
|
+
background: var(--bg-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.knowledge-base-view__filter-select .ant-select-selector {
|
|
31
|
+
align-items: center !important;
|
|
32
|
+
}
|
|
@@ -17,6 +17,7 @@ interface FlowsTabProps {
|
|
|
17
17
|
query: string
|
|
18
18
|
tagOptions: Array<{ label: string; value: string }>
|
|
19
19
|
tagFilter: string[]
|
|
20
|
+
onRefresh: () => void
|
|
20
21
|
onQueryChange: (value: string) => void
|
|
21
22
|
onTagFilterChange: (value: string[]) => void
|
|
22
23
|
onCreate: () => void
|
|
@@ -30,6 +31,7 @@ export function FlowsTab({
|
|
|
30
31
|
query,
|
|
31
32
|
tagOptions,
|
|
32
33
|
tagFilter,
|
|
34
|
+
onRefresh,
|
|
33
35
|
onQueryChange,
|
|
34
36
|
onTagFilterChange,
|
|
35
37
|
onCreate,
|
|
@@ -40,10 +42,14 @@ export function FlowsTab({
|
|
|
40
42
|
return (
|
|
41
43
|
<TabContent className='knowledge-base-view__flows-tab'>
|
|
42
44
|
<SectionHeader
|
|
43
|
-
title={t('knowledge.flows.title')}
|
|
44
|
-
description={t('knowledge.flows.desc')}
|
|
45
45
|
actions={
|
|
46
46
|
<Space>
|
|
47
|
+
<ActionButton
|
|
48
|
+
icon={<span className='material-symbols-rounded'>refresh</span>}
|
|
49
|
+
onClick={onRefresh}
|
|
50
|
+
>
|
|
51
|
+
{t('knowledge.actions.refresh')}
|
|
52
|
+
</ActionButton>
|
|
47
53
|
<ActionButton
|
|
48
54
|
icon={<span className='material-symbols-rounded'>download</span>}
|
|
49
55
|
onClick={onImport}
|
|
@@ -1,27 +1,6 @@
|
|
|
1
1
|
.knowledge-base-view__header {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
justify-content:
|
|
5
|
-
gap:
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.knowledge-base-view__title {
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
gap: 8px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.knowledge-base-view__title-icon {
|
|
15
|
-
font-size: 24px;
|
|
16
|
-
&.material-symbols-rounded {
|
|
17
|
-
font-variation-settings: 'FILL' 1;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.knowledge-base-view__title-text {
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
gap: 4px;
|
|
25
|
-
font-size: 18px;
|
|
26
|
-
font-weight: 600;
|
|
4
|
+
justify-content: flex-end;
|
|
5
|
+
gap: 12px;
|
|
27
6
|
}
|
|
@@ -13,11 +13,6 @@ export function KnowledgeBaseHeader({ onRefresh }: KnowledgeBaseHeaderProps) {
|
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<div className='knowledge-base-view__header'>
|
|
16
|
-
<div className='knowledge-base-view__title'>
|
|
17
|
-
<div className='knowledge-base-view__title-text'>
|
|
18
|
-
{t('knowledge.title')}
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
16
|
<ActionButton
|
|
22
17
|
icon={<span className='material-symbols-rounded'>refresh</span>}
|
|
23
18
|
onClick={onRefresh}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
.knowledge-base-view__list {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
background: transparent;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.knowledge-base-view__list .ant-list-items {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 6px;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
11
|
.knowledge-base-view__list .ant-list-item {
|
|
9
12
|
padding: 0;
|
|
10
13
|
align-items: stretch;
|
|
14
|
+
border: 1px solid var(--border-color);
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
background: var(--bg-color);
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
transition: border-color .2s ease, background-color .2s ease;
|
|
11
19
|
}
|
|
12
20
|
|
|
13
|
-
.knowledge-base-view__list .ant-list-item
|
|
14
|
-
border-
|
|
21
|
+
.knowledge-base-view__list .ant-list-item:hover {
|
|
22
|
+
border-color: var(--subpage-tertiary-hover-border);
|
|
23
|
+
background: var(--subpage-tertiary-hover-bg);
|
|
15
24
|
}
|
|
16
25
|
|
|
17
26
|
.knowledge-base-view__list-item {
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
.knowledge-base-view__item {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 10px;
|
|
6
|
+
padding: var(--subpage-tertiary-padding);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.knowledge-base-view__item-row {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
gap: 16px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.knowledge-base-view__item-main {
|
|
16
|
+
flex: 1;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.knowledge-base-view__item-title {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
line-height: 1.35;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.knowledge-base-view__item-icon {
|
|
33
|
+
font-size: 18px;
|
|
34
|
+
color: var(--sub-text-color);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.knowledge-base-view__item-desc {
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
color: var(--sub-text-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.knowledge-base-view__item-meta {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 8px;
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.knowledge-base-view__tag-list {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
gap: 6px;
|
|
53
|
+
margin-top: 6px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.knowledge-base-view__tag {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 4px;
|
|
60
|
+
margin: 0;
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.knowledge-base-view__tag-icon {
|
|
65
|
+
font-size: 12px;
|
|
66
|
+
color: var(--sub-text-color);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.knowledge-base-view__detail {
|
|
70
|
+
padding-top: 10px;
|
|
71
|
+
border-top: 1px solid var(--border-color);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.knowledge-base-view__markdown {
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.knowledge-base-view__icon-button {
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
width: 28px;
|
|
83
|
+
min-width: 28px;
|
|
84
|
+
height: 28px;
|
|
85
|
+
border-radius: 6px;
|
|
86
|
+
}
|
|
@@ -14,6 +14,7 @@ interface RulesTabProps {
|
|
|
14
14
|
filteredRules: RuleSummary[]
|
|
15
15
|
isLoading: boolean
|
|
16
16
|
query: string
|
|
17
|
+
onRefresh: () => void
|
|
17
18
|
onQueryChange: (value: string) => void
|
|
18
19
|
onCreate: () => void
|
|
19
20
|
onImport: () => void
|
|
@@ -24,6 +25,7 @@ export function RulesTab({
|
|
|
24
25
|
filteredRules,
|
|
25
26
|
isLoading,
|
|
26
27
|
query,
|
|
28
|
+
onRefresh,
|
|
27
29
|
onQueryChange,
|
|
28
30
|
onCreate,
|
|
29
31
|
onImport
|
|
@@ -33,10 +35,14 @@ export function RulesTab({
|
|
|
33
35
|
return (
|
|
34
36
|
<TabContent className='knowledge-base-view__rules-tab'>
|
|
35
37
|
<SectionHeader
|
|
36
|
-
title={t('knowledge.rules.title')}
|
|
37
|
-
description={t('knowledge.rules.desc')}
|
|
38
38
|
actions={
|
|
39
39
|
<Space>
|
|
40
|
+
<ActionButton
|
|
41
|
+
icon={<span className='material-symbols-rounded'>refresh</span>}
|
|
42
|
+
onClick={onRefresh}
|
|
43
|
+
>
|
|
44
|
+
{t('knowledge.actions.refresh')}
|
|
45
|
+
</ActionButton>
|
|
40
46
|
<ActionButton
|
|
41
47
|
icon={<span className='material-symbols-rounded'>download</span>}
|
|
42
48
|
onClick={onImport}
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
.knowledge-base-view__section-header {
|
|
2
2
|
display: flex;
|
|
3
|
-
align-items:
|
|
4
|
-
justify-content:
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: flex-end;
|
|
5
5
|
gap: 16px;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.knowledge-base-view__section-info {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
gap: 4px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.knowledge-base-view__section-title {
|
|
15
|
-
font-size: 16px;
|
|
16
|
-
font-weight: 600;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.knowledge-base-view__section-desc {
|
|
20
|
-
font-size: 12px;
|
|
21
|
-
color: var(--sub-text-color);
|
|
6
|
+
padding: 0;
|
|
22
7
|
}
|
|
@@ -3,18 +3,14 @@ import './SectionHeader.scss'
|
|
|
3
3
|
import type { ReactNode } from 'react'
|
|
4
4
|
|
|
5
5
|
interface SectionHeaderProps {
|
|
6
|
-
title: string
|
|
7
|
-
description: string
|
|
8
6
|
actions?: ReactNode
|
|
9
7
|
}
|
|
10
8
|
|
|
11
|
-
export function SectionHeader({
|
|
9
|
+
export function SectionHeader({ actions }: SectionHeaderProps) {
|
|
10
|
+
if (actions == null) return null
|
|
11
|
+
|
|
12
12
|
return (
|
|
13
13
|
<div className='knowledge-base-view__section-header'>
|
|
14
|
-
<div className='knowledge-base-view__section-info'>
|
|
15
|
-
<div className='knowledge-base-view__section-title'>{title}</div>
|
|
16
|
-
<div className='knowledge-base-view__section-desc'>{description}</div>
|
|
17
|
-
</div>
|
|
18
14
|
{actions}
|
|
19
15
|
</div>
|
|
20
16
|
)
|
|
@@ -9,20 +9,25 @@ import { SectionHeader } from './SectionHeader'
|
|
|
9
9
|
import { TabContent } from './TabContent'
|
|
10
10
|
|
|
11
11
|
interface SkillsTabProps {
|
|
12
|
+
onRefresh: () => void
|
|
12
13
|
onCreate: () => void
|
|
13
14
|
onImport: () => void
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export function SkillsTab({ onCreate, onImport }: SkillsTabProps) {
|
|
17
|
+
export function SkillsTab({ onCreate, onImport, onRefresh }: SkillsTabProps) {
|
|
17
18
|
const { t } = useTranslation()
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
21
|
<TabContent className='knowledge-base-view__skills-tab'>
|
|
21
22
|
<SectionHeader
|
|
22
|
-
title={t('knowledge.skills.title')}
|
|
23
|
-
description={t('knowledge.skills.desc')}
|
|
24
23
|
actions={
|
|
25
24
|
<Space>
|
|
25
|
+
<ActionButton
|
|
26
|
+
icon={<span className='material-symbols-rounded'>refresh</span>}
|
|
27
|
+
onClick={onRefresh}
|
|
28
|
+
>
|
|
29
|
+
{t('knowledge.actions.refresh')}
|
|
30
|
+
</ActionButton>
|
|
26
31
|
<ActionButton
|
|
27
32
|
icon={<span className='material-symbols-rounded'>download</span>}
|
|
28
33
|
onClick={onImport}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
gap:
|
|
6
|
-
padding:
|
|
5
|
+
gap: 10px;
|
|
6
|
+
padding: var(--subpage-tertiary-padding);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.knowledge-base-view__item-row {
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
gap: 8px;
|
|
27
|
-
font-
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
line-height: 1.35;
|
|
29
|
+
font-weight: 500;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
.knowledge-base-view__item-icon {
|
|
@@ -56,6 +58,9 @@
|
|
|
56
58
|
gap: 4px;
|
|
57
59
|
padding: 0 8px;
|
|
58
60
|
height: 28px;
|
|
61
|
+
border-radius: 6px;
|
|
62
|
+
border: 1px solid var(--border-color);
|
|
63
|
+
background: var(--bg-color);
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
.knowledge-base-view__meta-pill-icon {
|
|
@@ -113,6 +118,8 @@
|
|
|
113
118
|
display: inline-flex;
|
|
114
119
|
align-items: center;
|
|
115
120
|
gap: 4px;
|
|
121
|
+
margin: 0;
|
|
122
|
+
border-radius: 4px;
|
|
116
123
|
}
|
|
117
124
|
|
|
118
125
|
.knowledge-base-view__tag-icon {
|
|
@@ -121,10 +128,8 @@
|
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
.knowledge-base-view__detail {
|
|
124
|
-
|
|
125
|
-
border: 1px solid var(--border-color);
|
|
126
|
-
background: var(--code-bg);
|
|
127
|
-
padding: 12px;
|
|
131
|
+
padding-top: 10px;
|
|
132
|
+
border-top: 1px solid var(--border-color);
|
|
128
133
|
}
|
|
129
134
|
|
|
130
135
|
.knowledge-base-view__markdown {
|
|
@@ -135,4 +140,8 @@
|
|
|
135
140
|
display: inline-flex;
|
|
136
141
|
align-items: center;
|
|
137
142
|
justify-content: center;
|
|
143
|
+
width: 28px;
|
|
144
|
+
min-width: 28px;
|
|
145
|
+
height: 28px;
|
|
146
|
+
border-radius: 6px;
|
|
138
147
|
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react'
|
|
2
|
+
import type { RefObject } from 'react'
|
|
3
|
+
|
|
4
|
+
const FOCUSABLE_SELECTOR = [
|
|
5
|
+
'a[href]',
|
|
6
|
+
'button:not([disabled])',
|
|
7
|
+
'input:not([disabled])',
|
|
8
|
+
'select:not([disabled])',
|
|
9
|
+
'textarea:not([disabled])',
|
|
10
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
11
|
+
].join(', ')
|
|
12
|
+
|
|
13
|
+
const getFocusableElements = (container: HTMLElement) => {
|
|
14
|
+
return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR))
|
|
15
|
+
.filter((element) =>
|
|
16
|
+
!element.hasAttribute('disabled') && element.getAttribute('aria-hidden') !== 'true' &&
|
|
17
|
+
element.offsetParent !== null
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const focusElement = (element: HTMLElement) => {
|
|
22
|
+
try {
|
|
23
|
+
element.focus({ preventScroll: true })
|
|
24
|
+
} catch {
|
|
25
|
+
element.focus()
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const focusFirstElement = (container: HTMLElement) => {
|
|
30
|
+
const focusableElements = getFocusableElements(container)
|
|
31
|
+
const firstFocusableElement = focusableElements[0]
|
|
32
|
+
if (firstFocusableElement != null) {
|
|
33
|
+
focusElement(firstFocusableElement)
|
|
34
|
+
} else {
|
|
35
|
+
focusElement(container)
|
|
36
|
+
}
|
|
37
|
+
return focusableElements
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function useMobileSidebarModal({
|
|
41
|
+
backgroundRefs,
|
|
42
|
+
isCompactLayout,
|
|
43
|
+
isMobileSidebarOpen,
|
|
44
|
+
setIsMobileSidebarOpen,
|
|
45
|
+
sheetRef
|
|
46
|
+
}: {
|
|
47
|
+
backgroundRefs: Array<RefObject<HTMLElement | null>>
|
|
48
|
+
isCompactLayout: boolean
|
|
49
|
+
isMobileSidebarOpen: boolean
|
|
50
|
+
setIsMobileSidebarOpen: (nextOpen: boolean) => void
|
|
51
|
+
sheetRef: RefObject<HTMLDivElement | null>
|
|
52
|
+
}) {
|
|
53
|
+
const restoreFocusRef = useRef<HTMLElement | null>(null)
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!isCompactLayout) {
|
|
57
|
+
backgroundRefs.forEach((ref) => {
|
|
58
|
+
ref.current?.removeAttribute('inert')
|
|
59
|
+
})
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
backgroundRefs.forEach((ref) => {
|
|
64
|
+
const element = ref.current
|
|
65
|
+
if (element == null) {
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (isMobileSidebarOpen) {
|
|
70
|
+
element.setAttribute('inert', '')
|
|
71
|
+
} else {
|
|
72
|
+
element.removeAttribute('inert')
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
return () => {
|
|
77
|
+
backgroundRefs.forEach((ref) => {
|
|
78
|
+
ref.current?.removeAttribute('inert')
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
}, [backgroundRefs, isCompactLayout, isMobileSidebarOpen])
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (!isCompactLayout || !isMobileSidebarOpen) {
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const activeElement = document.activeElement
|
|
89
|
+
restoreFocusRef.current = activeElement instanceof HTMLElement ? activeElement : null
|
|
90
|
+
|
|
91
|
+
const focusFrame = window.requestAnimationFrame(() => {
|
|
92
|
+
const sheet = sheetRef.current
|
|
93
|
+
if (sheet == null) {
|
|
94
|
+
return
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
focusFirstElement(sheet)
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
101
|
+
if (event.key === 'Escape') {
|
|
102
|
+
setIsMobileSidebarOpen(false)
|
|
103
|
+
return
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (event.key !== 'Tab') {
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const sheet = sheetRef.current
|
|
111
|
+
if (sheet == null) {
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const focusableElements = getFocusableElements(sheet)
|
|
116
|
+
if (focusableElements.length === 0) {
|
|
117
|
+
event.preventDefault()
|
|
118
|
+
focusElement(sheet)
|
|
119
|
+
return
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const firstElement = focusableElements[0]
|
|
123
|
+
const lastElement = focusableElements[focusableElements.length - 1]
|
|
124
|
+
const activeTarget = document.activeElement
|
|
125
|
+
|
|
126
|
+
if (event.shiftKey) {
|
|
127
|
+
if (activeTarget === firstElement || activeTarget === sheet) {
|
|
128
|
+
event.preventDefault()
|
|
129
|
+
focusElement(lastElement)
|
|
130
|
+
}
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (activeTarget === lastElement) {
|
|
135
|
+
event.preventDefault()
|
|
136
|
+
focusElement(firstElement)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const handleFocusIn = (event: FocusEvent) => {
|
|
141
|
+
const sheet = sheetRef.current
|
|
142
|
+
const focusTarget = event.target
|
|
143
|
+
if (sheet == null || !(focusTarget instanceof HTMLElement)) {
|
|
144
|
+
return
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (sheet.contains(focusTarget)) {
|
|
148
|
+
return
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
focusFirstElement(sheet)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
window.addEventListener('keydown', handleKeyDown)
|
|
155
|
+
document.addEventListener('focusin', handleFocusIn)
|
|
156
|
+
return () => {
|
|
157
|
+
window.cancelAnimationFrame(focusFrame)
|
|
158
|
+
window.removeEventListener('keydown', handleKeyDown)
|
|
159
|
+
document.removeEventListener('focusin', handleFocusIn)
|
|
160
|
+
|
|
161
|
+
const restoreFocusTarget = restoreFocusRef.current
|
|
162
|
+
if (restoreFocusTarget != null && document.contains(restoreFocusTarget)) {
|
|
163
|
+
window.requestAnimationFrame(() => {
|
|
164
|
+
if (document.contains(restoreFocusTarget)) {
|
|
165
|
+
focusElement(restoreFocusTarget)
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
restoreFocusRef.current = null
|
|
170
|
+
}
|
|
171
|
+
}, [isCompactLayout, isMobileSidebarOpen, setIsMobileSidebarOpen, sheetRef])
|
|
172
|
+
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
if (!isCompactLayout || !isMobileSidebarOpen) {
|
|
175
|
+
return
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const { body, documentElement } = document
|
|
179
|
+
const previousBodyOverflow = body.style.overflow
|
|
180
|
+
const previousDocumentOverflow = documentElement.style.overflow
|
|
181
|
+
|
|
182
|
+
body.style.overflow = 'hidden'
|
|
183
|
+
documentElement.style.overflow = 'hidden'
|
|
184
|
+
|
|
185
|
+
return () => {
|
|
186
|
+
body.style.overflow = previousBodyOverflow
|
|
187
|
+
documentElement.style.overflow = previousDocumentOverflow
|
|
188
|
+
}
|
|
189
|
+
}, [isCompactLayout, isMobileSidebarOpen])
|
|
190
|
+
}
|