diff --git a/README.md b/README.md index de09ee2..53ef63b 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Open `http://localhost:8000` in your browser. On first boot, Firebreak redirects - **Forgejo instance URL** — use HTTPS unless Forgejo is a local service or loopback endpoint - **OAuth credentials** — register an OAuth application in Forgejo first (Settings → Applications → Create OAuth2 Application), then paste the Client ID and Client Secret -- **Public base URL** (optional) — your production domain for OAuth redirects +- **Public base URL** (required) — confirm the pre-filled URL or replace it with the Firebreak URL you want to use for OAuth redirects ### 4. Sign In and Register Your Token diff --git a/agents.md b/agents.md index 6543ea5..f11527f 100644 --- a/agents.md +++ b/agents.md @@ -140,11 +140,11 @@ This file is the single source of truth for codebase obstacles, oddities, and th **Solution/Workaround:** Resolved by migrating the web CSS build to pnpm (`@tailwindcss/cli`), which ships a normally signed binary. If the standalone binary is ever re-downloaded, fix with `xattr -c web/tailwindcss && codesign --force --sign - web/tailwindcss`. Diagnose this class of failure with `/usr/bin/log show --predicate 'eventMessage CONTAINS[c] "tailwind"'`. **Preference:** Prefer the pnpm-managed CLI; do not re-add the standalone binary. -### Tailwind `--watch` exits when stdin is closed -**Area:** web/package.json (`css:watch` script) -**Obstacle:** Tailwind v4 `--watch` keeps watching only while stdin is open. Under non-interactive shells and some CI contexts stdin closes immediately, so the watcher builds once, exits 0, and silently stops watching. This looks identical to a broken watcher and is easy to misdiagnose. -**Solution/Workaround:** No change needed for normal use — `dev.sh` backgrounds the watcher from an interactive terminal, which inherits an open stdin. If a caller needs watching without a tty, pass `--watch=always`. -**Preference:** Use bare `--watch` for interactive dev; reserve `--watch=always` for headless callers. +### Tailwind watcher can stop on stdin +**Area:** web/dev.sh, web/package.json (`css:watch` script) +**Obstacle:** With job control enabled, the background watcher can stop on SIGTTIN when bare `--watch` reads terminal stdin. With closed stdin it instead exits after the first build. +**Solution/Workaround:** Redirect the background watcher's stdin to `/dev/null` and use `--watch=always`. Keep process-group cleanup in `dev.sh`. +**Preference:** Keep the watcher independent of terminal input. For an isolated smoke check, run the installed CLI against temporary CSS rather than linking the workspace's `node_modules` into a separate pnpm project. ### pnpm install failed with exit 1 on blocked build scripts **Area:** pnpm-workspace.yaml @@ -265,3 +265,9 @@ This file is the single source of truth for codebase obstacles, oddities, and th **Obstacle:** Non-JSON responses or invalid JSON shapes raised outside the dashboard/picker's HTTP error boundary. Pydantic v2 also lets a validator's `TypeError` escape validation. **Solution/Workaround:** Validate expected JSON shapes in the client, use `ValueError` for field validation, and return a sanitized 502 for malformed data. **Preference:** Keep the dashboard and picker usable without displaying upstream response content. + +### Failed picker requests can reveal stale selections +**Area:** web/app/templates/dashboard.html, web/app/templates/snapshot_picker.html +**Obstacle:** HTMX clears its loading indicator after a failed request without replacing the old branch or commit controls. +**Solution/Workaround:** Mark the dependent fragment `inert` before sending a request and replace its outer element only when a response swaps. Show an inline error if the old fragment remains after loading. +**Preference:** Don't allow a stale selection to submit; preserve the dialog's layout during loading and failure. diff --git a/web/app/static/css/input.css b/web/app/static/css/input.css index e0d25aa..73a253c 100644 --- a/web/app/static/css/input.css +++ b/web/app/static/css/input.css @@ -534,16 +534,23 @@ align-content: start; } - .picker-load-scope > :is(.picker-loading, .picker-loaded) { + .picker-load-scope > :is(.picker-loading, .picker-loaded, .picker-load-failed) { grid-area: 1 / 1; } .picker-loading, + .picker-load-failed, + .picker-loaded[inert], .picker-load-scope.htmx-request > .picker-loaded { visibility: hidden; } - .picker-load-scope.htmx-request > .picker-loading { + .picker-loaded[inert] { + opacity: 0; + } + + .picker-load-scope.htmx-request > .picker-loading, + .picker-load-scope:not(.htmx-request):has(> .picker-loaded[inert]) > .picker-load-failed { visibility: visible; } diff --git a/web/app/templates/dashboard.html b/web/app/templates/dashboard.html index 6b8519e..e169e85 100644 --- a/web/app/templates/dashboard.html +++ b/web/app/templates/dashboard.html @@ -61,6 +61,11 @@ + {% endif %}
diff --git a/web/app/templates/snapshot_picker.html b/web/app/templates/snapshot_picker.html index 5a4cdf1..876a6b0 100644 --- a/web/app/templates/snapshot_picker.html +++ b/web/app/templates/snapshot_picker.html @@ -13,7 +13,7 @@ hx-get="{{ url_for('get_snapshot_picker_step', step='branch').path }}" hx-trigger="change" hx-target="#snapshot-branch-content" - hx-swap="innerHTML" + hx-swap="outerHTML" hx-indicator="#snapshot-branch-scope" hx-sync="#snapshot-picker:replace"> @@ -25,8 +25,11 @@

Loading branches…

-
- {% block branch_steps %} +

+ Could not load branches. Choose a repository again or reopen the picker. +

+ {% block branch_steps %} +
@@ -40,7 +43,7 @@ hx-trigger="change" hx-include="#snapshot-repository" hx-target="#snapshot-commit-content" - hx-swap="innerHTML" + hx-swap="outerHTML" hx-indicator="#snapshot-commit-scope" hx-sync="#snapshot-picker:replace"> @@ -60,7 +63,7 @@ hx-get="{{ url_for('get_snapshot_picker_step', step='branch').path }}" hx-include="#snapshot-repository" hx-target="#snapshot-branch-content" - hx-swap="innerHTML" + hx-swap="outerHTML" hx-indicator="#snapshot-branch-scope" hx-sync="#snapshot-picker:replace">Retry {% endif %} @@ -72,8 +75,11 @@

Loading commits…

-
- {% block commit_step %} +

+ Could not load commits. Choose a branch again or reopen the picker. +

+ {% block commit_step %} +
@@ -115,11 +121,11 @@ {% endif %}
- {% endblock %} -
+
+ {% endblock %}
- {% endblock %} -
+
+ {% endblock %}
{% endblock %} diff --git a/web/dev.sh b/web/dev.sh index 5c2dccd..2d2e921 100755 --- a/web/dev.sh +++ b/web/dev.sh @@ -19,7 +19,7 @@ echo " PostgreSQL / db / firebreak / firebreak / firebreak_db" echo " CSS: watching app/static/css/input.css" set -m -pnpm run css:watch & +pnpm run css:watch