Skip to content

fix(web): apply Manage Projects filter to the session sidebar - #108

Merged
setkyar merged 3 commits into
mainfrom
fix/sidebar-project-filter
Aug 18, 2026
Merged

fix(web): apply Manage Projects filter to the session sidebar#108
setkyar merged 3 commits into
mainfrom
fix/sidebar-project-filter

Conversation

@setkyar

@setkyar setkyar commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #107

The homepage hides sessions from disabled projects when the Manage Projects master filter is on, but the session sidebar's Projects tab (and the Sessions tab's project switcher) fetched the unfiltered GET /api/projects list, so disabled projects still appeared there.

Changes

  • Backend (internal/server/projects.go): GET /api/projects accepts filtered=1. When the master filter is on, disabled projects are dropped before pagination so total and offsets stay correct. The project passed as current is always kept, so the project you're currently in never disappears from the sidebar. Without the param (Manage Projects modal) or with the filter off, behavior is unchanged.
  • Frontend: defaultFetchProjects gained a filtered option; SessionSidebarProjects.svelte and the SessionSidebarSessions.svelte project switcher pass filtered: true. Expanding a kept-but-disabled current project still works because per-project session loads use /api/sessions?project=X, which bypasses the filter by design.
  • Tests: new TestHandleApiProjectsFiltered (filter off no-op, no param unfiltered, disabled dropped with adjusted total, disabled current project kept and sorted first); updated fetchProjects arg assertions in SessionSidebarProjects.test.js.
  • Docs: updated the Project Visibility section in docs/architecture/system-overview.md and the /api/projects row in docs/architecture/backend.md.

make check passes (lint, format-check, vitest + go test, build, vet).

Introduce web/src/shared/keybindings.js: a single source of truth for the
remappable global/navigation/composer shortcuts, plus matcher helpers. Migrate
the five inline handlers (keyboard-nav, session-globals, SessionsPage index,
search-filters, textarea-controls) to ask the registry `matchesAction(id, e)`
instead of hardcoding `e.key === …` / modifier checks.

Pure refactor — defaults are unchanged and no override loading exists yet, so
behavior is identical. All 722 frontend tests pass with no changes to the
existing handler tests, confirming parity. Structural modal keys (Escape,
arrows, Tab focus-traps), Enter-to-submit, and the multi-key `g g` sequence are
intentionally left hardcoded; they are UI affordances, not preferences.

Groundwork for #43 (customizable shortcuts). The settings UI, override
persistence, conflict detection, and modal reflection land in a follow-up PR
stacked on this one.
On layouts where '/' is a shifted key (German, French, ...), Cmd+/ arrives
with shiftKey=true and the strict modifier check made the shortcuts-help
binding unreachable. Shift is now only enforced where it changes meaning:
letters and named keys like Tab. For punctuation, event.key is already the
shifted result, so an unrequested Shift is layout noise.
GET /api/projects now accepts filtered=1, which applies the
enabled-projects allowlist server-side (so pagination and totals stay
correct) while always keeping the current session's project visible.
The sidebar Projects tab and the Sessions tab's project switcher pass
the flag; the Manage Projects modal keeps fetching the full list.

Fixes #107
@setkyar
setkyar merged commit 2a3fe07 into main Aug 18, 2026
6 checks passed
@setkyar
setkyar deleted the fix/sidebar-project-filter branch August 18, 2026 06:29
daveyijzermans pushed a commit to daveyijzermans/pi-web that referenced this pull request Aug 23, 2026
Default E2E matrix now runs only Desktop Chrome + Mobile Chrome (Pixel 5)
for fast PR feedback. Full 7-project matrix (Firefox, Safari, iPad) runs
on pushes to main via E2E_FULL_MATRIX=1 env var.

Closes ygncode#108
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.

Session sidebar Projects list ignores the Manage Projects filter

1 participant