Commit 2fcbe72
committed
refactor(resources): migrate log and knowledge onto the axes; collapse tab chrome
Continues the resource-view layer. Three kinds now have a canonical view
(file, log, knowledge) and only `table` remains — deliberately, because the
mothership mounts its editing shell, which is a product decision rather than
unfinished work.
**log** — `log-details/` splits into `components/resources/log-view/` (the view)
and a 198-line shell that keeps resize, keyboard nav and close chrome. Four
leaked contexts resolved: `useParams` → `source.workspaceId`, `useRouter` →
an `onNavigate` prop, `useQueryState(tab)` → view-owned state gated by
`hostOwnsUrl(host)`, `usePermissionConfig` → a required `showExecutionInternals`
prop (deliberately not folded into `grants`: it gates *seeing* trace internals,
not write or run, and an optional field would default permissive — the wrong
failure mode for a permission-group restriction). A fifth leak the plan missed —
`file-download.tsx` holding its own `useRouter` — was caught by the gate.
**knowledge** — `base.tsx` (1733 lines) splits into a 909-line canonical view
and a 974-line shell. The read surface (document list, filters, sort,
pagination, unavailable state) is the view; upload, connectors, tag editing,
rename, delete and bulk operations stay in the shell, exactly as the tables
editing grid kept its write path. All six nuqs keys now route through
`useKnowledgeListState(host)`, whose every write sits behind `hostOwnsUrl`.
**tab chrome** — the five `Embedded*Actions` collapse into one kind-keyed
`ResourceTabActions`. They differed only in icon, copy and destination, which is
a config table. `knowledge` and `table` destinations now resolve through
`workspaceSource().hrefFor()` instead of hand-built strings.
**schedule** is removed as a resource kind: its page was deleted upstream, its
`resourceHref` case pointed at a route that no longer exists, and
`MothershipResourceType` never carried it, so it was unreachable.
Behavior change, intended and limited to embedded surfaces: the mothership panel
no longer writes the log `?tab` key or the six knowledge keys into the host
page's address bar. That is the bug the `host` axis exists to fix. Both route
pages keep their deep-linkable params unchanged.
`Resource` and `InlineRenameInput` moved to `components/` — mandatory, since a
canonical unit may not import the workspace route tree. The workspace barrel
re-exports both, so its consumers are byte-unchanged.
Ratchets: shadow-named components 8 → 2 (the 2 left are deliberate —
`EmbeddedWorkflow`, because a workflow is a live collaborative session rather
than a document with an address, and `EmbeddedFolder`, because a folder is
structure inside a resource); cross-tree imports 38 → 37. None raised.
Verification: apps/sim + 22 packages typecheck, biome clean, 18626 tests pass,
and all 15 repo gates pass including both strict variants. Not visually verified.1 parent 001cbb4 commit 2fcbe72
76 files changed
Lines changed: 3499 additions & 2978 deletions
File tree
- .claude/rules
- apps/sim
- app
- _shell
- workspace/[workspaceId]
- components
- folders
- home/components/mothership-view
- components
- add-resource-dropdown
- resource-content
- knowledge/[id]
- [documentId]
- components
- hooks
- logs
- components
- dashboard/components
- line-chart
- workflows-list
- log-details
- tables/[tableId]/components/enrichment-details
- w
- [workflowId]/components
- panel/components
- editor
- components/sub-block/components/workflow-selector
- toolbar
- subflows
- loop
- parallel
- components/preview/components/preview-editor
- blocks
- components
- inline-rename-input
- resources
- knowledge-view
- components
- document-tags-cell
- search-highlight
- tag-filter-panel
- utils
- log-view
- components
- execution-snapshot
- file-download
- trace-view
- utils
- resource
- components
- owner-cell
- resource-chrome-fallback
- resource-header
- resource-options
- lib/workflows/subblocks
- resources
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
| 427 | + | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | | - | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 39 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
15 | 27 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments