An open-source, faster Devin alternative
TypeScript
Work web notes: the repository combobox and the settings anatomy
Igor Zalutski via Computer2edd1537cfeb
diff --git a/WORK_WEB_NOTES.md b/WORK_WEB_NOTES.mdindex a5dd192a..199cfb6c 100644--- a/WORK_WEB_NOTES.md+++ b/WORK_WEB_NOTES.md@@ -18,9 +18,10 @@ add fields without breaking the screens.- Sends an `Idempotency-Key` header.- The picker sends the chosen installation's `id`, the repository's `owner` and `name`, and its `defaultBranch` as `branch`. There is no branch input.- `GET /work/repositories` returns `{installations: [{id, accountLogin, accountType, settingsUrl, repositories: [{id, owner, name, private, defaultBranch, pushedAt}], truncated, problem, problemMessage}]}`, repositories already sorted most recently pushed first.- - The picker (`RepositorySetting.tsx`) follows the "import a repository" pattern: an account select when there is more than one installation, a search that filters by name as you type, a refresh button, and a list of about six rows that scrolls, each with a lock when private, the pushed time and Select. The current choice shows as Selected.+ - The picker (`RepositoryCombobox` in `RepositorySetting.tsx`) is a combobox like GitHub's and Vercel's, replacing the earlier list of Select buttons. The trigger shows the current `owner/name` (with a lock when private). It opens a popover the trigger's width: a search that filters as you type, then a list of at most 260px, with one row per repository showing a check on the current one, a lock when private and the pushed time. Arrow keys and Enter choose. There is no cmdk in the web, so the listbox is built by hand with aria roles. The popover is `ui/popover.tsx`, a thin wrapper over the `radix-ui` package already installed, so there is no new dependency.+ - With more than one installation the rows are grouped by account, and each group header has its own "Adjust access" link. With one, the footer reads "Missing a repository? Adjust GitHub App access" plus a refresh. Both links open the installation's `settingsUrl` in a new tab.- The list is read again whenever the window regains focus (`refetchOnWindowFocus: 'always'`, past the 30 s default `staleTime`), so coming back from GitHub after granting access shows the new repository.- - Under the list, "Adjust GitHub App access" opens the installation's `settingsUrl` in a new tab.+ - Choosing the current repository again does nothing, unless it has a problem: then it saves again, which is how "Choose again" retries a missing branch.- When the list loads with no installation, "Connect GitHub" starts the managed GitHub App install in a new window (the same flow as Connections and the Computer page).- Choosing a repository when one is already set asks first ("Switch the board to owner/name?"). The wording follows the server's `setRepository`: the index is rebuilt from the new repository's default branch, nothing is written to either repository, and switching back is possible. Whether agents then write new items to the new repository was not checked, so the dialog does not say.- `Repository` is `{installationId: string|number, owner, name, branch, problem?: string|null, problemMessage?: string|null}`.@@ -78,8 +79,9 @@ The web renders the server's `stage`, `readyToClose`, `attention`, `mine`, `warn- closed: error- 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 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.+ - `KnowledgeRepositorySection` (`KnowledgeRepository.tsx`, props `{id?}`) is the stateful setting and can be mounted anywhere. Its Repository row is the combobox itself (there is no Change or Cancel), with "Open on GitHub" as a trailing icon button. Below it are 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`).+ - It is the second section of the organization Settings page, as `/settings#work-repository`. 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 combobox alone.+ - The Settings page was redesigned with it. `components/settings.tsx` holds the shared anatomy: `SettingsSection` (title, one sentence, one panel), `SettingsRow` (three columns on shared edges: a 10rem label, the value, and a trailing action at the panel's right edge; on a phone the label stacks above the value) and `SettingsAction` (the one trailing action style, a quiet ghost button). The sections are Organization, Knowledge repository, Members and Agent environment. The name shows Save and Cancel only once changed, and Escape resets it. Members and invitations have a "…" menu holding Remove or Revoke; your own row has none and is tagged "You".- 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".@@ -91,7 +93,7 @@ The web renders the server's `stage`, `readyToClose`, `attention`, `mine`, `warn- The open-items poll goes through `workOpenItemsResponse`, which answers as the server does: an ETag over the page without `asOf`, a 304 while that ETag matches, and `Work-As-Of` on both.- `problem` sends `access_denied` with a `problemMessage`; `&problem=<code>` sends another code, without a message.-- `/repositories` lists eight repositories under `acme` and two under `acme-labs`, the preview's two installations. `?work=none` opens the picker.+- `/repositories` lists eight repositories under `acme` and two under `acme-labs`, the preview's two installations. `?work=none` shows the combobox alone. The preview's organization (`api/mock.ts`) has four members and two invitations, so the Members section has something to show.- Item 31 has an unknown `updatedAt`; closed item 8 has no `closedAt` or `closedBy`.- An unknown item number answers 404 `item_not_found`.