Skip to content

feat(environments): the UI, the routes and the badge - #200

Merged
Artmann merged 2 commits into
mainfrom
feat/environment-labels-ui
Sep 18, 2026
Merged

Artmann merged 2 commits into
mainfrom
feat/environment-labels-ui

Conversation

@Artmann

@Artmann Artmann commented Sep 18, 2026

Copy link
Copy Markdown
Owner

594907c on main landed the schema, the seed and EnvironmentService. This is the rest of the feature — everything between the service and the screen.

What's here

  • Routes: GET/POST/PATCH/DELETE /environments, wired into server.ts and the runtime, plus environmentId on the database create and update payloads and the client methods for all of it.
  • UI: SettingsScreen for naming an environment and picking its hue, reached through ui-slice; EnvironmentBadge in the connection picker, the status bar and the database explorer; the hue tokens in both themes.
  • EnvironmentService.remove now reads the row before opening the transaction rather than taking it out of the update's result. Anything thrown inside appDatabase.transaction becomes an AppDatabaseError, which is internal and surfaces as a 500 — but a missing environment is a 404. DatabaseService.remove reads it up front for the same reason. The soft delete stays guarded on deletedAt, so a concurrent second delete does not move the timestamp.

Note on the history

This was sitting as an unpushed local commit on top of f08581e, alongside the smaller 594907c that reached main separately. It has been rebased onto main and reworded; the two conflicts were in schemas.ts (whitespace) and environment-service.ts (the remove rework above, which is the newer of the two).

Verification

yarn typecheck, yarn lint and yarn format:check clean. yarn test passes 1601 tests across 128 files.

🤖 Generated with Claude Code

https://claude.ai/code/session_0156WamccrozzRDnhxs9nRH7

`594907c` landed the schema, the seed and `EnvironmentService`. This is the
rest of it: the HTTP routes, the client, and everywhere an environment shows
up in the app.

- `GET/POST/PATCH/DELETE /environments`, wired into `server.ts` and the
  runtime, plus `environmentId` on the database create and update payloads.
- `SettingsScreen` for naming environments and picking a hue, reached from
  `ui-slice`; `EnvironmentBadge` in the connection picker, the status bar and
  the database explorer; the hue tokens in both themes.
- `EnvironmentService.remove` reads the row before the transaction rather
  than out of its result: anything thrown inside `appDatabase.transaction`
  becomes an `AppDatabaseError`, which is internal and would answer 500 where
  this is a 404. `DatabaseService.remove` reads it up front for the same
  reason.
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 11b1b18.

CI's Fallow job fails the build on dead exports and on functions over its
complexity thresholds. Three of them arrived with the environment work.

- `CreateEnvironmentResponse` and `UpdateEnvironmentResponse` exported a type
  alias nobody imports -- the schema consts are what `groups/environments.ts`
  uses. `ListEnvironmentsResponse` and `DeleteEnvironmentResponse` next to
  them already export the const alone.
- `seedQueryCache` had grown a branch per seedable query. They are all the
  same shape, so it is a list of option-and-key pairs now, and adding a query
  to the app is one line here instead of five.
- `DatabaseForm` carried its own default values and both SQLite gates. The
  defaults move to `buildDefaultValues`, where the fallbacks for a create are
  not counted against the component that renders them, and the two
  `databaseType !== 'sqlite'` blocks become one `ServerOnlySections` -- one
  gate rather than one per section, so the two cannot come apart.

`npx fallow@3.2.0` now exits 0. The remaining note, tailwindcss as a dev
dependency used in production, predates this branch.
@Artmann
Artmann merged commit 71827c2 into main Sep 18, 2026
9 checks passed
@Artmann
Artmann deleted the feat/environment-labels-ui branch September 18, 2026 04:41
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