feat(environments): the UI, the routes and the badge - #200
Merged
Merged
Conversation
`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.
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
594907conmainlanded the schema, the seed andEnvironmentService. This is the rest of the feature — everything between the service and the screen.What's here
GET/POST/PATCH/DELETE /environments, wired intoserver.tsand the runtime, plusenvironmentIdon the database create and update payloads and the client methods for all of it.SettingsScreenfor naming an environment and picking its hue, reached throughui-slice;EnvironmentBadgein the connection picker, the status bar and the database explorer; the hue tokens in both themes.EnvironmentService.removenow reads the row before opening the transaction rather than taking it out of the update's result. Anything thrown insideappDatabase.transactionbecomes anAppDatabaseError, which is internal and surfaces as a 500 — but a missing environment is a 404.DatabaseService.removereads it up front for the same reason. The soft delete stays guarded ondeletedAt, 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 smaller594907cthat reachedmainseparately. It has been rebased ontomainand reworded; the two conflicts were inschemas.ts(whitespace) andenvironment-service.ts(theremoverework above, which is the newer of the two).Verification
yarn typecheck,yarn lintandyarn format:checkclean.yarn testpasses 1601 tests across 128 files.🤖 Generated with Claude Code
https://claude.ai/code/session_0156WamccrozzRDnhxs9nRH7