Skip to content

Make a project a place you can open - #66

Merged
rajanbor merged 1 commit into
mainfrom
feat/project-tab
Sep 16, 2026
Merged

rajanbor merged 1 commit into
mainfrom
feat/project-tab

Conversation

@rajanbor

Copy link
Copy Markdown
Owner

Stacked on #65; GitHub retargets this to main when that merges.

Change

An agent was pointed at a folder that had nowhere to be seen: no path, no branch, no files, and no answer to "open this in my editor".

A project is now an object in the engine. domain::ProjectEntry carries the path, branch, ahead, behind, uncommitted count, the first level of the tree and the agents pointed at it. It opens as its own tab, so a project can sit beside the chat that works in it. A Projects area joins the activity strip, listing each project and disclosing its first level under the open one.

Agents and projects are checked in both directions: no agent works in an unlisted project, and no project claims an agent that does not exist.

Open in editor

A menu of editors, each showing the exact command it would run against this folder — code ~/Projects/open-cube. EditorApp::installed is Option<bool> and is None for every entry, because nothing has looked: resolving an application and launching it belong to workbenchd. A test asserts no editor claims to be installed without a check, so the honest answer cannot quietly become a hopeful one.

New project

Three cards for where it comes from — a template, a folder already on disk, a repository — then where it goes, then what happens afterwards (version control, an editor, an agent). It prints the resulting path and every file and command involved above the button, which states that writing to disk is the daemon's work.

Two corrections found while building this

The prototype working tree lied. It claimed six changed files and listed four, and still named paths from the Swift layout (desktop/src/...). The count is now the list, the paths are this repository's own, and a test asserts exactly one project owns the reported working tree and that its dirty count matches the changes shown. A project that is not that one counts its changes and says why it cannot list them, rather than borrowing another project's files.

Every filled button was invisible. A later "lighter controls" rule set .btn { background: transparent } after .btn--primary set its fill; with equal specificity the last one won, so Create, Save and their kind were drawing white text on a transparent ground. Fixed by ordering, with a comment saying why the order matters, plus a disabled state.

Validation

  • cargo test -p open-cube-core — 26 tests, three new (agents ↔ projects both ways; no editor claims installation; one project owns the reported working tree and its count matches).
  • pnpm fallback regenerated the preview snapshot; pnpm build clean.
  • In the browser: opened both projects as tabs, checked the facts row, the folder list and the agents; opened the editor menu and confirmed each row shows its command; filled the new-project panel and watched the path, the file list, git init and the editor command update live.

Security impact

None. Nothing launches an application, opens a file dialog or writes to disk — each of those reports that it belongs to the daemon. The editor list is declarative and never probes the machine.

Closes #62.

An agent was pointed at a folder that had nowhere to be seen: no path, no
branch, no files, and no answer to "open this in my editor".

A project is now an object in the engine — `domain::ProjectEntry` — with its
path, branch, what is ahead, behind and uncommitted, the first level of its
tree and the agents pointed at it. It opens as its own tab, so a project can
sit beside the chat working in it. Agents and projects are checked against each
other in both directions: no agent works in an unlisted project, and no project
claims an agent that does not exist.

Open in editor is a menu of editors, each showing the exact command it would
run against this folder. `EditorApp::installed` is `Option<bool>` and is `None`
everywhere, because nothing has looked: resolving an application and launching
it belong to workbenchd. A test asserts no editor claims to be installed
without a check, so the honest answer cannot quietly become a hopeful one.

New project asks three things by clicking — where it comes from (a template, a
folder already on disk, a repository), where it goes, and what happens
afterwards — then prints the resulting path and every file and command
involved, above a button that says writing to disk is the daemon's work.

Two corrections came out of building this.

The prototype working tree claimed six changed files and listed four, and still
named paths from the Swift layout (`desktop/src/...`). The count is now the
list, the paths are the ones this repository actually has, and a test asserts
that exactly one project owns the reported working tree and that its dirty
count matches the changes shown. A project that is not that one counts its
changes and says why it cannot list them, rather than borrowing another
project's files.

Every filled button in the app was drawing white text on a transparent ground:
a later "lighter controls" rule set `.btn { background: transparent }` after
`.btn--primary` set its fill, and with equal specificity the last one won.
`Create`, `Save` and their kind are visible again.

Closes #62
Base automatically changed from feat/terminal-panel to main September 16, 2026 12:01
@rajanbor
rajanbor merged commit 0bbe6cf into main Sep 16, 2026
11 checks passed
@rajanbor
rajanbor deleted the feat/project-tab branch September 16, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Projects: a project tab, open in editor, and creating a new project

1 participant