feat(kanban): in-app board creation (P3 inline create) - #4237
Open
AlexMooreProblems wants to merge 4 commits into
Open
feat(kanban): in-app board creation (P3 inline create)#4237AlexMooreProblems wants to merge 4 commits into
AlexMooreProblems wants to merge 4 commits into
Conversation
Implements Phase 1 of the Kanban board: adds kind constants and a
base-36 order-preserving rank codec in buzz-core, board/card/move
builders in buzz-sdk, the `buzz boards` / `buzz cards` CLI surface, and
relay ingest scope for all three kinds.
Kinds (NIP-33 parameterized-replaceable, owner-authored, global-only):
- 31001 KIND_KANBAN_BOARD: ordered columns live on the board event.
- 31002 KIND_KANBAN_CARD: single `column` + `rank`; a move replaces the
card event, giving last-write-wins via NIP-33.
- 31003 KIND_KANBAN_CARD_MOVE: optional non-replaceable audit trail.
buzz-core
- kind.rs: add KIND_KANBAN_BOARD=31001, KIND_KANBAN_CARD=31002,
KIND_KANBAN_CARD_MOVE=31003.
- kanban.rs: base-36 order-preserving fractional rank codec with
strict betweenness (no trailing-0 invariant so string compare ==
numeric order). Unit-tested incl. a 5,000-insert fuzz.
buzz-sdk
- builders.rs: BoardMeta/build_kanban_board, CardMeta/build_kanban_card,
and a move-audit builder, with `h`/`invite` share tags and NIP-32
namespaced `["l", <label>, "kanban"]` labels.
buzz-relay
- ingest.rs: register all three kinds in required_scope_for_kind
(Scope::UsersWrite) and is_global_only_kind; add unit tests asserting
the scope + global-only behaviour.
buzz-cli
- boards.rs / cards.rs: `boards create/get/list/update/add-column/
rename-column` and `cards create/list/get/move/update`, wired into the
clap command tree.
- Buffer via a shared submit_lww_event that surfaces a superseded NIP-33
write ("duplicate:" response) as CliError::Conflict → exit code 5,
mirroring `buzz mem`.
- Fix the column-tag parser to parse name/wip/order by key rather than
fixed index: the 6-element no-wip form (["column",id,"name",<name>,
"order",<n>]) was reading the trailing order value into wip and losing
the order, corrupting boards with no-WIP columns on rename/add. Added
regression tests.
Validation: cargo test -p buzz-core -p buzz-sdk -p buzz-cli (all pass),
relay ingest tests (all pass), and an e2e against the isolated test
relay proving card move LWW (same card id, new column) and the exit-5
conflict surfaced when two moves race (49/60 attempts produced a
conflict; single-winner races show exit 0 + exit 5).
Co-authored-by: Alex Moore <mooorealexandert@gmail.com>
Signed-off-by: Alex Moore <mooorealexandert@gmail.com>
… (Phase 2) Builds the P2 read path for the kanban feature on top of kanban-phase1 (kinds 31001/31002/31003). Read-only: renders CLI-created boards and cards. - kinds: add KIND_KANBAN_BOARD/CARD/CARD_MOVE to desktop kinds.ts (mirror of buzz-core). - data layer (features/kanban/lib): kanbanTypes.ts tag parsers keyed by name (never index-fixed — same requirement as the P1 no-WIP fix), NIP-33 LWW collapse, rank sort via base-36 string compare; boardQueries.ts TanStack Query fetchers (boards by kinds:31001, board by #d, cards by #a board ref) + live subscription invalidation; useLiveBoard.ts grouping by column. - rail: BoardRail SidebarSection inserted immediately after Direct messages, wired to the sidebar collapse state (uses existing collapsedSections map so AppSidebar stays under the file-size ratchet). - routes: /boards (list) + /boards/$boardId (view), registered in routes.ts and routeTree.gen.ts. - components: BoardList, BoardView, KanbanColumn, CardTile, CardDetailModal (read-only; Radix Dialog + Markdown renderer). Disabled "+ New card" / Share / Filter affordances defer to P3/P4. - tests: 5 kanbanType parser tests (columns by name without wip, board/card parsing, LWW collapse, title derivation). Verified: typecheck clean, 3911 desktop tests pass, production build succeeds, biome + file-size/px-text/pubkey-truncation guards pass. Live GUI render against a CLI-created board + the shared/invite indexing question are flagged at the P2 gate for manual confirmation. Co-authored-by: Alex Moore <mooorealexandert@gmail.com> Signed-off-by: Alex Moore <mooorealexandert@gmail.com>
Resolves the P3 entry-gate: kanban kinds (31001/31002/31003) are stored
globally (channel_id = NULL) and belong to no relay-gated set (they are not
in AUTHOR_ONLY_KINDS, P_GATED_KINDS, SHARED_GATED_KINDS, or
RESULT_GATED_KINDS), so a bare {kinds:[31001]} REQ returns *every* community
board — the client-side access check is the real privacy boundary.
Moves the access predicate into the pure read-model module and extends it to
channel-shared boards:
- kanbanTypes: new exported boardIsAccessible(board, me, memberChannelIds):
visible when the reader owns the board, is named in an `invite` tag, OR is
a member of a channel the board was shared to via an `h` tag.
- boardQueries: useBoardsQuery/useBoardQuery/fetchBoards/fetchBoard now take
memberChannelIds and gate on boardIsAccessible; new useMemberChannelIds()
hook resolves the user's member channel ids from useChannelsQuery.
- UI: BoardRail, BoardList, useLiveBoard thread memberChannelIds through.
Tests: 5 new boardIsAccessible cases (no-id deny, owner case-insensitive,
invite, channel-shared member, unrelated deny). Typecheck clean; desktop
suite 3916 pass / 0 fail (was 3911).
Verified against relay source: author_only_filters_authorized, p_gated and
shared-gated gates all pass through for kanban kinds, and the read-path SQL
(global_only / channel_ids is null-or-in) always includes global events.
Co-authored-by: Alex Moore <mooorealexandert@gmail.com>
Signed-off-by: Alex Moore <mooorealexandert@gmail.com>
Enables the disabled 'New board' button on /boards: clicking opens a Radix dialog (name + template), and the board is signed under the Desktop's own identity and published, so it renders immediately — no CLI, no key handling. Also feeds the boards list via query invalidation and navigates to the new board. - boardWrite.ts: pure buildBoardEvent (kind 31001, d/name/p(owner) + per-column tags, wip omitted when unbounded, order 0-based contiguous, no h/invite) mirroring the SDK/CLI, plus createBoard() signing via signRelayEvent and publishing via relayClient.publishEvent. - NewBoardDialog.tsx: Radix dialog (name required, description optional, template select default kanban), pending + error states. - BoardList.tsx: live button wires the dialog; onCreated invalidates boardsQueryKey + navigates to /boards/; empty-state copy updated. Verified: tsc clean, 3920 desktop tests pass (was 3916; +4 boardWrite), biome clean, production vite build + file-sizes/px-text/pubkey-truncation guards pass. Co-authored-by: Alex Moore <mooorealexandert@gmail.com> Signed-off-by: Alex Moore <mooorealexandert@gmail.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.
P3 — In-app board creation (inline create, write path)
Turns the disabled "New board" button on
/boardsinto a working dialog. The board is signed under the Desktop's own identity and published to the relay, so it renders in/boardsimmediately — no CLI, no key handling. Stacks on #4200 (P1), #4208 (P2), #4218 (P3 read-gate).What's here
lib/boardWrite.ts— purebuildBoardEvent({ name, description?, template, owner })producing kind 31001 exactly as the SDK/CLIbuild_kanban_boarddoes:d/name/p(owner)tags + onecolumntag per template column (wippair omitted when unbounded,order0-based contiguous), noh/invite(private by default).createBoard()signs viasignRelayEventand publishes viarelayClient.publishEvent, returning theboardIdfor navigation. Documented that a fresh random UUID makes a NIP-33 collision effectively impossible, so publish-to-OK suffices here — and that the helper becomes the template for inline card create/move where LWW conflicts are real (that path must inspect the relay'sduplicate:response like the CLI's exit-5 path).ui/NewBoardDialog.tsx— Radix dialog (name required, description optional, template select defaulting tokanban), pending + error states with toasts.ui/BoardList.tsx— button now live (disabledonly while identity isn't loaded);onCreatedinvalidatesboardsQueryKey()and navigates to/boards/$boardId. Empty-state copy updated.KANBAN_TEMPLATESmirrors the CLItemplate_columns()(kanban/sprint/sales/blank).Verification (full suite, never scoped)
tscclean; desktop suite 3920 pass / 0 fail (was 3916; +4 newboardWritetests: kind/d/name/p tags, kanban wip-presence + no-wip columns, no h/invite + content, colid^col-[0-9a-f]{8}$).vite buildsucceeds; file-sizes / px-text / pubkey-truncation guards pass.Out of scope (explicit follow-ups)
@dnd-kitdrag-drop + optimistic exit-5 rollback, board/card sharing UI (h/invite), card comments.Co-authored-by: Alex Moore mooorealexandert@gmail.com
Signed-off-by: Alex Moore mooorealexandert@gmail.com