Skip to content

feat(server): organize environments — tags, search, and group-by - #78

Open
louisreingold wants to merge 1 commit into
masterfrom
env-tags
Open

feat(server): organize environments — tags, search, and group-by#78
louisreingold wants to merge 1 commit into
masterfrom
env-tags

Conversation

@louisreingold

Copy link
Copy Markdown
Member

Fixes the "wall of stopped environments" problem: ~47 envs with no way to find, group, or label anything.

What's new

Tags — each env can carry short labels (demo, repro, client-x, …). Stored on the registry record, normalized server-side (lowercase, deduped, max 20 × 32 chars). No migration: old records just read as [].

One metadata PATCHPATCH /environments/:id now accepts displayName and/or tags, each optional, only present fields touched. Tags are full-replacement ([] clears). The rename modal became "Rename & tag" and submits both in one call.

MCP — new set_environment_tags tool (same normalize path as HTTP), so agents can label envs they create. Documented in AGENT_USAGE.md.

Sidebar

  • Search box: matches name, displayName, preset, and tags; #demodemo.
  • Group-by: flat / by preset / by tag (persisted in localStorage). Sticky, collapsible group headers with counts. Under "by tag" an env appears under each of its tags; untagged envs collect in an untagged bucket at the end.
  • MRU sort: envs order by their newest session activity (falling back to createdAt), so the env you touched last week floats to the top of the stopped pile.
  • Env rows render clickable #tag chips — click one to filter the list by it.

Notes

  • Canonical identity (name / dir / compose project) remains immutable, as with rename.
  • Deployed to the box from this branch and verified live: PATCH normalization + validation errors, MCP tool call, grouped/search UI served.

🤖 Generated with Claude Code

https://claude.ai/code/session_012wAFFJfN1MJvRqL9YyU3Zw

The env list had become a wall of ~47 rows with no way to find anything.
This adds lightweight organization without touching anything canonical
(name/dir/compose project stay immutable):

- Registry records gain a `tags` array (normalizeTags in ops.js:
  lowercased, whitespace-collapsed, deduped, max 20 x 32 chars), exposed
  in publicView as `tags` ([] when unset — no migration needed).
- PATCH /environments/:id now takes `displayName` and/or `tags`, each
  optional and independently applied (full-replacement semantics for
  tags; [] clears). 400 when neither is present.
- New MCP tool set_environment_tags (same normalize path), documented in
  AGENT_USAGE.md next to the PATCH row.
- UI sidebar: a search box (matches name, displayName, preset, and tags;
  a leading # is stripped so "#demo" == "demo"), a group-by selector
  (flat / by preset / by tag — persisted in localStorage) with sticky
  collapsible group headers, and most-recently-used sort (an env's
  recency = its newest session lastActivityAt, falling back to
  createdAt). Under "by tag" an env appears under each of its tags;
  untagged envs land in an "untagged" bucket at the end.
- Env rows render clickable #tag chips (click = filter by that tag);
  the rename modal gains a comma-separated tags field and now does
  rename + tag in one PATCH.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wAFFJfN1MJvRqL9YyU3Zw
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