Skip to content

fix(harness): remove empty-project agent creation button - #836

Open
ynadge wants to merge 2 commits into
review/agent-map-15-onboardingfrom
review/agent-map-16-remove-empty-project-action
Open

fix(harness): remove empty-project agent creation button#836
ynadge wants to merge 2 commits into
review/agent-map-15-onboardingfrom
review/agent-map-16-remove-empty-project-action

Conversation

@ynadge

@ynadge ynadge commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Primary change type

  • Bug fix

Problem and motivation

Empty projects still displayed “Create the first agent here” when they had no live session, including after the automatic Plan Agents session ended. The same row displayed “Create an agent here” when a scan stopped at separate checkouts. Both inline creation buttons should be absent.

Summary and scope

Remove the inline creation row and its unused CSS from the shared Studio sidebar for current and legacy server payloads. Retain the scan boundary note and its explanatory tooltip. Update obsolete dialog comments and document the empty-project behavior.

The project menu, session shortcuts, and automatic Plan Agents session continue to provide the existing entry paths. This change does not alter project bootstrap or saved-state migration.

How this increment fits

This is a focused follow-up above the original 15-part Agent Map stack. The same fix is included on the existing fix/studio-onboarding-followups testing branch.

Stack and review boundary

  • Base: #834 — project onboarding, branch review/agent-map-15-onboarding.
  • Review this PR against its predecessor: 7 files, 72 additions, 118 deletions, including tests, documentation, and a Changeset.
  • Complete testing branch: fix/studio-onboarding-followups, commit 675700dfd3b717671f6dc5369b5e04a789a6f84c.
  • This PR's source tree exactly matches that testing commit. Earlier PRs remain unchanged and unmerged.

Related work

Maintainer-requested correction to the empty-project sidebar, following #834. No additional ticket is required for this focused bug fix under CONTRIBUTING.md.

Validation

pnpm build — passed
pnpm typecheck — passed
pnpm lint — passed
pnpm test — passed
Focused Playwright suite: open-project, create-agent, project-map-navigation — 32 passed, zero retries
CSS and changed TypeScript/TSX parsed with Prettier — passed
Git diff whitespace check — passed

Root checks passed on the same application, package, and build inputs. After removing one obsolete browser test, the final focused browser suite was rerun.

Browser checks use the built mock UI with Chrome and an isolated preview configuration. Updated empty-project expectations failed against the preceding implementation in both current and legacy modes, then passed with the fix.

Live Mac localhost validation also confirms the button is absent across the desktop-profile sidebar and after reload, with no session creation, resume, or input requests from the check. The existing saved Agent Map malformed_state error remains a separate migration issue.

Tests and documentation

Updated existing browser journeys to assert that empty projects have no inline creation button, ordinary menu creation remains usable, a new project's Plan Agents conversation remains available, and ending that conversation does not restore the button. Existing project/map navigation, removal/reopening, and mobile map tests pass.

Updated the harness README and added a patch Changeset. No backend behavior or public API changed.

Compatibility and release impact

  • Externally visible change: empty projects no longer contain an inline first-agent creation action in either the desktop or CLI-hosted Studio UI. Project menu actions and session shortcuts remain available.
  • Changeset: .changeset/remove-empty-project-create-action.md (@sapiom/harness: patch).

Security

  • No secrets, credentials, private user data, or unsanitized logs are included.
  • This PR does not publicly disclose a suspected vulnerability.

AI assistance

  • Codex removed the UI row and unused styles, updated existing tests and documentation, inspected the diff, and ran the checks above.

Checklist

  • Read CONTRIBUTING.md; this is a maintainer-requested focused fix.
  • Description reflects the actual predecessor-relative diff.
  • Existing tests cover the changed behavior.
  • Required root build, typecheck, lint, and test commands passed.
  • User-facing behavior and release impact are documented.
  • The shared testing branch and review branch have identical source trees.
  • No PR was merged.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review — PR #836 (round 1)

