feat(connections): add environment label to saved connections - #515
feat(connections): add environment label to saved connections#515maximumbreak wants to merge 3 commits into
Conversation
Lets a connection be tagged with an environment (local, development, testing, staging, uat, production, or a free-form custom name) from the General tab of the connection form. The active environment is shown as a suffix on the OS window title and the Explorer sidebar header once connected, and as a plain badge on each connection's card/row in the connections dashboard. Purely a display label — no color-coding or destructive-query safeguards are tied to it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The window title was only patched in DatabaseProvider's title effect, but two other title-setting spots were missed: the Editor page runs its own more specific title effect (reacting to tab/split-view changes) that overwrites it, and the standalone ER/schema diagram window sets its title once at creation with no environment support. Both now include the same "[environment]" suffix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
| const activeDriver = activeData?.driver ?? null; | ||
| const activeCapabilities = activeData?.capabilities ?? null; | ||
| const activeConnectionName = activeData?.connectionName ?? null; | ||
| const activeEnvironment = activeData?.environment ?? null; |
There was a problem hiding this comment.
WARNING: activeEnvironment derives from connectionDataMap, which is only populated during connect. When a connection's environment is edited and saved, loadConnections refreshes the connections list but not connectionDataMap, so the window title and sidebar header show the stale environment until the connection is disconnected and reconnected.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| const [dbSearchQuery, setDbSearchQuery] = useState(""); | ||
| const [detectJsonInTextColumns, setDetectJsonInTextColumns] = useState(false); | ||
| // "" = none, one of ENVIRONMENT_PRESETS, or "custom" (free text in environmentCustomValue) | ||
| const [environmentPreset, setEnvironmentPreset] = useState(""); |
There was a problem hiding this comment.
WARNING: These new environment states are reset when the modal opens, but handleDriverChange does not reset them. When switching from edit mode to a new connection via the catalogue without closing the modal, stale environment values persist and can be accidentally saved to the original connection.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| {t("newConnection.environment", { defaultValue: "Environment" })} | ||
| </label> | ||
| <Select | ||
| value={environmentPreset || null} |
There was a problem hiding this comment.
SUGGESTION: value={environmentPreset || null} converts "" to null, which prevents the "None" option from being highlighted in the Select dropdown (the component compares value === option).
| value={environmentPreset || null} | |
| value={environmentPreset} |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (17 files)
Fix these issues in Kilo Cloud Reviewed by step-3.7-flash · Input: 203.4K · Output: 41.6K · Cached: 3.3M |
8918e52 to
79df2ad
Compare
|
Hey @maximumbreak , |
Demo
Screen.Recording.2569-07-23.at.07.14.58.mov
Summary
environmentfield to saved connections (local, development, testing, staging, uat, production, or a free-form custom name) via a dropdown on the General tab of the connection form.[environment]suffix on every window-title path: the main window title, the Editor page's own title effect (tab/split-view aware), and the standalone ER/schema diagram window.Test plan
cargo check/cargo test --lib(backend, incl. new serde roundtrip + backward-compat tests)tsc -b --noEmit(frontend types)pnpm vitest run— full suite passes (3069 tests), incl. newtests/utils/environments.test.ts