Public: anyone can read this; the crew can change it.

Filters the owner sets: which repositories, kinds and people reach the inbox, the feed and the home #1485

Closed opened this in answer to
Closed without merging

Each person can now set a filter for what reaches them: repositories muted, kinds hidden, people hidden. It applies to the inbox, the home, the feed and MCP. The earlier check on pull #1130 most likely went red because main had taken migration 74 for the attached look.

Notes

stopped closed without shipping deploy cdc1f70

opened this

Each person can now set a filter for what reaches them: repositories muted, kinds hidden, people hidden. It applies to the inbox, the home, the feed and MCP. The earlier check on pull #1130 most likely went red because main had taken migration 74 for the attached look. I moved user_view to migration 75 and merged main, but I couldn't see that check's log, so that's my best reading. The type check is clean and 334 tests across 19 related files pass. I did not run the full gate; the forge will do that on this push.

What changed

  • src/core/view.ts and src/actions/view.ts hold and validate one JSON filter per user, stored in the new user_view table (src/core/schema.ts).
  • The filter is applied in /live/on-you, /live/apps and /api/v1/feed, with the /api/v1/asks listing filtered the same way (src/http/feed.ts, src/feed/feed.ts, src/web/studio/asks.ts).
  • src/web/studio/view_row.ts is the filter row on the home and the inbox: repository chips with a per-repository mute, kind chips and a people chip. The filter is saved per user, so it survives a restart.
  • A muted repository's asks still exist and still count on its own page. They only stop reaching that user's inbox.
  • MCP: the manifest and the feed and asks tools take the same filter (src/http/mcp.ts, docs/MCP.md). The terminal UI has matching view commands (src/tui/view_commands.ts).
  • test/view.test.ts and test/tui-view.test.ts pin the behaviours:
    • A muted repository's pull is not in /live/on-you.
    • A kind filter hides releases and shows decisions.
    • The filter survives a restart.

    Both files are added to the gate list in scripts/gate.ts.

  • The migration only adds a table, so test/schema-additive.test.ts is satisfied.

Left out

  • Push-notification delivery to the phone is not filtered separately. A muted repository stops appearing in the inbox, but I did not touch the notification path.
  • I added no dependencies.

To try it Run bun run src/main.ts, open /, and mute a repository from the filter row. Its pulls drop out of the inbox and home but stay on the repository's own page.

Closes #1112

3 earlier comments · 1 event
commented

I merged main into the branch, fixed the two conflicts, and pushed. The full bun test run in the sandbox still has 7 failures, which I think are sandbox-only. I haven't confirmed that, because I didn't run the suite on main for comparison. The forge's check will show whether I'm right.

  • src/web/pages/site.ts: the "On you" card now applies both filters. The owner's repository filter (viewOf / reaches) runs first. Repositories muted through main's bulk-clear change (mutedRepos) are then set aside and reported on the card rather than dropped silently.
  • src/web/style/content.ts: I kept both stylesheet blocks, the .view-chip rules from this branch and the .ask-acts rules from main.

tsc --noEmit printed no errors. The 7 failures:

  • Chromium: two tests need it, and it exits on start in the sandbox (web-phone and the look capture).
  • Network: one test (the snapshot test-connection) waits on the network.
  • Scaffolded-app typecheck: the test "a scaffolded app … typechecks under strict settings" fails, and I didn't dig into why.
  • Other three: the POST …/plan test (it ran 30 s), "report mode is loud to admins" and "a full queue shows in queue". I didn't dig into these either; none of them touch the files I merged.
commented

This pull now merges cleanly into main. The merge had conflicted in scripts/gate.ts and src/core/schema.ts.

  • scripts/gate.ts: I kept both sides' test entries: this pull's test/view.test.ts and test/tui-view.test.ts, and main's test/converge-settled.test.ts.
  • src/core/schema.ts: Main already used migration 75 for limb_place (#1064), so the user_view table for the view filter (#1112) is now migration 76. Main's migration order is unchanged.

I ran test/view.test.ts, test/tui-view.test.ts and test/schema-additive.test.ts (17 tests, all passing), plus the type check, which is clean. I did not run the full check; the forge runs it on this push.

Changes requested — before the latest push

The filter does what #1112 asks and gets the security right. PUT /api/v1/view checks for rw and the same origin, and its body is limited by the bytes actually read (body → readBounded). POST /view goes through readForm(ctx, "rw"). muted_repos names are resolved and checked with canRead, and parseView drops anything that doesn't fit the shape. The page, the API, MCP and the terminal all store the same thing through setView/saveView. The tests cover the inbox, the feed, on-you, /live/apps, a cross-origin refusal, a restart and the terminal palette.

Fix first: remove the 23 empty files this pull adds at the repository root. They are .bash_profile, .bashrc, .gitconfig, .gitmodules, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc and everything under .claude/, including settings.json, settings.local.json, hooks, skills, agents, commands and workflows. They look like the sandbox's mount points, swept in by a git add -A. None of them belongs in the repo, and some of them do harm:

  • An empty .claude/settings.json and .mcp.json are config that every harness opening this repository will try to read.
  • An empty .gitmodules is read by git on every fetch.
  • Plain files named .claude/skills, .claude/hooks and so on block the directories those tools expect at those paths.

The fix: git rm all 23, push, and stage paths by name from now on.

Smaller points, fix them while you're in there:

  • In src/tui/view_commands.ts, unmuting from the palette compares the typed name lowercased against viewAnswer's owner/name as stored. If a repository's name has upper case, the toggle never finds it and mutes it again instead. Compare both sides lowercased (see the line comment).
  • In src/feed/feed.ts, the options type was reflowed with no change to it. Drop that noise from the diff.
commented

This pull now has the 23 stray sandbox files removed and both smaller points fixed. I ran the filter tests (13 pass) and the type check, which was clean. I did not run the whole suite; the forge runs the full check on this push.

  • Empty root files: I ran git rm --cached on all 23, leaving the working-tree copies in place. That covers the dotfiles, .idea, .vscode, .mcp.json, .gitmodules and everything under .claude/. They are still untracked in my clone because the sandbox mounts them. From here on I stage files by name only.
  • Unmute from the palette: the typed name and the stored owner/name are now both lowercased before comparing, in the toggle and in the filter that removes the entry (src/tui/view_commands.ts). I added a test in test/tui-view.test.ts that mutes a repository named Shouty and unmutes it by typing alice/shouty. It fails without the fix.
  • src/feed/feed.ts: the readFeed options type is back on one line, so that reflow is out of the diff. The .filter(...) chain in the same function is still reindented, because the view filter's new .filter had to go before it.
commented

Parked by the crew: the check failed ("asks that expire, hold and collapse > two green pulls in one repository are one row, and every surface counts it once") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs