Skip to content

feat(ui): Env tab on site detail showing the project .env#366

Merged
geodro merged 1 commit into
mainfrom
feat/site-env-tab
May 17, 2026
Merged

feat(ui): Env tab on site detail showing the project .env#366
geodro merged 1 commit into
mainfrom
feat/site-env-tab

Conversation

@geodro
Copy link
Copy Markdown
Owner

@geodro geodro commented May 17, 2026

Summary

Adds an Env tab to the site detail view, sitting alongside Overview, Tinker, and Dumps. It renders the project's .env file as raw, selectable, copyable text with comments, blank lines, and original ordering all preserved, plus a one-click Copy button that mirrors the existing services-side EnvBlock styling. The tab is worktree-aware: when a worktree branch is selected in the header the view switches to that worktree's .env, matching how Tinker already behaves.

A new has_env field on the sites snapshot gates visibility so the tab only appears for sites that actually have a .env on disk; static or non-PHP projects without one stay clean. A new GET /api/sites/{domain}/env?branch=... endpoint serves the raw bytes via the same dispatcher that handles favicon, reusing resolveSitePath and ensureWorktreeEnvIfBranch so a freshly added worktree gets its .env materialised on first read.

EnvBlock was extended with an optional text prop so the new tab reuses the same component instead of duplicating the pre+copy markup; existing service callers that pass a vars map are unchanged. The PR also fixes a stale assertion in services.test.ts that was checking an older behaviour where parentSiteDomain built <name>.test strings rather than looking up the registered site domain.

Adds a new Env tab next to Overview, Tinker, and Dumps that renders the site's project .env file as raw, selectable, copyable text. The file shows verbatim, comments, blank lines, and ordering preserved, with a one-click copy button mirroring the existing services-side EnvBlock.

The tab only appears when the site actually has a .env file on disk, so non-Laravel or static sites that never had one stay clean. A new has_env field on the sites snapshot makes that gate cheap on the frontend, and a new GET /api/sites/{domain}/env endpoint serves the raw bytes, accepting the same ?branch= parameter the rest of the site routes use so the tab follows the active worktree selector just like Tinker does.

EnvBlock now accepts either a parsed vars map (existing service callers) or a raw text prop (the new site tab), keeping the styling and copy logic in one place. Fixes a stale services store assertion at the same time that was asserting the old behaviour where parentSiteDomain constructed <name>.test rather than looking up the registered site domain.
@geodro geodro merged commit 2c39714 into main May 17, 2026
3 checks passed
@geodro geodro mentioned this pull request May 18, 2026
geodro added a commit that referenced this pull request May 18, 2026
First beta of the 1.21.0 line. The headline is desktop notifications via Web Push (#353), with a per-category settings page polished alongside a dashboard health row (#354). The PHP-FPM image grows a real shell environment, zsh plus starship plus eza, bat, fzf, zoxide, isolated from the host (#358), then loses around 800 MB of build toolchain in a multi-stage split that drops the image from 1.36 GB to 535 MB without losing any of its 68 PHP modules (#364). A new on-demand commands feature surfaces one-shot framework actions across the dashboard, the lerd run CLI, the command palette, and four new MCP tools, all backed by a generalised Dropdown component that replaces every native select in the UI (#363). The site detail header gets a browser-style address bar with the favicon, TLS lock, LAN-share chip, and worktrees promoted from a dropdown to tabs (#365), an Env tab joins Overview, Tinker, and Dumps to show the project .env verbatim (#366), and the tray menu picks up Dump bridge and Notifications toggles that update live via a new KindDumpsStatus event (#373). Postgres grows 17 and 18 alternates alongside a new MySQL 9.7 LTS line, all gated by a canonical-version pin so flipping the yaml canonical no longer silently major-jumps existing installs (#361). Türkçe joins the dashboard languages (#355), a public_dir override lands in .lerd.yaml for projects with a non-standard document root (#370), every git invocation in the tree now flows through internal/git (#356), and worker-failure pushes are batched so a systemd cascade no longer fires six near-identical notifications back to back (#372). Plus the post-1.20.2 fix queue covers the worktree-manager button rendering on non-git sites (#357), TLS certs not refreshing when a secured site's domain set changed (#367), streamed worktree install and a wave of audit follow-ups (#368), and tinker swallowing bare-expression results when the dump bridge was on (#371).
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