@justanarthur/modo-ui-ai 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/LICENSE.fluid-functionalism +21 -0
- package/README.md +105 -2
- package/blocks/conversation/agent-prompt/examples.mdx +44 -0
- package/blocks/conversation/agent-prompt/index.tsx +114 -0
- package/blocks/conversation/composer/draft.css +25 -0
- package/blocks/conversation/composer/draft.tsx +589 -0
- package/blocks/conversation/composer/examples.mdx +164 -0
- package/blocks/conversation/composer/file-preview-tile.tsx +59 -0
- package/blocks/conversation/composer/file-thumbnail.tsx +146 -0
- package/blocks/conversation/composer/index.tsx +651 -0
- package/blocks/conversation/composer/queued-row.tsx +102 -0
- package/blocks/conversation/composer/shared.ts +38 -0
- package/blocks/conversation/composer/suggestion-row.tsx +64 -0
- package/blocks/conversation/composer/use-composer-files.ts +142 -0
- package/blocks/conversation/composer/use-history-nav.ts +60 -0
- package/blocks/conversation/composer/use-message-queue.ts +108 -0
- package/blocks/conversation/composer/use-region-height.ts +34 -0
- package/blocks/conversation/failure-states/examples.mdx +58 -0
- package/blocks/conversation/failure-states/index.tsx +274 -0
- package/blocks/conversation/transcript/examples.mdx +43 -0
- package/blocks/conversation/transcript/index.tsx +206 -0
- package/blocks/conversation/transcript-search/examples.mdx +50 -0
- package/blocks/conversation/transcript-search/index.tsx +469 -0
- package/blocks/dialogs/command-palette/examples.mdx +50 -0
- package/blocks/dialogs/command-palette/index.tsx +239 -0
- package/blocks/dialogs/hook-dialog/examples.mdx +44 -0
- package/blocks/dialogs/hook-dialog/index.tsx +286 -0
- package/blocks/dialogs/mcp-server-dialog/examples.mdx +57 -0
- package/blocks/dialogs/mcp-server-dialog/index.tsx +415 -0
- package/blocks/dialogs/shortcuts-sheet/examples.mdx +36 -0
- package/blocks/dialogs/shortcuts-sheet/index.tsx +186 -0
- package/blocks/panes/artifacts-pane/examples.mdx +23 -0
- package/blocks/panes/artifacts-pane/index.tsx +82 -0
- package/blocks/panes/changes-pane/examples.mdx +23 -0
- package/blocks/panes/changes-pane/index.tsx +248 -0
- package/blocks/panes/file-pane/examples.mdx +13 -0
- package/blocks/panes/file-pane/index.tsx +102 -0
- package/blocks/panes/pr-pane/examples.mdx +13 -0
- package/blocks/panes/pr-pane/index.tsx +191 -0
- package/blocks/panes/side-pane/examples.mdx +58 -0
- package/blocks/panes/side-pane/index.tsx +187 -0
- package/blocks/panes/tasks-pane/examples.mdx +23 -0
- package/blocks/panes/tasks-pane/index.tsx +127 -0
- package/blocks/panes/terminal-pane/examples.mdx +13 -0
- package/blocks/panes/terminal-pane/index.tsx +99 -0
- package/blocks/panes/usage-pane/examples.mdx +23 -0
- package/blocks/panes/usage-pane/index.tsx +78 -0
- package/blocks/profiles/profile-onboarding/examples.mdx +80 -0
- package/blocks/profiles/profile-onboarding/index.tsx +580 -0
- package/blocks/profiles/profile-switcher/examples.mdx +29 -0
- package/blocks/profiles/profile-switcher/index.tsx +212 -0
- package/blocks/profiles/profile-usage/examples.mdx +41 -0
- package/blocks/profiles/profile-usage/index.tsx +141 -0
- package/blocks/sessions/inbox/examples.mdx +35 -0
- package/blocks/sessions/inbox/index.tsx +372 -0
- package/blocks/sessions/session-board/examples.mdx +34 -0
- package/blocks/sessions/session-board/index.tsx +570 -0
- package/blocks/sessions/session-sidebar/examples.mdx +93 -0
- package/blocks/sessions/session-sidebar/index.tsx +497 -0
- package/blocks/settings/extensions/examples.mdx +10 -0
- package/blocks/settings/extensions/index.tsx +72 -0
- package/blocks/settings/hooks/examples.mdx +16 -0
- package/blocks/settings/hooks/index.tsx +127 -0
- package/blocks/settings/mcp-servers/examples.mdx +26 -0
- package/blocks/settings/mcp-servers/index.tsx +204 -0
- package/blocks/settings/memory/examples.mdx +22 -0
- package/blocks/settings/memory/index.tsx +113 -0
- package/blocks/settings/notifications/examples.mdx +8 -0
- package/blocks/settings/notifications/index.tsx +63 -0
- package/blocks/settings/permission-rules/examples.mdx +37 -0
- package/blocks/settings/permission-rules/index.tsx +317 -0
- package/blocks/settings/plugin-catalog/examples.mdx +52 -0
- package/blocks/settings/plugin-catalog/index.tsx +407 -0
- package/blocks/settings/plugins/examples.mdx +10 -0
- package/blocks/settings/plugins/index.tsx +72 -0
- package/blocks/settings/settings-window/examples.mdx +40 -0
- package/blocks/settings/settings-window/index.tsx +188 -0
- package/blocks/settings/worktrees/examples.mdx +17 -0
- package/blocks/settings/worktrees/index.tsx +145 -0
- package/components/conversation/agent-run/examples.mdx +38 -0
- package/components/conversation/agent-run/index.tsx +83 -0
- package/components/conversation/chapter-nav/examples.mdx +30 -0
- package/components/conversation/chapter-nav/index.tsx +123 -0
- package/components/conversation/message/examples.mdx +53 -0
- package/components/conversation/message/index.tsx +130 -0
- package/components/conversation/message/working.tsx +102 -0
- package/components/conversation/reasoning/examples.mdx +32 -0
- package/components/conversation/reasoning/index.tsx +55 -0
- package/components/conversation/recap/examples.mdx +21 -0
- package/components/conversation/recap/index.tsx +67 -0
- package/components/conversation/todo-list/examples.mdx +32 -0
- package/components/conversation/todo-list/index.tsx +106 -0
- package/components/conversation/tool-call/examples.mdx +48 -0
- package/components/conversation/tool-call/index.tsx +142 -0
- package/components/conversation/work-summary/examples.mdx +50 -0
- package/components/conversation/work-summary/index.tsx +87 -0
- package/components/prompts/permission-request/examples.mdx +32 -0
- package/components/prompts/permission-request/index.tsx +74 -0
- package/components/prompts/plan-approval/examples.mdx +37 -0
- package/components/prompts/plan-approval/index.tsx +76 -0
- package/components/prompts/prompt-card/examples.mdx +31 -0
- package/components/prompts/prompt-card/index.tsx +82 -0
- package/components/prompts/question-prompt/examples.mdx +46 -0
- package/components/prompts/question-prompt/index.tsx +118 -0
- package/dist/blocks/conversation/agent-prompt/index.d.ts +7 -0
- package/dist/blocks/conversation/agent-prompt/index.js +13 -0
- package/dist/blocks/conversation/composer/index.d.ts +4 -0
- package/dist/blocks/conversation/composer/index.js +16 -0
- package/dist/blocks/conversation/failure-states/index.d.ts +4 -0
- package/dist/blocks/conversation/failure-states/index.js +8 -0
- package/dist/blocks/conversation/transcript/index.d.ts +50 -0
- package/dist/blocks/conversation/transcript/index.js +17 -0
- package/dist/blocks/conversation/transcript-search/index.d.ts +4 -0
- package/dist/blocks/conversation/transcript-search/index.js +11 -0
- package/dist/blocks/dialogs/command-palette/index.d.ts +5 -0
- package/dist/blocks/dialogs/command-palette/index.js +20 -0
- package/dist/blocks/dialogs/hook-dialog/index.d.ts +3 -0
- package/dist/blocks/dialogs/hook-dialog/index.js +12 -0
- package/dist/blocks/dialogs/mcp-server-dialog/index.d.ts +5 -0
- package/dist/blocks/dialogs/mcp-server-dialog/index.js +12 -0
- package/dist/blocks/dialogs/shortcuts-sheet/index.d.ts +2 -0
- package/dist/blocks/dialogs/shortcuts-sheet/index.js +11 -0
- package/dist/blocks/panes/artifacts-pane/index.d.ts +3 -0
- package/dist/blocks/panes/artifacts-pane/index.js +9 -0
- package/dist/blocks/panes/changes-pane/index.d.ts +3 -0
- package/dist/blocks/panes/changes-pane/index.js +9 -0
- package/dist/blocks/panes/file-pane/index.d.ts +3 -0
- package/dist/blocks/panes/file-pane/index.js +9 -0
- package/dist/blocks/panes/pr-pane/index.d.ts +3 -0
- package/dist/blocks/panes/pr-pane/index.js +10 -0
- package/dist/blocks/panes/side-pane/index.d.ts +5 -0
- package/dist/blocks/panes/side-pane/index.js +21 -0
- package/dist/blocks/panes/tasks-pane/index.d.ts +3 -0
- package/dist/blocks/panes/tasks-pane/index.js +10 -0
- package/dist/blocks/panes/terminal-pane/index.d.ts +3 -0
- package/dist/blocks/panes/terminal-pane/index.js +9 -0
- package/dist/blocks/panes/usage-pane/index.d.ts +4 -0
- package/dist/blocks/panes/usage-pane/index.js +11 -0
- package/dist/blocks/profiles/profile-onboarding/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-onboarding/index.js +11 -0
- package/dist/blocks/profiles/profile-switcher/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-switcher/index.js +12 -0
- package/dist/blocks/profiles/profile-usage/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-usage/index.js +10 -0
- package/dist/blocks/sessions/inbox/index.d.ts +2 -0
- package/dist/blocks/sessions/inbox/index.js +11 -0
- package/dist/blocks/sessions/session-board/index.d.ts +4 -0
- package/dist/blocks/sessions/session-board/index.js +27 -0
- package/dist/blocks/sessions/session-sidebar/index.d.ts +5 -0
- package/dist/blocks/sessions/session-sidebar/index.js +15 -0
- package/dist/blocks/settings/extensions/index.d.ts +2 -0
- package/dist/blocks/settings/extensions/index.js +9 -0
- package/dist/blocks/settings/hooks/index.d.ts +4 -0
- package/dist/blocks/settings/hooks/index.js +9 -0
- package/dist/blocks/settings/mcp-servers/index.d.ts +4 -0
- package/dist/blocks/settings/mcp-servers/index.js +9 -0
- package/dist/blocks/settings/memory/index.d.ts +4 -0
- package/dist/blocks/settings/memory/index.js +8 -0
- package/dist/blocks/settings/notifications/index.d.ts +2 -0
- package/dist/blocks/settings/notifications/index.js +8 -0
- package/dist/blocks/settings/permission-rules/index.d.ts +3 -0
- package/dist/blocks/settings/permission-rules/index.js +10 -0
- package/dist/blocks/settings/plugin-catalog/index.d.ts +2 -0
- package/dist/blocks/settings/plugin-catalog/index.js +11 -0
- package/dist/blocks/settings/plugins/index.d.ts +4 -0
- package/dist/blocks/settings/plugins/index.js +9 -0
- package/dist/blocks/settings/settings-window/index.d.ts +4 -0
- package/dist/blocks/settings/settings-window/index.js +8 -0
- package/dist/blocks/settings/worktrees/index.d.ts +4 -0
- package/dist/blocks/settings/worktrees/index.js +9 -0
- package/dist/components/conversation/agent-run/index.d.ts +3 -0
- package/dist/components/conversation/agent-run/index.js +10 -0
- package/dist/components/conversation/chapter-nav/index.d.ts +2 -0
- package/dist/components/conversation/chapter-nav/index.js +11 -0
- package/dist/components/conversation/message/index.d.ts +2 -0
- package/dist/components/conversation/message/index.js +15 -0
- package/dist/components/conversation/reasoning/index.d.ts +2 -0
- package/dist/components/conversation/reasoning/index.js +8 -0
- package/dist/components/conversation/recap/index.d.ts +2 -0
- package/dist/components/conversation/recap/index.js +9 -0
- package/dist/components/conversation/todo-list/index.d.ts +2 -0
- package/dist/components/conversation/todo-list/index.js +9 -0
- package/dist/components/conversation/tool-call/index.d.ts +3 -0
- package/dist/components/conversation/tool-call/index.js +13 -0
- package/dist/components/conversation/work-summary/index.d.ts +2 -0
- package/dist/components/conversation/work-summary/index.js +10 -0
- package/dist/components/prompts/permission-request/index.d.ts +2 -0
- package/dist/components/prompts/permission-request/index.js +9 -0
- package/dist/components/prompts/plan-approval/index.d.ts +2 -0
- package/dist/components/prompts/plan-approval/index.js +9 -0
- package/dist/components/prompts/prompt-card/index.d.ts +3 -0
- package/dist/components/prompts/prompt-card/index.js +8 -0
- package/dist/components/prompts/question-prompt/index.d.ts +2 -0
- package/dist/components/prompts/question-prompt/index.js +9 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +231 -0
- package/dist/lib/config-parts.d.ts +2 -0
- package/dist/lib/config-parts.js +16 -0
- package/dist/lib/icons.d.ts +2 -0
- package/dist/lib/icons.js +10 -0
- package/dist/lib/pace-bar.d.ts +11 -0
- package/dist/lib/pace-bar.js +6 -0
- package/dist/lib/pace.d.ts +4 -0
- package/dist/lib/pace.js +14 -0
- package/dist/lib/pane-parts.d.ts +25 -0
- package/dist/lib/pane-parts.js +11 -0
- package/dist/lib/row-trigger.d.ts +5 -0
- package/dist/lib/row-trigger.js +7 -0
- package/dist/lib/settings-parts.d.ts +70 -0
- package/dist/lib/settings-parts.js +24 -0
- package/dist/lib/side-pane-types.d.ts +2 -0
- package/dist/lib/side-pane-types.js +1 -0
- package/dist/lib/status-glyph.d.ts +8 -0
- package/dist/lib/status-glyph.js +12 -0
- package/dist/lib/types.d.ts +3 -0
- package/dist/lib/types.js +1 -0
- package/dist/shared/chunk-04a497rr.js +21 -0
- package/dist/shared/chunk-13yf0mza.d.ts +70 -0
- package/dist/shared/chunk-1hzrm8r5.d.ts +51 -0
- package/dist/shared/chunk-1qdwg7w5.d.ts +81 -0
- package/dist/shared/chunk-1yt061np.d.ts +64 -0
- package/dist/shared/chunk-218qabm5.js +250 -0
- package/dist/shared/chunk-2fk5aq60.js +313 -0
- package/dist/shared/chunk-3ps5h55t.d.ts +30 -0
- package/dist/shared/chunk-3yaftgh0.d.ts +28 -0
- package/dist/shared/chunk-4zvhpf2x.js +55 -0
- package/dist/shared/chunk-57hzzmjd.d.ts +67 -0
- package/dist/shared/chunk-58jh3mje.js +46 -0
- package/dist/shared/chunk-58qvny6a.d.ts +29 -0
- package/dist/shared/chunk-5fhkkn39.js +130 -0
- package/dist/shared/chunk-5hw0525a.d.ts +33 -0
- package/dist/shared/chunk-5meda998.js +238 -0
- package/dist/shared/chunk-5pqksw7z.js +91 -0
- package/dist/shared/chunk-6220dy5n.js +70 -0
- package/dist/shared/chunk-64bnh22t.d.ts +59 -0
- package/dist/shared/chunk-66sh633m.d.ts +60 -0
- package/dist/shared/chunk-6cmf27g3.d.ts +81 -0
- package/dist/shared/chunk-6kwk9vag.js +558 -0
- package/dist/shared/chunk-6rdwkymk.js +177 -0
- package/dist/shared/chunk-71j8qzvb.d.ts +57 -0
- package/dist/shared/chunk-74bvf3tw.d.ts +21 -0
- package/dist/shared/chunk-75zwypyr.d.ts +43 -0
- package/dist/shared/chunk-7mfer3tp.js +176 -0
- package/dist/shared/chunk-7rzjmcnh.d.ts +30 -0
- package/dist/shared/chunk-7zvb39cf.d.ts +26 -0
- package/dist/shared/chunk-8mecznyr.js +357 -0
- package/dist/shared/chunk-8pag6vmd.js +255 -0
- package/dist/shared/chunk-94grzz9f.js +187 -0
- package/dist/shared/chunk-9kw6m047.d.ts +32 -0
- package/dist/shared/chunk-at0jje23.d.ts +110 -0
- package/dist/shared/chunk-awd573h9.js +34 -0
- package/dist/shared/chunk-b171wjge.d.ts +25 -0
- package/dist/shared/chunk-b4dz15em.d.ts +36 -0
- package/dist/shared/chunk-b5ccp5de.js +35 -0
- package/dist/shared/chunk-bh2b5d1z.js +98 -0
- package/dist/shared/chunk-c36qvrwq.d.ts +30 -0
- package/dist/shared/chunk-c8wp058j.js +153 -0
- package/dist/shared/chunk-d2t72h4x.d.ts +35 -0
- package/dist/shared/chunk-dh3qy5fj.js +49 -0
- package/dist/shared/chunk-dxzrtvt9.d.ts +283 -0
- package/dist/shared/chunk-e46apgve.d.ts +40 -0
- package/dist/shared/chunk-ejtknc0w.js +21 -0
- package/dist/shared/chunk-eqajdxn8.js +82 -0
- package/dist/shared/chunk-fapc805j.js +130 -0
- package/dist/shared/chunk-fm1qyrae.d.ts +68 -0
- package/dist/shared/chunk-fqhcz6ss.d.ts +29 -0
- package/dist/shared/chunk-g88hweqh.d.ts +70 -0
- package/dist/shared/chunk-gb5ee5dw.d.ts +88 -0
- package/dist/shared/chunk-gewnsgza.js +61 -0
- package/dist/shared/chunk-hxjgey30.d.ts +36 -0
- package/dist/shared/chunk-jkkdq1mh.d.ts +213 -0
- package/dist/shared/chunk-jpq101w3.js +91 -0
- package/dist/shared/chunk-k3bv9k1v.d.ts +56 -0
- package/dist/shared/chunk-kreypnzp.d.ts +34 -0
- package/dist/shared/chunk-mnzw0bav.js +80 -0
- package/dist/shared/chunk-mrb3fp2f.d.ts +30 -0
- package/dist/shared/chunk-n1qq2wp9.js +6 -0
- package/dist/shared/chunk-n31qwnj2.js +1544 -0
- package/dist/shared/chunk-n4742y54.js +39 -0
- package/dist/shared/chunk-ndjvdkv7.d.ts +29 -0
- package/dist/shared/chunk-njf851p1.js +245 -0
- package/dist/shared/chunk-nk4578dr.js +73 -0
- package/dist/shared/chunk-nkbgg7bw.d.ts +24 -0
- package/dist/shared/chunk-nvh33x9x.js +488 -0
- package/dist/shared/chunk-paezqfg1.js +106 -0
- package/dist/shared/chunk-qemm9e3r.d.ts +21 -0
- package/dist/shared/chunk-qhxz1etk.js +96 -0
- package/dist/shared/chunk-qj5ev9ak.js +531 -0
- package/dist/shared/chunk-qnwggvjy.js +150 -0
- package/dist/shared/chunk-qt31n444.js +178 -0
- package/dist/shared/chunk-r5hz78pb.js +129 -0
- package/dist/shared/chunk-r6nb21kz.d.ts +102 -0
- package/dist/shared/chunk-rqrpvvz4.d.ts +107 -0
- package/dist/shared/chunk-s3r759ec.js +80 -0
- package/dist/shared/chunk-sdtjrw9w.d.ts +98 -0
- package/dist/shared/chunk-skg3m9m0.js +56 -0
- package/dist/shared/chunk-t21t9x7e.js +188 -0
- package/dist/shared/chunk-tc75ng2c.js +235 -0
- package/dist/shared/chunk-tkx1krwc.js +88 -0
- package/dist/shared/chunk-tprdqtb1.d.ts +30 -0
- package/dist/shared/chunk-tv9a1sek.js +137 -0
- package/dist/shared/chunk-tvbd27hg.d.ts +43 -0
- package/dist/shared/chunk-ty2ccknv.d.ts +54 -0
- package/dist/shared/chunk-v6yevw62.d.ts +28 -0
- package/dist/shared/chunk-v9q38p0x.js +258 -0
- package/dist/shared/chunk-vgh4f3sv.js +118 -0
- package/dist/shared/chunk-vjht1zn1.js +391 -0
- package/dist/shared/chunk-vsrkb0sp.d.ts +21 -0
- package/dist/shared/chunk-whsx7yp9.d.ts +37 -0
- package/dist/shared/chunk-wq9h37gy.js +86 -0
- package/dist/shared/chunk-x7az5x1y.d.ts +57 -0
- package/dist/shared/chunk-x9jf26yb.js +318 -0
- package/dist/shared/chunk-xbrrt07s.d.ts +23 -0
- package/dist/shared/chunk-xkchhs2z.js +129 -0
- package/dist/shared/chunk-xzfrskd7.js +202 -0
- package/dist/shared/chunk-y4cj4y54.js +423 -0
- package/dist/shared/chunk-y934at6m.js +7 -0
- package/dist/shared/chunk-zbpwhpjy.d.ts +75 -0
- package/dist/shared/chunk-zfhmbb7n.js +63 -0
- package/dist/shared/chunk-zk0t4vq5.js +71 -0
- package/dist/shared/chunk-znp9gna7.d.ts +23 -0
- package/dist/styles.css +467 -0
- package/index.ts +49 -0
- package/lib/config-parts.tsx +97 -0
- package/lib/icons.tsx +149 -0
- package/lib/pace-bar.tsx +24 -0
- package/lib/pace.ts +78 -0
- package/lib/pane-parts.tsx +76 -0
- package/lib/row-trigger.tsx +44 -0
- package/lib/settings-parts.tsx +232 -0
- package/lib/side-pane-types.ts +75 -0
- package/lib/status-glyph.tsx +25 -0
- package/lib/types.ts +204 -0
- package/mock/demo-reply.tsx +33 -0
- package/mock/demo-session.tsx +150 -0
- package/mock/mock-config.ts +173 -0
- package/mock/mock-extras.ts +288 -0
- package/mock/mock-panes.ts +190 -0
- package/mock/mock-settings.ts +92 -0
- package/mock/mock.ts +548 -0
- package/mock/screen-frame.tsx +49 -0
- package/package.json +114 -4
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Local addition: the AI app's settings window — a Sidebar of sections
|
|
3
|
+
* (with a search that narrows them) beside the picked section, with a picker
|
|
4
|
+
* for the config dir the scoped sections edit.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use client'
|
|
8
|
+
|
|
9
|
+
import { SidebarSearchField } from '@justanarthur/modo-ui/blocks/sidebar-app'
|
|
10
|
+
import Select from '@justanarthur/modo-ui/components/inputs/select'
|
|
11
|
+
import Sidebar from '@justanarthur/modo-ui/components/navigation/sidebar'
|
|
12
|
+
import { useControllableState } from '@justanarthur/modo-ui/lib/use-controllable-state'
|
|
13
|
+
import { type ReactNode, useState } from 'react'
|
|
14
|
+
import { type IconName, useIcon, useIcons } from '../../../lib/icons'
|
|
15
|
+
import type { Profile } from '../../../lib/types'
|
|
16
|
+
|
|
17
|
+
export interface SettingsWindowSection {
|
|
18
|
+
id: string
|
|
19
|
+
label: string
|
|
20
|
+
icon: IconName
|
|
21
|
+
/** Lives in a config dir, so the scope picker shows while it is open. */
|
|
22
|
+
scoped: boolean
|
|
23
|
+
/** Words the search matches besides the label. */
|
|
24
|
+
keywords: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const PROJECT = { id: 'project', dir: '.claude' }
|
|
28
|
+
|
|
29
|
+
interface SettingsWindowProps {
|
|
30
|
+
/** The sections, in sidebar order. */
|
|
31
|
+
sections: SettingsWindowSection[]
|
|
32
|
+
/** The profiles the scope picker offers, before "This project". */
|
|
33
|
+
profiles: Profile[]
|
|
34
|
+
/** The open section's id (controlled). */
|
|
35
|
+
section?: string
|
|
36
|
+
/** The section that starts open. Defaults to the first section. */
|
|
37
|
+
defaultSection?: string
|
|
38
|
+
/** Called when another section is picked. */
|
|
39
|
+
onSectionChange?: (section: string) => void
|
|
40
|
+
/** The profile id (or `'project'`) whose config dir the scoped sections edit (controlled). */
|
|
41
|
+
scope?: string
|
|
42
|
+
/** The scope at first. Defaults to the first profile. */
|
|
43
|
+
defaultScope?: string
|
|
44
|
+
/** Called when another scope is picked. */
|
|
45
|
+
onScopeChange?: (scope: string) => void
|
|
46
|
+
/** Start with the section list open. Defaults to `true`. */
|
|
47
|
+
sidebar?: boolean
|
|
48
|
+
/** Called when "Back to sessions" is pressed. */
|
|
49
|
+
onBack?: () => void
|
|
50
|
+
/** Called when "Profiles" in the sidebar's footer is pressed: profiles have their own page. */
|
|
51
|
+
onOpenProfiles?: () => void
|
|
52
|
+
/** Renders the open section, given its id and the config dir being edited. */
|
|
53
|
+
children: (section: string, configDir: string) => ReactNode
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The app's settings window: a list of sections on the left, the open one
|
|
58
|
+
* on the right.
|
|
59
|
+
*
|
|
60
|
+
* The search over the section list narrows it by name and by what each
|
|
61
|
+
* section holds ("auth", "sound", "disk"). Sections that live in a config dir
|
|
62
|
+
* show a picker in the header that says which one you are editing (a
|
|
63
|
+
* profile's, or the project's `.claude`) and switches it; the others belong
|
|
64
|
+
* to the app and hide it. Profiles themselves are their own page, linked from
|
|
65
|
+
* the sidebar's footer. The content is yours: `children` renders the open
|
|
66
|
+
* section for the config dir in scope.
|
|
67
|
+
*
|
|
68
|
+
* @example {@include ./examples.mdx}
|
|
69
|
+
*/
|
|
70
|
+
export default function SettingsWindow({
|
|
71
|
+
sections,
|
|
72
|
+
profiles,
|
|
73
|
+
section,
|
|
74
|
+
defaultSection,
|
|
75
|
+
onSectionChange,
|
|
76
|
+
scope,
|
|
77
|
+
defaultScope,
|
|
78
|
+
onScopeChange,
|
|
79
|
+
sidebar = true,
|
|
80
|
+
onBack,
|
|
81
|
+
onOpenProfiles,
|
|
82
|
+
children,
|
|
83
|
+
}: SettingsWindowProps) {
|
|
84
|
+
const [current, setCurrent] = useControllableState(section, defaultSection ?? sections[0]?.id ?? '', onSectionChange)
|
|
85
|
+
const [scopeId, setScopeId] = useControllableState(
|
|
86
|
+
scope,
|
|
87
|
+
defaultScope ?? profiles[0]?.id ?? PROJECT.id,
|
|
88
|
+
onScopeChange,
|
|
89
|
+
)
|
|
90
|
+
const [query, setQuery] = useState('')
|
|
91
|
+
const icons = useIcons()
|
|
92
|
+
const Back = useIcon('arrow-left')
|
|
93
|
+
const Users = useIcon('users')
|
|
94
|
+
const Folder = useIcon('folder')
|
|
95
|
+
const scoped = sections.find(s => s.id === current)?.scoped ?? false
|
|
96
|
+
const configDir =
|
|
97
|
+
scopeId === PROJECT.id ? PROJECT.dir : (profiles.find(p => p.id === scopeId)?.configDir ?? PROJECT.dir)
|
|
98
|
+
const needle = query.trim().toLowerCase()
|
|
99
|
+
const shown = sections.filter(s => `${s.label} ${s.keywords}`.toLowerCase().includes(needle))
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<div className="flex h-full min-h-[640px] w-full bg-background">
|
|
103
|
+
<Sidebar.Provider className="h-full min-h-0" persist={false} mobileBreakpoint={0} defaultOpen={sidebar}>
|
|
104
|
+
<Sidebar variant="inset" className="h-full" value={current} onValueChange={value => setCurrent(value)}>
|
|
105
|
+
<Sidebar.Header>
|
|
106
|
+
<div className="flex flex-col gap-0.5">
|
|
107
|
+
<Sidebar.Menu>
|
|
108
|
+
<Sidebar.MenuItem>
|
|
109
|
+
<Sidebar.MenuButton icon={Back} onClick={onBack}>
|
|
110
|
+
Back to sessions
|
|
111
|
+
</Sidebar.MenuButton>
|
|
112
|
+
</Sidebar.MenuItem>
|
|
113
|
+
</Sidebar.Menu>
|
|
114
|
+
<SidebarSearchField
|
|
115
|
+
placeholder="Search settings"
|
|
116
|
+
shortcut={null}
|
|
117
|
+
value={query}
|
|
118
|
+
onChange={event => setQuery(event.target.value)}
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
</Sidebar.Header>
|
|
122
|
+
<Sidebar.Content>
|
|
123
|
+
<Sidebar.Group>
|
|
124
|
+
<Sidebar.GroupLabel>Settings</Sidebar.GroupLabel>
|
|
125
|
+
{shown.length > 0 ? (
|
|
126
|
+
<Sidebar.Menu>
|
|
127
|
+
{shown.map(s => (
|
|
128
|
+
<Sidebar.MenuItem key={s.id}>
|
|
129
|
+
<Sidebar.MenuButton value={s.id} icon={icons[s.icon]}>
|
|
130
|
+
{s.label}
|
|
131
|
+
</Sidebar.MenuButton>
|
|
132
|
+
</Sidebar.MenuItem>
|
|
133
|
+
))}
|
|
134
|
+
</Sidebar.Menu>
|
|
135
|
+
) : (
|
|
136
|
+
<p className="m-0 px-2 text-caption text-muted-foreground">No settings match “{query.trim()}”</p>
|
|
137
|
+
)}
|
|
138
|
+
</Sidebar.Group>
|
|
139
|
+
</Sidebar.Content>
|
|
140
|
+
<Sidebar.Footer>
|
|
141
|
+
<Sidebar.Menu>
|
|
142
|
+
<Sidebar.MenuItem>
|
|
143
|
+
<Sidebar.MenuButton icon={Users} onClick={onOpenProfiles}>
|
|
144
|
+
Profiles
|
|
145
|
+
</Sidebar.MenuButton>
|
|
146
|
+
</Sidebar.MenuItem>
|
|
147
|
+
</Sidebar.Menu>
|
|
148
|
+
</Sidebar.Footer>
|
|
149
|
+
</Sidebar>
|
|
150
|
+
<Sidebar.Inset className="@container min-h-0 min-w-0 overflow-auto">
|
|
151
|
+
<header className="flex h-12 shrink-0 items-center gap-2 px-1.5">
|
|
152
|
+
<Sidebar.Trigger />
|
|
153
|
+
<span className="text-body weight-medium text-foreground">Settings</span>
|
|
154
|
+
{scoped && (
|
|
155
|
+
<div className="ml-auto flex min-w-0 items-center gap-2">
|
|
156
|
+
<span className="hidden min-w-0 truncate text-caption text-muted-foreground @2xl:inline">
|
|
157
|
+
Editing <span className="font-mono">{configDir}</span>
|
|
158
|
+
</span>
|
|
159
|
+
<Select value={scopeId} onValueChange={setScopeId} size="compact">
|
|
160
|
+
<Select.Trigger variant="borderless" icon={Folder} aria-label="Config dir" />
|
|
161
|
+
<Select.Content>
|
|
162
|
+
<Select.Label>Profiles</Select.Label>
|
|
163
|
+
{profiles.map((profile, i) => (
|
|
164
|
+
<Select.Item key={profile.id} index={i} value={profile.id}>
|
|
165
|
+
{profile.name}
|
|
166
|
+
</Select.Item>
|
|
167
|
+
))}
|
|
168
|
+
<Select.Separator />
|
|
169
|
+
<Select.Item index={profiles.length} value={PROJECT.id}>
|
|
170
|
+
This project
|
|
171
|
+
</Select.Item>
|
|
172
|
+
</Select.Content>
|
|
173
|
+
</Select>
|
|
174
|
+
</div>
|
|
175
|
+
)}
|
|
176
|
+
</header>
|
|
177
|
+
<main className="mx-auto flex w-full max-w-3xl flex-col px-6 pb-8 pt-4 [contain:inline-size]">
|
|
178
|
+
{children(current, configDir)}
|
|
179
|
+
</main>
|
|
180
|
+
</Sidebar.Inset>
|
|
181
|
+
</Sidebar.Provider>
|
|
182
|
+
</div>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type { SettingsWindowProps }
|
|
187
|
+
|
|
188
|
+
export { SettingsWindow }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Worktrees from './index'
|
|
2
|
+
import { WORKTREES } from '../../../mock/mock'
|
|
3
|
+
import { WORKTREES_ON_DISK } from '../../../mock/mock-settings'
|
|
4
|
+
|
|
5
|
+
# Worktrees
|
|
6
|
+
|
|
7
|
+
Hover a merged or stale worktree to remove it, or open it for its path and what removing it costs.
|
|
8
|
+
|
|
9
|
+
<div className="@container w-full max-w-3xl">
|
|
10
|
+
<Worktrees worktrees={WORKTREES} onDisk={WORKTREES_ON_DISK} />
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
# Open
|
|
14
|
+
|
|
15
|
+
<div className="@container w-full max-w-3xl">
|
|
16
|
+
<Worktrees worktrees={WORKTREES} onDisk={WORKTREES_ON_DISK} defaultOpen={['.worktrees/lib-canvas']} />
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Local addition: the settings screen's worktrees section — each session's
|
|
3
|
+
* checkout with its state and size, removable on hover once merged or stale.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use client'
|
|
7
|
+
|
|
8
|
+
import Button from '@justanarthur/modo-ui/components/actions/button'
|
|
9
|
+
import Badge from '@justanarthur/modo-ui/components/data-display/badge'
|
|
10
|
+
import Tooltip from '@justanarthur/modo-ui/components/overlays/tooltip'
|
|
11
|
+
import { useIcon } from '../../../lib/icons'
|
|
12
|
+
import { Details, Facts, Group, Mono, ON_HOVER, Row, Section } from '../../../lib/settings-parts'
|
|
13
|
+
import type { Worktree } from '../../../lib/types'
|
|
14
|
+
|
|
15
|
+
const BADGE: Record<Worktree['state'], { color: 'green' | 'gray' | 'amber'; label: string }> = {
|
|
16
|
+
active: { color: 'green', label: 'Active' },
|
|
17
|
+
merged: { color: 'gray', label: 'Merged' },
|
|
18
|
+
stale: { color: 'amber', label: 'Stale' },
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const NOTE: Record<Worktree['state'], string> = {
|
|
22
|
+
active: 'Its session is still running in it.',
|
|
23
|
+
merged: 'Its branch is merged into main; nothing here is lost when it goes.',
|
|
24
|
+
stale: 'No commits for 3 weeks and its session is archived. Uncommitted changes go with it.',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface WorktreesProps {
|
|
28
|
+
/** The sessions' checkouts. */
|
|
29
|
+
worktrees: Worktree[]
|
|
30
|
+
/** Their total size on disk, as the lead says it (`4.4 GB`). */
|
|
31
|
+
onDisk: string
|
|
32
|
+
/** Worktree paths whose rows start open. Defaults to `[]`. */
|
|
33
|
+
defaultOpen?: string[]
|
|
34
|
+
/** Called when "Clean up" (every merged and stale worktree) is pressed. */
|
|
35
|
+
onCleanUp?: () => void
|
|
36
|
+
/** Called when an open worktree's "Open in terminal" is pressed. */
|
|
37
|
+
onOpenTerminal?: (worktree: Worktree) => void
|
|
38
|
+
/** Called when a worktree's Remove is pressed, from its row or its card. */
|
|
39
|
+
onRemove?: (worktree: Worktree) => void
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The checkouts sessions work in, and what they cost on disk.
|
|
44
|
+
*
|
|
45
|
+
* A row names the session over its branch, with its state and size on the
|
|
46
|
+
* right. A merged or stale worktree can go: its remove button sits at the
|
|
47
|
+
* row's end on hover (always shown on touch), and Clean up on top removes
|
|
48
|
+
* them all. Press a row and it lifts into a card that says what removing it
|
|
49
|
+
* costs, with its path, branch and size.
|
|
50
|
+
*
|
|
51
|
+
* @example {@include ./examples.mdx}
|
|
52
|
+
*/
|
|
53
|
+
export default function Worktrees({
|
|
54
|
+
worktrees,
|
|
55
|
+
onDisk,
|
|
56
|
+
defaultOpen,
|
|
57
|
+
onCleanUp,
|
|
58
|
+
onOpenTerminal,
|
|
59
|
+
onRemove,
|
|
60
|
+
}: WorktreesProps) {
|
|
61
|
+
const Trash = useIcon('trash')
|
|
62
|
+
const Terminal = useIcon('terminal')
|
|
63
|
+
const removable = worktrees.filter(w => w.state !== 'active')
|
|
64
|
+
return (
|
|
65
|
+
<Section
|
|
66
|
+
title="Worktrees"
|
|
67
|
+
lead={`Sessions that work in their own checkout. ${onDisk} on disk; merged and stale ones can go.`}
|
|
68
|
+
actions={
|
|
69
|
+
<Button size="compact" variant="tertiary" leadingIcon={Trash} onClick={onCleanUp}>
|
|
70
|
+
Clean up {removable.length}
|
|
71
|
+
</Button>
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<Group title="Checkouts" aside={<span className="tabular-nums">{worktrees.length}</span>}>
|
|
75
|
+
<Details label="Worktrees" actions="icon" defaultOpen={defaultOpen}>
|
|
76
|
+
{worktrees.map((worktree, i) => (
|
|
77
|
+
<Row
|
|
78
|
+
key={worktree.path}
|
|
79
|
+
value={worktree.path}
|
|
80
|
+
index={i}
|
|
81
|
+
label={worktree.session}
|
|
82
|
+
caption={<span className="font-mono">{worktree.branch}</span>}
|
|
83
|
+
meta={
|
|
84
|
+
<>
|
|
85
|
+
<Badge size="compact" variant="dot" color={BADGE[worktree.state].color}>
|
|
86
|
+
{BADGE[worktree.state].label}
|
|
87
|
+
</Badge>
|
|
88
|
+
<span className="hidden w-14 text-right text-caption tabular-nums @md:inline">{worktree.size}</span>
|
|
89
|
+
</>
|
|
90
|
+
}
|
|
91
|
+
action={
|
|
92
|
+
worktree.state !== 'active' && (
|
|
93
|
+
<Tooltip content="Remove worktree" side="top">
|
|
94
|
+
<Button
|
|
95
|
+
size="icon-compact"
|
|
96
|
+
variant="ghost"
|
|
97
|
+
aria-label={`Remove ${worktree.path}`}
|
|
98
|
+
className={ON_HOVER}
|
|
99
|
+
onClick={() => onRemove?.(worktree)}
|
|
100
|
+
>
|
|
101
|
+
<Trash />
|
|
102
|
+
</Button>
|
|
103
|
+
</Tooltip>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
>
|
|
107
|
+
<p className="m-0 text-body text-foreground">{NOTE[worktree.state]}</p>
|
|
108
|
+
<Facts
|
|
109
|
+
items={[
|
|
110
|
+
['Path', <Mono key="p">{worktree.path}</Mono>],
|
|
111
|
+
['Branch', <Mono key="b">{worktree.branch}</Mono>],
|
|
112
|
+
[
|
|
113
|
+
'On disk',
|
|
114
|
+
<span key="s" className="tabular-nums">
|
|
115
|
+
{worktree.size}
|
|
116
|
+
</span>,
|
|
117
|
+
],
|
|
118
|
+
]}
|
|
119
|
+
/>
|
|
120
|
+
<div className="flex justify-end gap-[var(--space-1)]">
|
|
121
|
+
<Button
|
|
122
|
+
size="compact"
|
|
123
|
+
variant="ghost"
|
|
124
|
+
leadingIcon={Terminal}
|
|
125
|
+
onClick={() => onOpenTerminal?.(worktree)}
|
|
126
|
+
>
|
|
127
|
+
Open in terminal
|
|
128
|
+
</Button>
|
|
129
|
+
{worktree.state !== 'active' && (
|
|
130
|
+
<Button size="compact" variant="ghost" leadingIcon={Trash} onClick={() => onRemove?.(worktree)}>
|
|
131
|
+
Remove
|
|
132
|
+
</Button>
|
|
133
|
+
)}
|
|
134
|
+
</div>
|
|
135
|
+
</Row>
|
|
136
|
+
))}
|
|
137
|
+
</Details>
|
|
138
|
+
</Group>
|
|
139
|
+
</Section>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type { WorktreesProps }
|
|
144
|
+
|
|
145
|
+
export { Worktrees }
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import AgentRun from './index'
|
|
2
|
+
import ToolCall from '../tool-call'
|
|
3
|
+
|
|
4
|
+
# Sub-agent
|
|
5
|
+
|
|
6
|
+
The run frames its own calls and ends with its report.
|
|
7
|
+
|
|
8
|
+
<div className="w-full max-w-2xl">
|
|
9
|
+
<AgentRun agent="Explore" description="Find every overlay that skips the morph layer" meta="22 tool uses · 1m 04s">
|
|
10
|
+
<ToolCall.Group>
|
|
11
|
+
<ToolCall index={0} value="g" tool="Grep" summary={'"Popup" components/overlays'} meta="9 files" />
|
|
12
|
+
<ToolCall index={1} value="r" tool="Read" summary="components/overlays/toast/index.tsx" meta="402 lines" />
|
|
13
|
+
</ToolCall.Group>
|
|
14
|
+
<p className="m-0 text-body text-muted-foreground">Every overlay grows through useMorph; none hand-rolls its motion.</p>
|
|
15
|
+
</AgentRun>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
# Background
|
|
19
|
+
|
|
20
|
+
A background run carries a badge and keeps turning after the turn ends.
|
|
21
|
+
|
|
22
|
+
<div className="w-full max-w-2xl">
|
|
23
|
+
<AgentRun agent="general-purpose" description="Run the full test suite on main" status="running" background meta="3 tool uses" />
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
# Waiting on you
|
|
27
|
+
|
|
28
|
+
Held on a permission or a question: the warning dot, as on a waiting ToolCall.
|
|
29
|
+
|
|
30
|
+
<div className="w-full max-w-2xl">
|
|
31
|
+
<AgentRun agent="general-purpose" description="Migrate the settings store" status="waiting" meta="7 tool uses" />
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
# Failed
|
|
35
|
+
|
|
36
|
+
<div className="w-full max-w-2xl">
|
|
37
|
+
<AgentRun agent="researcher" icon="globe" description="Compare three charting libraries" status="error" meta="5 tool uses · 12s" />
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Local addition (not part of Fluid Functionalism): a sub-agent or background
|
|
3
|
+
* agent's run, framed as a card with its own tool calls and report inside.
|
|
4
|
+
* Generalised from the AI app's transcript.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use client'
|
|
8
|
+
|
|
9
|
+
import Badge from '@justanarthur/modo-ui/components/data-display/badge'
|
|
10
|
+
import { useShape } from '@justanarthur/modo-ui/lib/shape-context'
|
|
11
|
+
import { cn } from '@justanarthur/modo-ui/lib/utils'
|
|
12
|
+
import type { ReactNode } from 'react'
|
|
13
|
+
import { type IconName, useIcon } from '../../../lib/icons'
|
|
14
|
+
import { ToolStatusMark } from '../tool-call'
|
|
15
|
+
|
|
16
|
+
type AgentRunStatus = 'running' | 'waiting' | 'done' | 'error'
|
|
17
|
+
|
|
18
|
+
interface AgentRunProps {
|
|
19
|
+
/** The agent's name or type: `Explore`, `researcher`, a custom agent. */
|
|
20
|
+
agent: string
|
|
21
|
+
/** What it was asked to do, in a few words. */
|
|
22
|
+
description: string
|
|
23
|
+
/** Where it stands: `'waiting'` while it is held on you (a permission, a question). Defaults to `'done'`. */
|
|
24
|
+
status?: AgentRunStatus
|
|
25
|
+
/** Ran detached: the conversation went on without waiting. Defaults to `false`. */
|
|
26
|
+
background?: boolean
|
|
27
|
+
/** The run's tally: `14 tool uses · 38s`. */
|
|
28
|
+
meta?: string
|
|
29
|
+
/** The glyph before the name. Defaults to `'bot'`. */
|
|
30
|
+
icon?: IconName
|
|
31
|
+
/** Its calls (a `ToolCall.Group`) and its report. */
|
|
32
|
+
children?: ReactNode
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A run an AI handed to another agent: a framed card with what it was asked,
|
|
37
|
+
* its calls and its report.
|
|
38
|
+
*
|
|
39
|
+
* The header names the agent and its task, with the tally and the run's
|
|
40
|
+
* state on the right (the Spinner while it runs, the warning dot while it
|
|
41
|
+
* waits on you, the failed mark on error).
|
|
42
|
+
* A background run carries a badge: the conversation went on without
|
|
43
|
+
* waiting for it. Inside, a `ToolCall.Group` lists its calls and a line of
|
|
44
|
+
* text its report.
|
|
45
|
+
*
|
|
46
|
+
* @example {@include ./examples.mdx}
|
|
47
|
+
*/
|
|
48
|
+
function AgentRun({
|
|
49
|
+
agent,
|
|
50
|
+
description,
|
|
51
|
+
status = 'done',
|
|
52
|
+
background = false,
|
|
53
|
+
meta,
|
|
54
|
+
icon = 'bot',
|
|
55
|
+
children,
|
|
56
|
+
}: AgentRunProps) {
|
|
57
|
+
const shape = useShape()
|
|
58
|
+
const Icon = useIcon(icon)
|
|
59
|
+
return (
|
|
60
|
+
<div className={cn('flex flex-col gap-2 border border-border p-[var(--space-3)]', shape.container)}>
|
|
61
|
+
<div className="flex min-w-0 items-center gap-2">
|
|
62
|
+
<Icon size={16} strokeWidth={1.5} className="shrink-0 text-muted-foreground" />
|
|
63
|
+
<span className="shrink-0 text-body weight-medium text-foreground">{agent}</span>
|
|
64
|
+
<span className="min-w-0 truncate text-body text-muted-foreground">{description}</span>
|
|
65
|
+
{background && (
|
|
66
|
+
<Badge size="compact" color="gray" className="shrink-0">
|
|
67
|
+
Background
|
|
68
|
+
</Badge>
|
|
69
|
+
)}
|
|
70
|
+
<span className="ml-auto flex shrink-0 items-center gap-2 text-caption text-muted-foreground">
|
|
71
|
+
{meta}
|
|
72
|
+
<ToolStatusMark status={status} />
|
|
73
|
+
</span>
|
|
74
|
+
</div>
|
|
75
|
+
{children}
|
|
76
|
+
</div>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type { AgentRunProps, AgentRunStatus }
|
|
81
|
+
export { AgentRun }
|
|
82
|
+
|
|
83
|
+
export default AgentRun
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import ChapterNav from './index'
|
|
2
|
+
|
|
3
|
+
# Chapters
|
|
4
|
+
|
|
5
|
+
Open the list and pick a chapter: its break scrolls to the top of the column.
|
|
6
|
+
|
|
7
|
+
<div className="relative flex h-80 w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-border">
|
|
8
|
+
<div className="absolute right-3 top-2 z-10">
|
|
9
|
+
<ChapterNav
|
|
10
|
+
chapters={[
|
|
11
|
+
{ id: 'example-chapter-plan', title: 'Planning', detail: '14:02 · 3 turns' },
|
|
12
|
+
{ id: 'example-chapter-build', title: 'Building', detail: '14:20 · 5 turns' },
|
|
13
|
+
{ id: 'example-chapter-ship', title: 'Shipping', detail: '14:51 · now' },
|
|
14
|
+
]}
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
<div className="flex flex-col gap-24 overflow-y-auto px-6 py-6 pb-60">
|
|
18
|
+
<ChapterNav.Break id="example-chapter-plan" title="Planning" />
|
|
19
|
+
<ChapterNav.Break id="example-chapter-build" title="Building" />
|
|
20
|
+
<ChapterNav.Break id="example-chapter-ship" title="Shipping" />
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
# Break
|
|
25
|
+
|
|
26
|
+
The titled hairline a chapter starts with.
|
|
27
|
+
|
|
28
|
+
<div className="w-full max-w-2xl">
|
|
29
|
+
<ChapterNav.Break id="example-chapter-break" title="Verification" />
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Local addition (not part of Fluid Functionalism): chapters for a long
|
|
3
|
+
* conversation. A ghost icon button opens a Popover with the chapters as a
|
|
4
|
+
* ChoiceList; picking one scrolls its break, a titled hairline, into view.
|
|
5
|
+
* Generalised from the AI app's transcript.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use client'
|
|
9
|
+
|
|
10
|
+
import Button from '@justanarthur/modo-ui/components/actions/button'
|
|
11
|
+
import List, { LIST_POPOVER } from '@justanarthur/modo-ui/components/data-display/list'
|
|
12
|
+
import ChoiceList from '@justanarthur/modo-ui/components/inputs/choice-list'
|
|
13
|
+
import Popover from '@justanarthur/modo-ui/components/overlays/popover'
|
|
14
|
+
import { useControllableState } from '@justanarthur/modo-ui/lib/use-controllable-state'
|
|
15
|
+
import { useIcon } from '../../../lib/icons'
|
|
16
|
+
|
|
17
|
+
interface ChapterNavItem {
|
|
18
|
+
/** The id of its `ChapterNav.Break`. */
|
|
19
|
+
id: string
|
|
20
|
+
/** The chapter's title. */
|
|
21
|
+
title: string
|
|
22
|
+
/** A short line under the title: when it started, how many turns. */
|
|
23
|
+
detail?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface ChapterBreakProps {
|
|
27
|
+
/** The chapter's title, also its entry in the chapter list. */
|
|
28
|
+
title: string
|
|
29
|
+
/** The anchor id the chapter list jumps to. */
|
|
30
|
+
id: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** A chapter break: a hairline with the chapter's title. */
|
|
34
|
+
function ChapterBreak({ title, id }: ChapterBreakProps) {
|
|
35
|
+
return (
|
|
36
|
+
<div id={id} className="flex scroll-mt-4 items-center gap-3 pt-2">
|
|
37
|
+
<span className="shrink-0 text-caption weight-medium text-muted-foreground">{title}</span>
|
|
38
|
+
<span aria-hidden="true" className="h-px flex-1 bg-border" />
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface ChapterNavProps {
|
|
44
|
+
/** The chapters, in order. */
|
|
45
|
+
chapters: ChapterNavItem[]
|
|
46
|
+
/** The current chapter's id. Defaults to the last chapter. */
|
|
47
|
+
defaultValue?: string
|
|
48
|
+
/** Called with a chapter id when one is picked. */
|
|
49
|
+
onValueChange?: (id: string) => void
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The chapters of a long conversation, one press away.
|
|
54
|
+
*
|
|
55
|
+
* A ghost icon button opens a Popover listing the chapters, numbered, each
|
|
56
|
+
* with a short line under its title; the current one is checked. Picking a
|
|
57
|
+
* chapter scrolls its `ChapterNav.Break` (a hairline with the title, placed
|
|
58
|
+
* in the conversation) to the top of the view.
|
|
59
|
+
*
|
|
60
|
+
* Statics:
|
|
61
|
+
* - `ChapterNav.Break` — the titled hairline a chapter starts with: `title`, `id`.
|
|
62
|
+
*
|
|
63
|
+
* @example {@include ./examples.mdx}
|
|
64
|
+
*/
|
|
65
|
+
const ChapterNav = Object.assign(
|
|
66
|
+
function ChapterNav({ chapters, defaultValue, onValueChange }: ChapterNavProps) {
|
|
67
|
+
const [current, setCurrent] = useControllableState<string>(
|
|
68
|
+
undefined,
|
|
69
|
+
defaultValue ?? chapters[chapters.length - 1]?.id ?? '',
|
|
70
|
+
onValueChange,
|
|
71
|
+
)
|
|
72
|
+
const ListTree = useIcon('list-tree')
|
|
73
|
+
|
|
74
|
+
const pick = (id: string) => {
|
|
75
|
+
setCurrent(id)
|
|
76
|
+
document.getElementById(id)?.scrollIntoView({ block: 'start' })
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<Popover>
|
|
81
|
+
<Popover.Trigger
|
|
82
|
+
render={
|
|
83
|
+
<Button variant="ghost" size="icon-compact" aria-label="Chapters">
|
|
84
|
+
<ListTree />
|
|
85
|
+
</Button>
|
|
86
|
+
}
|
|
87
|
+
/>
|
|
88
|
+
<Popover.Content side="bottom" align="end" sideOffset={8} className={LIST_POPOVER}>
|
|
89
|
+
<List.Section title="Chapters">
|
|
90
|
+
<ChoiceList
|
|
91
|
+
label="Chapters"
|
|
92
|
+
value={current}
|
|
93
|
+
onValueChange={pick}
|
|
94
|
+
options={chapters.map((chapter, i) => ({
|
|
95
|
+
value: chapter.id,
|
|
96
|
+
label: chapter.title,
|
|
97
|
+
content: (
|
|
98
|
+
<span className="flex min-w-0 flex-1 gap-2">
|
|
99
|
+
<span className="w-4 shrink-0 text-right text-caption tabular-nums text-muted-foreground">
|
|
100
|
+
{i + 1}
|
|
101
|
+
</span>
|
|
102
|
+
<span className="flex min-w-0 flex-col">
|
|
103
|
+
<span className="truncate text-body text-foreground">{chapter.title}</span>
|
|
104
|
+
{chapter.detail && (
|
|
105
|
+
<span className="truncate text-caption text-muted-foreground">{chapter.detail}</span>
|
|
106
|
+
)}
|
|
107
|
+
</span>
|
|
108
|
+
</span>
|
|
109
|
+
),
|
|
110
|
+
}))}
|
|
111
|
+
/>
|
|
112
|
+
</List.Section>
|
|
113
|
+
</Popover.Content>
|
|
114
|
+
</Popover>
|
|
115
|
+
)
|
|
116
|
+
},
|
|
117
|
+
{ Break: ChapterBreak },
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
export type { ChapterBreakProps, ChapterNavItem, ChapterNavProps }
|
|
121
|
+
export { ChapterBreak, ChapterNav }
|
|
122
|
+
|
|
123
|
+
export default ChapterNav
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import Message from './index'
|
|
2
|
+
import Code from '@justanarthur/modo-ui/primitives/content/code'
|
|
3
|
+
|
|
4
|
+
# Conversation
|
|
5
|
+
|
|
6
|
+
Your turn is a bubble on the right; the reply is text on the page.
|
|
7
|
+
|
|
8
|
+
<div className="flex w-full max-w-2xl flex-col gap-5">
|
|
9
|
+
<Message role="user">Which overlays skip the morph layer?</Message>
|
|
10
|
+
<Message role="assistant">
|
|
11
|
+
<p className="m-0">None of them. Every overlay grows through <code>useMorph</code>:</p>
|
|
12
|
+
<ul className="m-0">
|
|
13
|
+
<li><strong>Popover</strong>, Menu and Select morph out of their trigger.</li>
|
|
14
|
+
<li><strong>Dialog</strong> morphs out of the button that opened it.</li>
|
|
15
|
+
</ul>
|
|
16
|
+
<Code language="sh">rg -l useMorph components/overlays</Code>
|
|
17
|
+
</Message>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
# Attachments and mentions
|
|
21
|
+
|
|
22
|
+
Files, images and pasted text sit above the bubble; an @-mention is a chip inside the text.
|
|
23
|
+
|
|
24
|
+
<div className="w-full max-w-2xl">
|
|
25
|
+
<Message
|
|
26
|
+
role="user"
|
|
27
|
+
attachments={
|
|
28
|
+
<>
|
|
29
|
+
<Message.Attachment kind="image" name="screenshot.png" detail="1.2 MB" />
|
|
30
|
+
<Message.Attachment kind="pasted" name="Pasted text" detail="38 lines" />
|
|
31
|
+
<Message.Attachment name="brief.pdf" detail="4 pages" />
|
|
32
|
+
</>
|
|
33
|
+
}
|
|
34
|
+
>
|
|
35
|
+
Build it to the rules in <Message.Mention path="ui/DESIGN.md" /> and match the screenshot.
|
|
36
|
+
</Message>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
# Streaming
|
|
40
|
+
|
|
41
|
+
While the reply arrives, the working dots follow its last block.
|
|
42
|
+
|
|
43
|
+
<div className="w-full max-w-2xl">
|
|
44
|
+
<Message role="assistant" streaming>
|
|
45
|
+
<p className="m-0">Reading the design rules first, then the craft page.</p>
|
|
46
|
+
</Message>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
# Working
|
|
50
|
+
|
|
51
|
+
The dots on their own, with a line saying what is happening.
|
|
52
|
+
|
|
53
|
+
<Message.Working label="Reading 4 files" />
|