Skip to content

fix(ui): make Feed tab clickable — add /feed route + tabFromPath branch#4

Merged
aksOps merged 2 commits into
mainfrom
fix/feed-tab-route
Apr 26, 2026
Merged

fix(ui): make Feed tab clickable — add /feed route + tabFromPath branch#4
aksOps merged 2 commits into
mainfrom
fix/feed-tab-route

Conversation

@aksOps

@aksOps aksOps commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

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:

  • `App.tsx` has explicit routes for every tab except `/s/:name/feed`. Clicking Feed calls `navigate("/s//feed")` which matches the catch-all `` and yanks the user back to the dashboard — symptom: "Feed tab unclickable".
  • `tabFromPath` has no `endsWith("/feed")` branch (it relied on the implicit default that used to be feed). Even if the route existed, the tab indicator would stay on Pane.

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

  • `go test -tags sqlite_fts5 ./internal/serve/` clean locally with the cost-store fix
  • PR check (`build-and-test`) green
  • Browser verify after merge: clicking Feed tab navigates to `/s//feed` and renders FeedStream

🤖 Generated with Claude Code

aksOps and others added 2 commits April 26, 2026 06:46
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>
@aksOps aksOps merged commit c387df0 into main Apr 26, 2026
8 checks passed
@aksOps aksOps deleted the fix/feed-tab-route branch May 1, 2026 06:55
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