You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c2f04e9
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(knowledge): sever the shell's route context, in place
Same ordering that made the table move safe: the behavioural edits land first,
as a diff against files that have not moved.
- `useParams` -> `knowledgeWorkspaceId(source)`. The shell took `workspaceId?`
optionally and fell back to route params, which the page relied on — so the
fallback was load-bearing, and it is what stopped this surface existing more
than once per page.
- `useRouter` -> `onNavigate`. Three pushes: the document detail route, the
post-delete redirect, and the breadcrumb root. The latter two already went
through `hrefFor({ to: 'list' })`; the first now goes through a new
`knowledgeDocumentHref`, which lives in a per-kind module because a document
is not a `ResourceKind` — it has no view, no grants and no share surface, so
it cannot be spelled through `hrefFor({ to: 'resource' })`.
- `useUserPermissionsContext` -> `grants`. 13 reads, including two of the form
`canEdit || isLoading` that gate whether a breadcrumb dropdown renders at all.
Those become `grants.write || !grants.settled` — the exact pattern `settled`
was added for, and without it the caret would have popped in after load
instead of rendering disabled.
Three supporting relocations, all pure moves:
- `knowledge/components/icons` deleted — byte-identical to
`@/components/icons/document-icons`, confirmed with `diff`.
- `use-knowledge-upload` -> `@/hooks/kb/`.
- `useContextMenu` -> `components/anchored-context-menu/`, beside the component
every one of its 13 consumers pairs it with.
Also makes table-view's internal imports absolute. They arrived relative with
the move and I did not rewrite them; log-view and knowledge-view have zero
relative imports, so table-view was the outlier against the rule this PR
documents. (file-view has 83 and is left alone — pre-existing, and not worth
83 files of churn here.)
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/terminal-session/terminal-session.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ import { type IBufferRange, Terminal } from '@xterm/xterm'
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-documents-modal/add-documents-modal.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ import { createLogger } from '@sim/logger'
0 commit comments