Tasks: remember the List/Board choice per project - #1704
Open
builtui wants to merge 1 commit into
Open
Conversation
The view mode lived only in the URL, and every route into a project pinned the list: the sidebar fell back to "list", the task breadcrumb and the New project dialog hardcoded it, and a bare "<projectId>" subPath parsed to it. Picking Board, opening a task, and coming back therefore landed on the list again, every time. A project route's view is now nullable — "no view named" is distinct from "list" — and the shell resolves a null view through a new client-local preference, the same localStorage boundary the sidebar and list preferences already use so one client does not rewrite another client on the same bb server. The topbar toggle is the only place a user picks a view, so navigating with an explicit view is what records the choice. Projects opened for the first time follow the view most recently chosen anywhere, then the list; the routes that used to hardcode "list" now name no view and let the preference answer. Fixes get-bb#1702 Co-Authored-By: Claude Opus 5 (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.
Fixes #1702
Problem
The Tasks view mode lives only in the URL, and every route into a project pinned the list:
"list"view: "list"view: "list"<projectId>subPath (reload, deep link)"list"So picking Board, opening a task, and coming back landed on the list — every time. The two neighbouring preferences already persist: sidebar collapsed state (
shell/sidebar-preference.ts) and list filters/sort (views/list/list-preference.ts).Change
A project route's
viewis nowTaskViewMode | null, so "no view named" is distinct from "list". The shell resolves a null view through a newshell/view-preference.ts— the same client-locallocalStorageboundary the sidebar and list preferences use, so one client does not rewrite another client connected to the same bb server."list"now name no view and let the preference answer.list-preference.ts: unknown values are ignored, corrupt documents read as unset, and a document written by a newer client is left untouched rather than down-converted.An unknown marker (
?view=kanban) now resolves through the preference instead of silently meaning "list".Tests
shell/view-preference.test.ts— fallback chain, per-project isolation, corrupt documents, future-version write refusal.shell/shell.test.tsx— round-trips the marker-less project route; toggling Board then reopening the bare project URL renders the board; per-project choices stay apart while an unseen project follows the last one used; the sidebar navigates without pinning a view; toggling still works when storage rejects writes.turbo run typecheck test --filter=bb-plugin-tasks: 36 test files pass, typecheck clean.Notes
Client-local UI state only — no contract, RPC, CLI, or docs surface changes.