fix(ui): make Feed tab clickable — add /feed route + tabFromPath branch#4
Merged
Conversation
Commit 1e92e7d ("move Pane to first tab") flipped the URL default from feed → pane but missed two follow-ups: 1. App.tsx has explicit routes for every tab except `/s/:name/feed`. When the user clicked Feed, navigate("/s/<name>/feed") matched the catch-all `<Navigate to="/" replace />` and yanked them back to the dashboard — the visible symptom was "Feed tab unclickable". 2. tabFromPath had no `endsWith("/feed")` branch (it relied on the implicit default that used to be feed). Even if the route had existed, the tab indicator would have stayed on Pane. Add the route and the branch. No other changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mattn/go-sqlite3 surfaces a missing parent dir as the unhelpful
"unable to open database file: no such file or directory" error.
Production opens ctm.db at ~/.config/ctm/ctm.db — on a fresh install
or a CI runner with no pre-existing config dir, the parent doesn't
exist and OpenCostStore fails before doing anything useful.
Add a defensive os.MkdirAll(filepath.Dir(path), 0o700) at the top of
OpenCostStore. Skipped for the in-memory path (":memory:" → Dir
returns "." which is a no-op anyway, but explicit guard reads
better). Mkdir errors are swallowed — if mkdir fails we let
sql.Open surface the real problem instead of masking it.
Side benefit: server_test.go's TestHealthz* / TestAuth* etc. were
flakily passing or failing depending on whether earlier-running
test packages (alphabetical: internal/config, …) created
~/.config/ctm/ as a side effect. CI runs without a populated test
cache hit this regularly. Now they're independent.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Two atomic commits, both small:
1. `fix(ui)`: make Feed tab clickable
Commit `1e92e7d` ("move Pane to first tab") flipped the URL default from feed → pane but missed:
Adds the route and the branch.
2. `fix(store)`: mkdir cost-DB parent dir on `OpenCostStore`
mattn/go-sqlite3 surfaces a missing parent dir as the unhelpful "unable to open database file: no such file or directory". Production opens `ctm.db` at `~/.config/ctm/ctm.db` — on a fresh install or CI runner with no pre-existing config dir, the parent doesn't exist.
Add a defensive `os.MkdirAll(filepath.Dir(path), 0o700)` at the top of `OpenCostStore`. Skipped for `:memory:`. Mkdir errors are swallowed — if mkdir fails we let `sql.Open` surface the real problem instead of masking it.
This also fixes flaky CI behaviour: `server_test.go`'s `TestHealthz*` / `TestAuth*` etc. were intermittently passing/failing depending on whether earlier-running test packages (`internal/config`, …) had created `~/.config/ctm/` as a side effect. Surfaced in this PR's CI run before the fix was added.
Test plan
🤖 Generated with Claude Code