No confidentiality findings. The changeset, README paragraph, and edited comments read
cleanly as public copy; no company names, no business arrangements, no internal hosts or
tickets are introduced (the one SAP-2981 reference in this area is removed by the
diff). No public API, exports, files, or dependency change.

Findings

1. open-project.spec.ts:187 — the merged-root-agent test is now vacuous (test coverage)

test("the empty row does NOT appear under a merged root-agent project", ...)
  await expect(page.getByTestId("project-empty-rfq-agent")).toHaveCount(0);

project-empty-* is no longer rendered for any project, so this test passes whether or
not projectIsEmpty still consults rootAgent. Its entire point was the distinction
between "empty project" and "root-agent project", and one side of that distinction no
longer exists. It will keep passing through a regression in projectIsEmpty.

The behaviour it guarded is still observable — a merged root-agent project must not get the
project-unsearched-* note row or the rail-wide empty state — so either re-point the test
at one of those, or delete it and lean on the unit coverage at
packages/harness/web/src/lib/project-tree.test.ts:365. The new assertions that match on
accessible name (/^Create (the first |an )agent here$/) do have teeth; keep those.

2. HYGIENE (advisory) — an empty project now renders nothing at all

With (unsearchedCheckouts[root]?.length ?? 0) > 0 now gating the whole block
(WorkflowsRail.tsx:1505), an empty project with no unsearched checkouts contributes zero
child rows. The PR body asks for the button to be absent; this also removes the statement
of fact that the row carried before it became a button ("this is where the agents would
be"). The two remaining doors — project-start-session-* and the menu — are both
.workspace-row-action, which is opacity: 0 at rest (styles.css:2106) and revealed only
on row hover / :focus-visible (styles.css:2125). So a freshly opened empty project shows
nothing at rest and offers nothing at rest.

Concrete next step if you want the fact back without the affordance: .tree-row-empty
(styles.css:10832) is exactly that non-interactive faint label style, and it is currently
applied by nothing in web/src. Render a div.tree-row.tree-row-empty label in place of
the removed button, or delete that rule too — this PR is already removing its dead
neighbours, and leaving one orphan behind is the state that drifts.

Advisory only; not grounds for blocking, and the dismissal/dialog idioms in
CreateAgentDialog.tsx are untouched and correct.

Nits

  • .changeset/remove-empty-project-create-action.md ships a user-visible feature removal as
    patch. Defensible on a 0.x package and the body describes it plainly, but minor is the
    more honest signal for "an action that existed is gone".
  • CreateAgentDialog.tsx:63 and :122 carry the same NO-triggerRef comment, and both were
    edited by hand into slightly different wordings. One of the two can just point at the
    other.

Verdict

Approve with minor comments — the change itself is correct and scoped; fix or drop the
now-vacuous merged-root-agent test.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review — PR #836 (round 2, follow-up)

Delta since 0cbdd869: one commit, 8d4a695d, deleting 10 lines from
packages/harness/web/e2e/open-project.spec.ts. No source, CSS, changeset, docs, API,
exports/files, or dependency change. No confidentiality findings.

Round 1 findings — status

  • cleanup HTTP SDKs #1 (vacuous merged-root-agent test) — fixed. The test was deleted, which was one of
    the two options offered, and the unit coverage it defers to is intact and still
    meaningful: project-tree.test.ts:366 asserts projectIsEmpty is false for a
    rootAgent-only project and true only when nothing files under the root, so a
    regression in the rootAgent branch still fails a test.
  • update SDKs to use payment protocol data #2 HYGIENE (advisory) — not addressed. .tree-row-empty (styles.css:10832) is
    still applied by nothing in web/src; either render it or delete the orphan rule.
  • Nit (patch vs minor for a removed user-visible action) — not addressed. Still
    patch in .changeset/remove-empty-project-create-action.md.
  • Nit (duplicate NO-triggerRef comments at CreateAgentDialog.tsx:63 and :122) —
    not addressed.

New findings

None. Nothing in round 1 was wrong on re-read.

Verdict

Approve. The blocking-ish round 1 finding is resolved; the two remaining items are
advisory and the author's call.

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.

1 participant