Skip to content

An open-source, faster Devin alternative

TypeScript

Work web: the knowledge repository setting lives on the organization Settings page

Igor Zalutski via Computere4915eb771a6
diff --git a/WORK_WEB_NOTES.md b/WORK_WEB_NOTES.md
index d0372a83..a5dd192a 100644
--- a/WORK_WEB_NOTES.md
+++ b/WORK_WEB_NOTES.md
@@ -79,7 +79,7 @@ The web renders the server's `stage`, `readyToClose`, `attention`, `mine`, `warn
- unknown: outline
- Where things live:
- `KnowledgeRepositorySection` (`KnowledgeRepository.tsx`, props `{id?}`) is the stateful setting and can be mounted anywhere. It shows the repository (linked to GitHub), the branch and its state: "Up to date · read N ago at <short SHA>", "Reading the working docs for the first time…" while building, or the problem sentence in red with a fix per code (Reconnect GitHub for a removed or suspended installation, the installation's `settingsUrl` for a missing repository or denied access, choose again for a missing branch, a note that it is ours for `github_app_not_configured`). Change opens the picker in place.
- - It is mounted on the Computer page as `/computer#work-repository`, after "Your agent", until the organization settings are redesigned. The board's no-repository state embeds `FirstRepository`, the picker alone.
+ - It is mounted at the top of the organization Settings page as `/settings#work-repository`, until those settings are redesigned (work 116). The Computer page is not the place: it shows the setup wizard until setup is complete. The board's no-repository state embeds `FirstRepository`, the picker alone.
- The GitHub repository and commit links are built in the web (`https://github.com/owner/name`, `/commit/<head>`); a `url` on `Repository` from the API would remove that.
- Queries more than one screen reads (`useOpenItems`, `useRepository`, `useGrantingInstallations`) live in `queries.ts`, so tests that mock `./api` reach them.
- The board's header names the repository it reads as a quiet link to that setting; when the repository has a problem the link reads "Settings".
diff --git a/web/src/managed-agents/Computer.tsx b/web/src/managed-agents/Computer.tsx
index f7d72fb0..551f7e07 100644
--- a/web/src/managed-agents/Computer.tsx
+++ b/web/src/managed-agents/Computer.tsx
@@ -59,7 +59,6 @@ import { GitHubStarBonus } from './GitHubStarBonus'
import { launchAuthorizationWindow } from './authorization-window'
import { SlackInstallButton, UnlinkSlackDialog } from './computer-slack'
import { createSession } from './computer-sessions-api'
-import { KnowledgeRepositorySection } from './work/KnowledgeRepository'
import { ChatTextarea } from '@/components/chat-textarea'
import {
AgentCard,
@@ -292,7 +291,6 @@ function ComputerPageContent() {
failed={sessions.isError}
/>
<AgentCard status={status.data} />
- <KnowledgeRepositorySection id="work-repository" />
<IdeasToTry />
</div>
</WithDeveloperFooter>
diff --git a/web/src/managed-agents/work/Board.tsx b/web/src/managed-agents/work/Board.tsx
index dd433cef..87d9a93d 100644
--- a/web/src/managed-agents/work/Board.tsx
+++ b/web/src/managed-agents/work/Board.tsx
@@ -368,7 +368,7 @@ function IndexStatus({
Cannot read {repository}. {problem}
</span>
<Link
- to="/computer#work-repository"
+ to="/settings#work-repository"
className="hover:text-foreground underline underline-offset-4"
>
Settings
@@ -383,7 +383,7 @@ function IndexStatus({
<>
{/* Quiet: where the board reads from, and the way to change it. */}
<Link
- to="/computer#work-repository"
+ to="/settings#work-repository"
title="Change the working docs repository"
className="hover:text-foreground"
>
diff --git a/web/src/managed-agents/work/screens.test.tsx b/web/src/managed-agents/work/screens.test.tsx
index 26a0d7b3..ecce9187 100644
--- a/web/src/managed-agents/work/screens.test.tsx
+++ b/web/src/managed-agents/work/screens.test.tsx
@@ -258,7 +258,7 @@ describe('board', () => {
workApi.getOpenItems.mockResolvedValue(openPage(items))
await render('/computer/work')
expect(
- container.querySelector('a[href="/computer#work-repository"]')
+ container.querySelector('a[href="/settings#work-repository"]')
?.textContent,
).toBe('acme/knowledge')
})
@@ -294,7 +294,7 @@ describe('board', () => {
)
expect(container.textContent).not.toContain('access_denied')
expect(
- container.querySelector('a[href="/computer#work-repository"]')
+ container.querySelector('a[href="/settings#work-repository"]')
?.textContent,
).toBe('Settings')
})
diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsx
index d17f7c89..f3cebd68 100644
--- a/web/src/pages/Settings.tsx
+++ b/web/src/pages/Settings.tsx
@@ -38,6 +38,7 @@ import {
DialogTitle,
} from '@/components/ui/dialog'
import { getManagedRuntimeProfile } from '@/managed-agents/api'
+import { KnowledgeRepositorySection } from '@/managed-agents/work/KnowledgeRepository'
function ReadOnlyField({ label, value }: { label: string; value: ReactNode }) {
return (
@@ -114,6 +115,10 @@ export default function Settings() {
<PageHeader title="Settings" description="Organization configuration" />
<div className="grid max-w-5xl grid-cols-1 gap-6 lg:grid-cols-2">
+ <div className="lg:col-span-2">
+ <KnowledgeRepositorySection id="work-repository" />
+ </div>
+
<Panel className="p-6 lg:col-span-2">
<div className="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>