@sixb/app 0.2.6 → 0.2.7

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.
Files changed (57) hide show
  1. package/dist/agent/components/sandbox-recovery.d.ts +8 -2
  2. package/dist/agent/components/sandbox-recovery.d.ts.map +1 -1
  3. package/dist/agent/delegation/use-children.d.ts +5 -5
  4. package/dist/agent/delegation/use-children.d.ts.map +1 -1
  5. package/dist/agent/hooks/thread-queries.d.ts +8 -8
  6. package/dist/agent/hooks/thread-queries.d.ts.map +1 -1
  7. package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
  8. package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
  9. package/dist/agent/i18n/en.d.ts +5 -0
  10. package/dist/agent/i18n/en.d.ts.map +1 -1
  11. package/dist/agent/i18n/fr.d.ts.map +1 -1
  12. package/dist/agent/i18n/index.d.ts +10 -0
  13. package/dist/agent/i18n/index.d.ts.map +1 -1
  14. package/dist/artifacts/queries.d.ts.map +1 -1
  15. package/dist/artifacts/renderers/live-frame.d.ts.map +1 -1
  16. package/dist/{chunk-ezntd3yy.js → chunk-1f4h75n3.js} +1 -1
  17. package/dist/{chunk-qjw5r2vk.js → chunk-7v9622qb.js} +25 -11
  18. package/dist/{chunk-qjw5r2vk.js.map → chunk-7v9622qb.js.map} +6 -6
  19. package/dist/{chunk-096d52h2.js → chunk-dntecmwb.js} +1 -1
  20. package/dist/{chunk-94d7enwc.js → chunk-qmka6aea.js} +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/pages/console/data/accounts.d.ts.map +1 -1
  23. package/dist/pages/console/data/connectors.d.ts.map +1 -1
  24. package/dist/pages/console/data/datasets.d.ts.map +1 -1
  25. package/dist/pages/console/data/pipelines.d.ts.map +1 -1
  26. package/dist/pages/console/data/projections.d.ts.map +1 -1
  27. package/dist/pages/console/data/syncs.d.ts.map +1 -1
  28. package/dist/pages/console/ontology/actions.d.ts.map +1 -1
  29. package/dist/pages/console/ontology/object-type.d.ts.map +1 -1
  30. package/dist/pages/console/ontology/object-types.d.ts.map +1 -1
  31. package/dist/pages/console/ontology/rules.d.ts.map +1 -1
  32. package/dist/pages/console/ontology/workflow.d.ts.map +1 -1
  33. package/dist/pages/console/ontology/workflows.d.ts.map +1 -1
  34. package/dist/pages/folders.d.ts +106 -0
  35. package/dist/pages/folders.d.ts.map +1 -0
  36. package/dist/pages.js +5234 -4904
  37. package/dist/pages.js.map +15 -14
  38. package/package.json +3 -3
  39. package/src/agent/components/sandbox-recovery.tsx +24 -6
  40. package/src/agent/hooks/use-agent-conversation.ts +7 -0
  41. package/src/agent/i18n/en.ts +6 -0
  42. package/src/agent/i18n/fr.ts +6 -0
  43. package/src/pages/console/data/connectors.tsx +60 -49
  44. package/src/pages/console/data/datasets.tsx +79 -68
  45. package/src/pages/console/data/pipelines.tsx +80 -69
  46. package/src/pages/console/data/projections.tsx +111 -82
  47. package/src/pages/console/data/syncs.tsx +62 -52
  48. package/src/pages/console/ontology/actions.tsx +51 -24
  49. package/src/pages/console/ontology/object-type.tsx +5 -1
  50. package/src/pages/console/ontology/object-types.tsx +41 -32
  51. package/src/pages/console/ontology/rules.tsx +48 -38
  52. package/src/pages/console/ontology/workflow.tsx +9 -3
  53. package/src/pages/console/ontology/workflows.tsx +55 -67
  54. package/src/pages/folders.tsx +335 -0
  55. /package/dist/{chunk-ezntd3yy.js.map → chunk-1f4h75n3.js.map} +0 -0
  56. /package/dist/{chunk-096d52h2.js.map → chunk-dntecmwb.js.map} +0 -0
  57. /package/dist/{chunk-94d7enwc.js.map → chunk-qmka6aea.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/app",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Custom app toolkit for Sixb projects — route scanning, dev serving, and production builds",
5
5
  "keywords": [
6
6
  "sixb",
@@ -55,8 +55,8 @@
55
55
  "generate:frame-editor": "bun ./scripts/generate-frame-editor.ts"
56
56
  },
57
57
  "dependencies": {
58
- "@sixb/client": "^0.2.6",
59
- "@sixb/core": "^0.2.6",
58
+ "@sixb/client": "^0.2.7",
59
+ "@sixb/core": "^0.2.7",
60
60
  "@sixb/ui": "^0.2.5",
61
61
  "@tailwindcss/cli": "^4.2.2",
62
62
  "@tiptap/core": "^3.33.1",
@@ -22,6 +22,11 @@ export interface SandboxRecoveryProps {
22
22
  readonly error: boolean
23
23
  readonly onRestore: () => void
24
24
  }
25
+ /**
26
+ * The newest run finished its answer, and only its files were not saved: the block says so
27
+ * instead of an interruption.
28
+ */
29
+ readonly answered?: boolean
25
30
  /** Only the thread's owner recreates its sandbox; anyone else is told who can. */
26
31
  readonly canRecreate: boolean
27
32
  /** The thread's owner, by name. */
@@ -30,38 +35,51 @@ export interface SandboxRecoveryProps {
30
35
 
31
36
  /**
32
37
  * Offers to go on in the thread's sandbox, as its failed save left it, or to start fresh when it
33
- * stops responding; the composer waits for either.
38
+ * stops responding; the composer waits for either. An answer that finished before its save failed
39
+ * stands: the block then only asks what to do with the files.
34
40
  */
35
41
  export function SandboxRecovery({
36
42
  pending,
37
43
  error,
38
44
  onRecreate,
39
45
  restore,
46
+ answered = false,
40
47
  canRecreate,
41
48
  owner,
42
49
  }: SandboxRecoveryProps) {
43
50
  const messages = useAgentMessages().sandbox
51
+ const title = answered ? messages.answeredTitle : messages.title
44
52
 
45
53
  if (!canRecreate) {
46
54
  return (
47
55
  <div className="mx-auto w-full max-w-3xl px-4 py-3 text-sm" role="status">
48
- <p className="font-medium">{messages.title}</p>
56
+ <p className="font-medium">{title}</p>
49
57
  <p className="text-muted-foreground">{messages.ownerOnly(owner)}</p>
50
58
  </div>
51
59
  )
52
60
  }
53
61
 
62
+ const resumeLabel = answered
63
+ ? restore?.pending
64
+ ? messages.keepingFiles
65
+ : messages.keepFiles
66
+ : restore?.pending
67
+ ? messages.resuming
68
+ : messages.resume
69
+
54
70
  return (
55
71
  <div className="mx-auto w-full max-w-3xl px-4 py-3 text-sm" role="status">
56
- <p className="font-medium">{messages.title}</p>
57
- <p className="text-muted-foreground">{messages.description}</p>
58
- {restore && <p className="text-muted-foreground">{messages.resumeHint}</p>}
72
+ <p className="font-medium">{title}</p>
73
+ <p className="text-muted-foreground">
74
+ {answered ? messages.answeredDescription : messages.description}
75
+ </p>
76
+ {restore && !answered && <p className="text-muted-foreground">{messages.resumeHint}</p>}
59
77
  {restore?.error && <p role="alert">{messages.resumeFailed}</p>}
60
78
  {error && <p role="alert">{messages.recreateFailed}</p>}
61
79
  <div className="mt-2 flex flex-wrap gap-2">
62
80
  {restore && (
63
81
  <Button size="sm" disabled={pending} onClick={restore.onRestore}>
64
- {restore.pending ? messages.resuming : messages.resume}
82
+ {resumeLabel}
65
83
  </Button>
66
84
  )}
67
85
  <AlertDialog>
@@ -1722,6 +1722,13 @@ export function useAgentConversation({
1722
1722
  },
1723
1723
  }
1724
1724
  : {}),
1725
+ // A turn paused for an approval, or cut short by a limit, also succeeds: it has no answer.
1726
+ answered:
1727
+ latestRun?.status === "succeeded" &&
1728
+ latestRun.finishReason === "stop" &&
1729
+ (latestRun.diagnostics ?? []).some(
1730
+ (diagnostic) => diagnostic.code === "workspace_not_saved"
1731
+ ),
1725
1732
  canRecreate: access === "owner",
1726
1733
  owner: thread ? personName(threadOwner(thread)) : "",
1727
1734
  }
@@ -305,6 +305,7 @@ export const en = {
305
305
  "I reached the step limit before producing a final answer. Ask me to continue and I can use the work above as context.",
306
306
  output_limit_reached:
307
307
  "I ran out of room before finishing this answer. Ask me to continue, or lower the reasoning level.",
308
+ workspace_not_saved: "The files couldn’t be saved when this response ended.",
308
309
  unknown: "Something went wrong during this response.",
309
310
  } satisfies Record<AgentRunDiagnosticCode | "unknown", string>,
310
311
  activity: {
@@ -935,6 +936,11 @@ export const en = {
935
936
  resumeHint: "Its files are kept, but its last change may be unfinished.",
936
937
  resumeFailed:
937
938
  "Couldn't pick up where it left off. Reload the page and try again, or start over without the files.",
939
+ answeredTitle: "What to do with the files",
940
+ answeredDescription:
941
+ "The answer above is complete. Go on with the files as they are, or start over without them.",
942
+ keepFiles: "Go on with these files",
943
+ keepingFiles: "Going on…",
938
944
  },
939
945
  /** A command the agent runs in the background, as its card and its calls read. */
940
946
  background: {
@@ -291,6 +291,7 @@ export const fr: Translation<AgentMessages> = {
291
291
  "J’ai atteint la limite d’étapes avant de produire une réponse finale. Il suffit de me demander de continuer pour reprendre ce travail.",
292
292
  output_limit_reached:
293
293
  "J’ai manqué de place pour terminer cette réponse. Il suffit de me demander de continuer, ou de baisser le niveau de raisonnement.",
294
+ workspace_not_saved: "Les fichiers n’ont pas pu être enregistrés à la fin de cette réponse.",
294
295
  unknown: "Un problème est survenu pendant cette réponse.",
295
296
  },
296
297
  activity: {
@@ -973,6 +974,11 @@ export const fr: Translation<AgentMessages> = {
973
974
  resumeHint: "Ses fichiers sont conservés, mais sa dernière modification peut être inachevée.",
974
975
  resumeFailed:
975
976
  "Impossible de reprendre où il s’était arrêté. Rechargez la page et réessayez, ou repartez sans les fichiers.",
977
+ answeredTitle: "Que faire des fichiers",
978
+ answeredDescription:
979
+ "La réponse ci-dessus est complète. Continuez avec les fichiers tels quels, ou repartez sans eux.",
980
+ keepFiles: "Continuer avec ces fichiers",
981
+ keepingFiles: "Reprise…",
976
982
  },
977
983
  background: {
978
984
  card: (command) => `Commande en arrière-plan : ${command}`,
@@ -8,6 +8,7 @@ import {
8
8
  import { useQuery } from "@tanstack/react-query"
9
9
  import { Cable, ChevronRight, RefreshCw, Webhook } from "lucide-react"
10
10
  import { useParams } from "react-router-dom"
11
+ import { FolderContents, folderBack, noItems, useFolderBrowser } from "../../folders"
11
12
  import { DetailFallback, SectionPage } from "../../section-page"
12
13
  import {
13
14
  apiErrorMessage,
@@ -38,60 +39,67 @@ import { ConnectorIcon } from "./shared"
38
39
  export function ConsoleConnectorsPage() {
39
40
  const messages = useDataMessages()
40
41
  const connectorsQuery = useQuery({ ...listConnectorsOptions(), retry: false })
41
- const connectors = connectorsQuery.data ?? []
42
+ const browser = useFolderBrowser({
43
+ items: connectorsQuery.data ?? noItems,
44
+ title: messages.connectors.title,
45
+ description: messages.connectors.description,
46
+ })
42
47
 
43
48
  return (
44
- <SectionPage
45
- section="console"
46
- page="connectors"
47
- title={messages.connectors.title}
48
- description={messages.connectors.description}
49
- >
50
- <Panel>
51
- {connectorsQuery.isPending ? (
52
- <PanelSkeleton
53
- rows={3}
54
- interactive
55
- trailing={<TrailingSkeleton pill={false} chevron />}
56
- />
57
- ) : connectorsQuery.isError ? (
58
- <PanelEmpty
59
- tone="error"
60
- icon={Cable}
61
- title={messages.connectors.title}
62
- description={apiErrorMessage(connectorsQuery.error, messages.common.loadFailed)}
63
- />
64
- ) : connectors.length === 0 ? (
65
- <PanelEmpty
66
- icon={Cable}
67
- title={messages.connectors.emptyTitle}
68
- description={messages.connectors.emptyDescription}
69
- />
70
- ) : (
71
- connectors.map((connector) => (
72
- <PanelRow
73
- key={connector.id}
74
- href={`/console/connectors/${encodeURIComponent(connector.id)}`}
75
- leading={<ConnectorIcon type={connector.type} />}
76
- title={<span className="truncate">{humanize(connector.id)}</span>}
77
- meta={
78
- <>
79
- <span className="font-mono text-xs">{connector.type}</span>
80
- <MetaDot />
81
- <span>{messages.connectors.syncCount(connector.syncIds.length)}</span>
82
- {connector.webhooks.length > 0 ? (
49
+ <SectionPage section="console" page="connectors" {...browser.frame}>
50
+ {connectorsQuery.isSuccess && connectorsQuery.data.length > 0 ? (
51
+ <FolderContents browser={browser} rootLabel={messages.connectors.title}>
52
+ {(connectors) => (
53
+ <Panel>
54
+ {connectors.map((connector) => (
55
+ <PanelRow
56
+ key={connector.id}
57
+ href={`/console/connectors/${encodeURIComponent(connector.id)}`}
58
+ leading={<ConnectorIcon type={connector.type} />}
59
+ title={<span className="truncate">{humanize(connector.id)}</span>}
60
+ meta={
83
61
  <>
62
+ <span className="font-mono text-xs">{connector.type}</span>
84
63
  <MetaDot />
85
- <span>{messages.connectors.webhookCount(connector.webhooks.length)}</span>
64
+ <span>{messages.connectors.syncCount(connector.syncIds.length)}</span>
65
+ {connector.webhooks.length > 0 ? (
66
+ <>
67
+ <MetaDot />
68
+ <span>{messages.connectors.webhookCount(connector.webhooks.length)}</span>
69
+ </>
70
+ ) : null}
86
71
  </>
87
- ) : null}
88
- </>
89
- }
90
- trailing={<ChevronRight className="size-4 text-muted-foreground/60" />}
72
+ }
73
+ trailing={<ChevronRight className="size-4 text-muted-foreground/60" />}
74
+ />
75
+ ))}
76
+ </Panel>
77
+ )}
78
+ </FolderContents>
79
+ ) : (
80
+ <Panel>
81
+ {connectorsQuery.isPending ? (
82
+ <PanelSkeleton
83
+ rows={3}
84
+ interactive
85
+ trailing={<TrailingSkeleton pill={false} chevron />}
86
+ />
87
+ ) : connectorsQuery.isError ? (
88
+ <PanelEmpty
89
+ tone="error"
90
+ icon={Cable}
91
+ title={messages.connectors.title}
92
+ description={apiErrorMessage(connectorsQuery.error, messages.common.loadFailed)}
91
93
  />
92
- ))
93
- )}
94
- </Panel>
94
+ ) : (
95
+ <PanelEmpty
96
+ icon={Cable}
97
+ title={messages.connectors.emptyTitle}
98
+ description={messages.connectors.emptyDescription}
99
+ />
100
+ )}
101
+ </Panel>
102
+ )}
95
103
  </SectionPage>
96
104
  )
97
105
  }
@@ -118,7 +126,10 @@ export function ConsoleConnectorPage() {
118
126
  })
119
127
  const syncs = (syncsQuery.data ?? []).filter((sync) => sync.connector.id === connectorId)
120
128
  const apiUrl = (client.getConfig().baseUrl ?? window.location.origin).replace(/\/$/, "")
121
- const back = { href: "/console/connectors", label: messages.connectors.title }
129
+ const back = folderBack(
130
+ { href: "/console/connectors", label: messages.connectors.title },
131
+ connector?.folder
132
+ )
122
133
 
123
134
  if (!connector) {
124
135
  return (
@@ -39,6 +39,7 @@ import { keepPreviousData, useQuery } from "@tanstack/react-query"
39
39
  import { ChevronLeft, ChevronRight, Columns3, Database, Info, Search } from "lucide-react"
40
40
  import { type ReactNode, useMemo, useState } from "react"
41
41
  import { Link, useParams, useSearchParams } from "react-router-dom"
42
+ import { FolderContents, folderBack, noItems, useFolderBrowser } from "../../folders"
42
43
  import { DetailFallback, SectionPage, SectionWorkspace, WorkspaceHeader } from "../../section-page"
43
44
  import {
44
45
  apiErrorMessage,
@@ -73,80 +74,87 @@ export function ConsoleDatasetsPage() {
73
74
  const numbers = useNumbers()
74
75
  useDatasetLiveUpdates()
75
76
  const datasetsQuery = useQuery({ ...listDatasetsOptions(), retry: false })
76
- const datasets = datasetsQuery.data ?? []
77
+ const browser = useFolderBrowser({
78
+ items: datasetsQuery.data ?? noItems,
79
+ title: messages.datasets.title,
80
+ description: messages.datasets.description,
81
+ })
77
82
 
78
83
  return (
79
- <SectionPage
80
- section="console"
81
- page="datasets"
82
- title={messages.datasets.title}
83
- description={messages.datasets.description}
84
- >
85
- <Panel>
86
- {datasetsQuery.isPending ? (
87
- <PanelSkeleton
88
- rows={4}
89
- interactive
90
- trailing={<TrailingSkeleton pill={false} chevron />}
91
- />
92
- ) : datasetsQuery.isError ? (
93
- <PanelEmpty
94
- tone="error"
95
- icon={Database}
96
- title={messages.datasets.title}
97
- description={apiErrorMessage(datasetsQuery.error, messages.common.loadFailed)}
98
- />
99
- ) : datasets.length === 0 ? (
100
- <PanelEmpty
101
- icon={Database}
102
- title={messages.datasets.emptyTitle}
103
- description={messages.datasets.emptyDescription}
104
- />
105
- ) : (
106
- datasets.map((dataset) => (
107
- <PanelRow
108
- key={dataset.id}
109
- href={`/console/datasets/${encodeURIComponent(dataset.id)}`}
110
- leading={<IconTile icon={Database} />}
111
- title={<span className="truncate">{dataset.id}</span>}
112
- meta={
113
- <>
114
- {dataset.latestVersion?.rowCount !== undefined ? (
84
+ <SectionPage section="console" page="datasets" {...browser.frame}>
85
+ {datasetsQuery.isSuccess && datasetsQuery.data.length > 0 ? (
86
+ <FolderContents browser={browser} rootLabel={messages.datasets.title}>
87
+ {(datasets) => (
88
+ <Panel>
89
+ {datasets.map((dataset) => (
90
+ <PanelRow
91
+ key={dataset.id}
92
+ href={`/console/datasets/${encodeURIComponent(dataset.id)}`}
93
+ leading={<IconTile icon={Database} />}
94
+ title={<span className="truncate">{dataset.id}</span>}
95
+ meta={
115
96
  <>
116
- <span className="tabular-nums">
117
- {messages.common.rows(
118
- dataset.latestVersion.rowCount,
119
- numbers.count(dataset.latestVersion.rowCount)
120
- )}
121
- </span>
122
- <MetaDot />
97
+ {dataset.latestVersion?.rowCount !== undefined ? (
98
+ <>
99
+ <span className="tabular-nums">
100
+ {messages.common.rows(
101
+ dataset.latestVersion.rowCount,
102
+ numbers.count(dataset.latestVersion.rowCount)
103
+ )}
104
+ </span>
105
+ <MetaDot />
106
+ </>
107
+ ) : null}
108
+ <span>{messages.common.columns(dataset.schema.columns.length)}</span>
109
+ {dataset.latestVersion ? (
110
+ <>
111
+ <MetaDot />
112
+ <span>
113
+ {messages.datasets.updated(
114
+ format.relative(dataset.latestVersion.createdAt)
115
+ )}
116
+ </span>
117
+ </>
118
+ ) : null}
123
119
  </>
124
- ) : null}
125
- <span>{messages.common.columns(dataset.schema.columns.length)}</span>
126
- {dataset.latestVersion ? (
120
+ }
121
+ trailing={
127
122
  <>
128
- <MetaDot />
129
- <span>
130
- {messages.datasets.updated(
131
- format.relative(dataset.latestVersion.createdAt)
132
- )}
133
- </span>
123
+ {dataset.latestVersion ? null : (
124
+ <Pill tone="muted">{messages.datasets.declared}</Pill>
125
+ )}
126
+ <ChevronRight className="size-4 text-muted-foreground/60" />
134
127
  </>
135
- ) : null}
136
- </>
137
- }
138
- trailing={
139
- <>
140
- {dataset.latestVersion ? null : (
141
- <Pill tone="muted">{messages.datasets.declared}</Pill>
142
- )}
143
- <ChevronRight className="size-4 text-muted-foreground/60" />
144
- </>
145
- }
128
+ }
129
+ />
130
+ ))}
131
+ </Panel>
132
+ )}
133
+ </FolderContents>
134
+ ) : (
135
+ <Panel>
136
+ {datasetsQuery.isPending ? (
137
+ <PanelSkeleton
138
+ rows={4}
139
+ interactive
140
+ trailing={<TrailingSkeleton pill={false} chevron />}
146
141
  />
147
- ))
148
- )}
149
- </Panel>
142
+ ) : datasetsQuery.isError ? (
143
+ <PanelEmpty
144
+ tone="error"
145
+ icon={Database}
146
+ title={messages.datasets.title}
147
+ description={apiErrorMessage(datasetsQuery.error, messages.common.loadFailed)}
148
+ />
149
+ ) : (
150
+ <PanelEmpty
151
+ icon={Database}
152
+ title={messages.datasets.emptyTitle}
153
+ description={messages.datasets.emptyDescription}
154
+ />
155
+ )}
156
+ </Panel>
157
+ )}
150
158
  </SectionPage>
151
159
  )
152
160
  }
@@ -219,7 +227,10 @@ function DatasetDetail({ datasetId }: { readonly datasetId: string }) {
219
227
  )
220
228
  : allRows
221
229
 
222
- const back = { href: "/console/datasets", label: messages.datasets.title }
230
+ const back = folderBack(
231
+ { href: "/console/datasets", label: messages.datasets.title },
232
+ dataset?.folder
233
+ )
223
234
 
224
235
  if (!dataset) {
225
236
  return (
@@ -26,6 +26,7 @@ import {
26
26
  } from "lucide-react"
27
27
  import { lazy, type ReactNode, Suspense, useMemo, useState } from "react"
28
28
  import { Link, useParams, useSearchParams } from "react-router-dom"
29
+ import { FolderContents, folderBack, noItems, useFolderBrowser } from "../../folders"
29
30
  import {
30
31
  DetailFallback,
31
32
  notify,
@@ -66,80 +67,87 @@ export function ConsolePipelinesPage() {
66
67
  const format = useFormat()
67
68
  usePipelineLiveUpdates()
68
69
  const pipelinesQuery = useQuery({ ...listPipelinesOptions(), retry: false })
69
- const pipelines = pipelinesQuery.data ?? []
70
+ const browser = useFolderBrowser({
71
+ items: pipelinesQuery.data ?? noItems,
72
+ title: messages.pipelines.title,
73
+ description: messages.pipelines.description,
74
+ })
70
75
 
71
76
  return (
72
- <SectionPage
73
- section="console"
74
- page="pipelines"
75
- title={messages.pipelines.title}
76
- description={messages.pipelines.description}
77
- >
78
- <Panel>
79
- {pipelinesQuery.isPending ? (
80
- <PanelSkeleton rows={3} interactive trailing={<TrailingSkeleton chevron />} />
81
- ) : pipelinesQuery.isError ? (
82
- <PanelEmpty
83
- tone="error"
84
- icon={Workflow}
85
- title={messages.pipelines.title}
86
- description={apiErrorMessage(pipelinesQuery.error, messages.common.loadFailed)}
87
- />
88
- ) : pipelines.length === 0 ? (
89
- <PanelEmpty
90
- icon={Workflow}
91
- title={messages.pipelines.emptyTitle}
92
- description={messages.pipelines.emptyDescription}
93
- />
94
- ) : (
95
- pipelines.map((pipeline) => {
96
- const steps = pipeline.graph.nodes
97
- const output = steps.at(-1)?.step.output.id
98
- return (
99
- <PanelRow
100
- key={pipeline.id}
101
- href={`/console/pipelines/${encodeURIComponent(pipeline.id)}`}
102
- leading={<IconTile icon={Workflow} />}
103
- title={<span className="truncate">{humanize(pipeline.id)}</span>}
104
- meta={
105
- <>
106
- <span>{messages.pipelines.stepCount(steps.length)}</span>
107
- {output ? (
77
+ <SectionPage section="console" page="pipelines" {...browser.frame}>
78
+ {pipelinesQuery.isSuccess && pipelinesQuery.data.length > 0 ? (
79
+ <FolderContents browser={browser} rootLabel={messages.pipelines.title}>
80
+ {(pipelines) => (
81
+ <Panel>
82
+ {pipelines.map((pipeline) => {
83
+ const steps = pipeline.graph.nodes
84
+ const output = steps.at(-1)?.step.output.id
85
+ return (
86
+ <PanelRow
87
+ key={pipeline.id}
88
+ href={`/console/pipelines/${encodeURIComponent(pipeline.id)}`}
89
+ leading={<IconTile icon={Workflow} />}
90
+ title={<span className="truncate">{humanize(pipeline.id)}</span>}
91
+ meta={
108
92
  <>
109
- <MetaDot />
110
- <span className="truncate">{messages.common.writes(output)}</span>
93
+ <span>{messages.pipelines.stepCount(steps.length)}</span>
94
+ {output ? (
95
+ <>
96
+ <MetaDot />
97
+ <span className="truncate">{messages.common.writes(output)}</span>
98
+ </>
99
+ ) : null}
100
+ {pipeline.triggers.map((trigger) => (
101
+ <ScheduleMeta key={trigger.scheduleId} id={trigger.scheduleId} />
102
+ ))}
103
+ {pipeline.latestRun ? (
104
+ <>
105
+ <MetaDot />
106
+ <span>
107
+ {format.relative(
108
+ pipeline.latestRun.startedAt ?? pipeline.latestRun.queuedAt
109
+ )}
110
+ </span>
111
+ </>
112
+ ) : null}
111
113
  </>
112
- ) : null}
113
- {pipeline.triggers.map((trigger) => (
114
- <ScheduleMeta key={trigger.scheduleId} id={trigger.scheduleId} />
115
- ))}
116
- {pipeline.latestRun ? (
114
+ }
115
+ trailing={
117
116
  <>
118
- <MetaDot />
119
- <span>
120
- {format.relative(
121
- pipeline.latestRun.startedAt ?? pipeline.latestRun.queuedAt
122
- )}
123
- </span>
117
+ {pipeline.latestRun ? (
118
+ <RunStatusPill status={pipeline.latestRun.status} />
119
+ ) : (
120
+ <Pill tone="muted">{messages.common.neverRun}</Pill>
121
+ )}
122
+ <ChevronRight className="size-4 text-muted-foreground/60" />
124
123
  </>
125
- ) : null}
126
- </>
127
- }
128
- trailing={
129
- <>
130
- {pipeline.latestRun ? (
131
- <RunStatusPill status={pipeline.latestRun.status} />
132
- ) : (
133
- <Pill tone="muted">{messages.common.neverRun}</Pill>
134
- )}
135
- <ChevronRight className="size-4 text-muted-foreground/60" />
136
- </>
137
- }
138
- />
139
- )
140
- })
141
- )}
142
- </Panel>
124
+ }
125
+ />
126
+ )
127
+ })}
128
+ </Panel>
129
+ )}
130
+ </FolderContents>
131
+ ) : (
132
+ <Panel>
133
+ {pipelinesQuery.isPending ? (
134
+ <PanelSkeleton rows={3} interactive trailing={<TrailingSkeleton chevron />} />
135
+ ) : pipelinesQuery.isError ? (
136
+ <PanelEmpty
137
+ tone="error"
138
+ icon={Workflow}
139
+ title={messages.pipelines.title}
140
+ description={apiErrorMessage(pipelinesQuery.error, messages.common.loadFailed)}
141
+ />
142
+ ) : (
143
+ <PanelEmpty
144
+ icon={Workflow}
145
+ title={messages.pipelines.emptyTitle}
146
+ description={messages.pipelines.emptyDescription}
147
+ />
148
+ )}
149
+ </Panel>
150
+ )}
143
151
  </SectionPage>
144
152
  )
145
153
  }
@@ -212,7 +220,10 @@ function PipelineDetail({ pipelineId }: { readonly pipelineId: string }) {
212
220
  onError: (error) => notify.error(apiErrorMessage(error, messages.pipelines.requestFailed)),
213
221
  })
214
222
 
215
- const back = { href: "/console/pipelines", label: messages.pipelines.title }
223
+ const back = folderBack(
224
+ { href: "/console/pipelines", label: messages.pipelines.title },
225
+ pipelineQuery.data?.folder
226
+ )
216
227
 
217
228
  if (!pipeline) {
218
229
  return (