Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a070737
feat(sidebar): filter sections and expose hidden channels
tellaho Oct 16, 2026
8a826e2
feat(sidebar): sync section filters through relay preferences
tellaho Oct 16, 2026
f40eba7
feat(sidebar): place hidden channels inside the filter menu
tellaho Oct 16, 2026
d4e05bd
feat(sidebar): offer preset activity windows in a compact dialog
tellaho Oct 16, 2026
2df6f07
fix(sidebar): explain activity refresh failures and verify cleanup
tellaho Oct 16, 2026
c62dcac
fix(menu): mute trailing content in disabled rows
tellaho Oct 16, 2026
d5025fb
test(sidebar): align browser assertions with filter menus
tellaho Oct 17, 2026
a9cdc2a
fix(sidebar): retain apply focus during filter saves
tellaho Oct 18, 2026
07ddb22
fix(sidebar): preserve channels with unloaded activity
tellaho Oct 18, 2026
78b5289
fix(sidebar): clear removed section filter failures
tellaho Oct 18, 2026
a583cdd
fix(sidebar): dismiss cancelled filter save failures
tellaho Oct 18, 2026
9c430f2
Merge origin/main into tho/message-sidebar-filters-main
tellaho Oct 18, 2026
fccd639
test(sidebar): exercise unloaded activity in the filtered section
tellaho Oct 18, 2026
714b188
test(sidebar): compare disabled colors in one theme snapshot
tellaho Oct 18, 2026
ba83489
fix(sidebar): use filter icon for section filters
tellaho Oct 19, 2026
ad00cec
fix(sidebar): retain known inactivity through refreshes
tellaho Oct 19, 2026
6564157
fix(sidebar): label channels hidden by filters
tellaho Oct 19, 2026
b7b5d23
fix(sidebar): keep action focus in filtered sections
tellaho Oct 19, 2026
9f5b3a2
fix(sidebar): explain why recovery channels are hidden
tellaho Oct 19, 2026
adc882c
fix(sidebar): limit header focus to filter exclusions
tellaho Oct 19, 2026
475e2af
Merge origin/main into tho/message-sidebar-filters-main
tellaho Oct 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions browser-host/relay-broker.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { audienceAuthorityCommunity } from "../src/features/sessions/audience-authority.ts";
import { isSidebarPreferencesBatch } from "../src/features/relay/sidebar-preferences.ts";
import {
isCatalogKind,
MAX_EVENT_BYTES as CATALOG_EVENT_BYTES,
Expand All @@ -12,7 +13,12 @@ import { validStatusTemplate } from "./user-status.mjs";
import { memoryFilter, decodeAgentMemory } from "./agent-memory.mjs";
import { memoryResponseText } from "../src/features/agents/memory.ts";
import { prepareMedia } from "./media-preparation.mjs";
import { assertSidebarSortIntent, mutateSidebarSort } from "./sidebar-sort.mjs";
import {
assertSidebarSortIntent,
mutateSidebarSort,
assertSidebarFilterIntent,
mutateSidebarFilter,
} from "./sidebar-sort.mjs";
import { readProjectGit } from "./project-git.mjs";
import {
communityGitRepository,
Expand Down Expand Up @@ -680,7 +686,9 @@ export function validFilters(filters) {
return (
Array.isArray(filters) &&
filters.length >= 1 &&
(filters.length <= MAX_FILTERS || isWorkflowDefinitionBatch(filters)) &&
(filters.length <= MAX_FILTERS ||
isWorkflowDefinitionBatch(filters) ||
isSidebarPreferencesBatch(filters)) &&
filters.every(
(filter) =>
filter &&
Expand Down Expand Up @@ -1156,6 +1164,7 @@ export function relayBrokerPlugin({
"/api/relay/sidebar-section-order",
"/api/relay/sidebar-star",
"/api/relay/sidebar-sort",
"/api/relay/sidebar-filter",
"/api/relay/sidebar-mute",
].includes(route) &&
req.method === "POST"
Expand All @@ -1181,6 +1190,11 @@ export function relayBrokerPlugin({
assertSidebarStarIntent,
mutateSidebarStar,
],
"/api/relay/sidebar-filter": [
"channel-filter",
assertSidebarFilterIntent,
mutateSidebarFilter,
],
"/api/relay/sidebar-sort": [
"channel-sort",
assertSidebarSortIntent,
Expand All @@ -1192,7 +1206,8 @@ export function relayBrokerPlugin({
mutateSidebarMute,
],
}[route];
const sorting = coordinate === "channel-sort";
const sorting =
coordinate === "channel-sort" || coordinate === "channel-filter";
const muting = coordinate === "channel-mutes";
// Sort and order intents carry up to 100 section IDs.
const listing =
Expand Down Expand Up @@ -1321,7 +1336,14 @@ export function relayBrokerPlugin({
readHead,
publishEvent,
);
return sorting ? { groups: result } : result;
return coordinate === "channel-filter"
? {
groups: result.filters,
activeWindowSeconds: result.activeWindowSeconds,
}
: sorting
? { groups: result }
: result;
});
sidebarMutations.set(relay, mutation);
try {
Expand Down Expand Up @@ -1435,6 +1457,7 @@ export function relayBrokerPlugin({
attachmentUploads: true,
sidebarPreferences: true,
sidebarSortWrites: true,
sidebarFilterWrites: true,
channelActivity: true,
sidebarMuteWrites: true,
channelKit: true,
Expand Down
4 changes: 3 additions & 1 deletion browser-host/sidebar-preferences.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
SIDEBAR_COORDINATES,
} from "../src/features/relay/sidebar-preferences.ts";

export const SIDEBAR_REQUEST_BYTES = 768 * 1024; // Four bounded encrypted coordinates.
export const SIDEBAR_REQUEST_BYTES = 960 * 1024; // Five bounded encrypted coordinates.
export const SIDEBAR_HEAD_BYTES = 192 * 1024 + 4096; // One signed coordinate plus response framing.
export const SIDEBAR_UPLOAD_SLOTS = 2;
export const SIDEBAR_UPLOAD_MS = 10_000;
Expand Down Expand Up @@ -61,6 +61,8 @@ export function decodeSidebarPreferences(events, secret) {
decoded.get("channel-stars"),
decoded.get("channel-mutes"),
decoded.get("channel-sort"),
undefined,
decoded.get("channel-filter"),
);
} finally {
key.fill(0);
Expand Down
69 changes: 69 additions & 0 deletions browser-host/sidebar-sort-broker.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,72 @@ it("refuses invalid sort intent, excessive bodies and foreign origins before ups
);
expect(h.calls).toEqual([]);
});

it("persists filters through the real broker transport, preserves sort, confirms reset and rejects unsafe requests", async () => {
const h = await harness();
const signal = new AbortController().signal;
await h.transport.writeSidebarSort("channels", "recent", [], signal);
const savedSort = h.heads.get("channel-sort");
expect(
await h.transport.writeSidebarFilter(
"section:work",
"unreads",
["work"],
signal,
),
).toEqual({
filters: { "section:work": "unreads" },
activeWindowSeconds: {},
});
expect(
await h.transport.writeSidebarFilter(
"channels",
"active",
["work"],
signal,
7 * 86400,
),
).toEqual({
filters: { "section:work": "unreads", channels: "active" },
activeWindowSeconds: { channels: 7 * 86400 },
});
expect(h.heads.get("channel-sort")).toEqual(savedSort);
expect(
await h.transport.writeSidebarFilter(
"section:work",
"all",
["work"],
signal,
),
).toEqual({
filters: { channels: "active" },
activeWindowSeconds: { channels: 7 * 86400 },
});
for (const call of h.calls.filter(
({ body }) =>
Array.isArray(body) && body[0]?.["#d"]?.[0] === "channel-filter",
))
expect(call.body[0].consistency).toBe("strong");
expect(
(
await h.post(
{ group: "channels", mode: "recent", sectionIds: [] },
undefined,
"sidebar-filter",
)
).status,
).toBe(400);
expect(
(
await h.post(
{ group: "channels", mode: "all", sectionIds: [] },
"https://evil.test",
"sidebar-filter",
)
).status,
).toBe(403);
h.conflict();
await expect(
h.transport.writeSidebarFilter("channels", "unreads", [], signal),
).rejects.toThrow("Relay request failed (502)");
});
Loading
Loading