Skip to content

feat(settings): the Secrets tab edits each dev env file - #86

Merged
flowtricks merged 2 commits into
flowtricks:mainfrom
SylvainDruaux:feat/secrets-env-files
Nov 17, 2026
Merged

flowtricks merged 2 commits into
flowtricks:mainfrom
SylvainDruaux:feat/secrets-env-files

Conversation

@SylvainDruaux

@SylvainDruaux SylvainDruaux commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The Secrets tab only showed .env, but the dev server also loads .env.local, .env.development and .env.development.local (later files win). A key set only in .env.development was invisible, and a key overridden in .env.local showed a value dev doesn't use.

What changes

  • A dropdown under the title picks one of the four files, in load order, opening on .env.
  • A row whose name a later file sets again says "Dev uses the value in ".
  • .env.development gets no .gitignore offer and no Git warning: it's usually committed on purpose.
  • Every message names the chosen file, in the five languages. The MCP tab still writes to .env.

Two changes to your existing tab, so you know why

  1. The "Create .env file" button is gone. With the dropdown, you often land on a file that doesn't exist yet, and the empty state then showed two buttons, "Create .env.local file" and "Add secret", that end up doing the same thing: adding a secret already creates the file (private, 0600). An empty file with no secret isn't useful on its own. So "Add secret" is now the only way in, and the empty state says "No .env.local file yet. Adding a secret creates it." An existing empty file now says ".env.local is empty." instead of "Adding a secret creates .env". The create change is still in the contract: the MCP tab uses it.
  2. No button text wraps anymore. The .gitignore warning is now just the "Add to .gitignore" button, with the explanation in its tooltip, and the "tracked" warning is shorter. Checked in all five languages at 560 and 440 px.

Before (no .env yet):
before

After (no .env yet):
after

Tests

Contract, main process and panel tests cover each file, the overrides, the .gitignore refusal for .env.development and the file switch clearing revealed values. Full local gate: 974/974.

The Secrets tab read and wrote `.env` only, while the dev server also loads `.env.local`, `.env.development` and `.env.development.local`, later files winning. A key set only in `.env.development` did not show, and a key overridden in `.env.local` showed a value dev does not use.

A dropdown under the title now picks one of the four files, listed in load order and opening on `.env`. Every `secrets:*` message names its file, and the parser refuses any other name, `.env.production` included. A row whose name a later file sets again says "Dev uses the value in <file>", worked out in the main process from that file's names alone. Switching files remounts the view, so nothing revealed or typed for one file is shown beside another's names.

`.env.development` is usually committed on purpose, for values that are not secret, so the tab offers no .gitignore rule for it and shows no Git warning; `secrets:ignore` refuses it too.

The layout keeps every button on one line: the .gitignore offer is the button alone, its explanation in the tooltip, and the tracked warning is shorter. The empty state no longer has a Create button, since adding a secret already creates the file, private; an existing empty file now says it is empty instead of "Adding a secret creates .env". The texts that named `.env` name the chosen file, in the five languages.

The MCP tab still stores secrets in `.env`. The Sanity login and the page template env read now share the same file list, so the Sanity login also reads `.env.development.local`.
The "Add to .gitignore" button carries its reason only in its tooltip, and that tooltip was the system's: it waited about a second and a half and, on macOS, did not show again on a second hover. The button now uses the app's delayed tip, as the info mark beside the title does, so the reason shows after the shared wait on every hover. Screen readers still read it as the button's description.
@flowtricks
flowtricks merged commit 45230c7 into flowtricks:main Nov 17, 2026
22 checks passed
@SylvainDruaux
SylvainDruaux deleted the feat/secrets-env-files branch November 17, 2026 17:59
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.

2 participants