make admin ui #1

Closed
opened 2026-03-19 18:50:16 +00:00 by despiegk · 4 comments
Owner

like _ui
how we did for ../hero_collab

follow skill

some examples of what we did on hero_collab

image

we want groups, rights on groups
users

workspaces, so we can put whiteboards per workspace

rights on workspaces

right mouse button for mgmt

in a subagent do /hero_admin_connection_status
in another subagent check /hero_crates_best_practices_check

like _ui how we did for ../hero_collab follow skill some examples of what we did on hero_collab ![image](/attachments/ce29d540-3545-4e6f-b316-477bf240c2cd) we want groups, rights on groups users workspaces, so we can put whiteboards per workspace rights on workspaces right mouse button for mgmt in a subagent do /hero_admin_connection_status in another subagent check /hero_crates_best_practices_check
529 KiB
Author
Owner

Implementation Spec for Issue #1: Make Admin UI

Objective

Rebuild the hero_whiteboard_ui admin dashboard following the proven patterns from hero_collab_ui, replacing the current placeholder implementation with a full-featured, single-page admin interface. Add Groups with role-based security rights, workspace-scoped permissions, right-click context menus for all entities, and a connection status widget. The server must also gain group/rights RPC endpoints and a new database migration.

Requirements

  • Rewrite the admin UI as a single-file SPA (all HTML in index.html extending base.html), matching the hero_collab_ui architecture
  • Replace CDN links with locally-embedded static assets (Bootstrap 5.3.3, Bootstrap Icons, Unpoly) via rust-embed
  • Add Groups tab with: create/edit/delete groups, group-to-workspace scoping, group membership (users and nested groups), resolved member view
  • Add Security Rights on groups: admin, workspace_manage, board_manage, workspace_admin, group_manage -- with workspace scoping for applicable rights
  • Add Dashboard tab with health stats and recent activity
  • Right-click context menus for management actions (edit, delete) on all entity rows
  • Connection status widget (green/yellow/red dot in navbar) with clickable popover
  • Dark/light theme toggle with localStorage persistence
  • Tab bar with badge counts (Dashboard, Workspaces, Boards, Users, Groups, API Docs)
  • Stats sidebar with widget counts
  • Toast notifications for success/error feedback
  • Modals for create/edit operations
  • Hash-based tab routing
  • Auto-refresh on 10-second intervals
  • Server: add groups, group_members, group_rights tables via migration 003
  • Server: add group.create/get/list/update/delete, group.member.add/remove/list, group.members.resolve, group.rights.get/set, system.ping RPC methods
  • Update openrpc.json with all new methods
  • UI main.rs should use clap for CLI args and axum::serve
  • Add /health and /.well-known/heroservice.json endpoints

Implementation Plan (10 Steps)

Step 1: Server -- Add Groups Database Migration

  • Create 003_groups.sql (groups, group_workspaces, group_members, group_rights, group_right_workspaces tables)
  • Register in migration list

Step 2: Server -- Add Group Models and Queries

  • Group, GroupMember, GroupRight structs
  • Full CRUD queries, member queries, rights queries, recursive member resolution

Step 3: Server -- Add Group RPC Handlers and Wire into Dispatch

  • 12 new RPC methods (group.* and system.ping)
  • Add group_count to health response

Step 4: Server -- Update OpenRPC Specification

  • Add all group.* and system.ping method definitions

Step 5: UI -- Download and Embed Static Assets

  • Bootstrap 5.3.3, Bootstrap Icons, Unpoly
  • Copy connection-status.js from hero_collab_ui
  • Create download-assets.sh script

Step 6: UI -- Rewrite Rust Backend

  • main.rs with clap args and axum::serve
  • routes.rs with newline-delimited JSON RPC proxy
  • /health, /.well-known/heroservice.json endpoints

Step 7: UI -- Rewrite Templates (base.html + index.html)

  • Full SPA with all tabs, modals, context menus
  • Connection status widget, theme toggle, stats sidebar

Step 8: UI -- Rewrite CSS (dashboard.css)

  • Full dashboard layout matching hero_collab_ui patterns

Step 9: UI -- Rewrite JavaScript (dashboard.js)

  • RPC client, all tab logic, CRUD, groups, rights, context menus, auto-refresh

Step 10: Integration Testing and Verification

  • cargo build, all RPC methods, UI rendering

Acceptance Criteria

  • Server has migration 003 for groups tables
  • Server has 12 new RPC methods registered
  • openrpc.json includes all new method definitions
  • UI uses locally-embedded static assets (no CDN)
  • UI has connection status widget
  • UI has tabs: Dashboard, Workspaces, Boards, Users, Groups, API Docs
  • Groups tab supports full CRUD, member management, and security rights
  • Right-click context menus work on all entity rows
  • Dark/light theme toggle works
  • Auto-refresh on 10-second intervals
  • cargo build succeeds for all crates
## Implementation Spec for Issue #1: Make Admin UI ### Objective Rebuild the `hero_whiteboard_ui` admin dashboard following the proven patterns from `hero_collab_ui`, replacing the current placeholder implementation with a full-featured, single-page admin interface. Add Groups with role-based security rights, workspace-scoped permissions, right-click context menus for all entities, and a connection status widget. The server must also gain group/rights RPC endpoints and a new database migration. ### Requirements - Rewrite the admin UI as a single-file SPA (all HTML in `index.html` extending `base.html`), matching the `hero_collab_ui` architecture - Replace CDN links with locally-embedded static assets (Bootstrap 5.3.3, Bootstrap Icons, Unpoly) via `rust-embed` - Add **Groups** tab with: create/edit/delete groups, group-to-workspace scoping, group membership (users and nested groups), resolved member view - Add **Security Rights** on groups: admin, workspace_manage, board_manage, workspace_admin, group_manage -- with workspace scoping for applicable rights - Add **Dashboard** tab with health stats and recent activity - Right-click context menus for management actions (edit, delete) on all entity rows - Connection status widget (green/yellow/red dot in navbar) with clickable popover - Dark/light theme toggle with localStorage persistence - Tab bar with badge counts (Dashboard, Workspaces, Boards, Users, Groups, API Docs) - Stats sidebar with widget counts - Toast notifications for success/error feedback - Modals for create/edit operations - Hash-based tab routing - Auto-refresh on 10-second intervals - Server: add `groups`, `group_members`, `group_rights` tables via migration 003 - Server: add group.create/get/list/update/delete, group.member.add/remove/list, group.members.resolve, group.rights.get/set, system.ping RPC methods - Update openrpc.json with all new methods - UI main.rs should use `clap` for CLI args and `axum::serve` - Add `/health` and `/.well-known/heroservice.json` endpoints ### Implementation Plan (10 Steps) #### Step 1: Server -- Add Groups Database Migration - Create `003_groups.sql` (groups, group_workspaces, group_members, group_rights, group_right_workspaces tables) - Register in migration list #### Step 2: Server -- Add Group Models and Queries - Group, GroupMember, GroupRight structs - Full CRUD queries, member queries, rights queries, recursive member resolution #### Step 3: Server -- Add Group RPC Handlers and Wire into Dispatch - 12 new RPC methods (group.* and system.ping) - Add group_count to health response #### Step 4: Server -- Update OpenRPC Specification - Add all group.* and system.ping method definitions #### Step 5: UI -- Download and Embed Static Assets - Bootstrap 5.3.3, Bootstrap Icons, Unpoly - Copy connection-status.js from hero_collab_ui - Create download-assets.sh script #### Step 6: UI -- Rewrite Rust Backend - main.rs with clap args and axum::serve - routes.rs with newline-delimited JSON RPC proxy - /health, /.well-known/heroservice.json endpoints #### Step 7: UI -- Rewrite Templates (base.html + index.html) - Full SPA with all tabs, modals, context menus - Connection status widget, theme toggle, stats sidebar #### Step 8: UI -- Rewrite CSS (dashboard.css) - Full dashboard layout matching hero_collab_ui patterns #### Step 9: UI -- Rewrite JavaScript (dashboard.js) - RPC client, all tab logic, CRUD, groups, rights, context menus, auto-refresh #### Step 10: Integration Testing and Verification - cargo build, all RPC methods, UI rendering ### Acceptance Criteria - [ ] Server has migration 003 for groups tables - [ ] Server has 12 new RPC methods registered - [ ] openrpc.json includes all new method definitions - [ ] UI uses locally-embedded static assets (no CDN) - [ ] UI has connection status widget - [ ] UI has tabs: Dashboard, Workspaces, Boards, Users, Groups, API Docs - [ ] Groups tab supports full CRUD, member management, and security rights - [ ] Right-click context menus work on all entity rows - [ ] Dark/light theme toggle works - [ ] Auto-refresh on 10-second intervals - [ ] cargo build succeeds for all crates
Author
Owner

Test Results

  • Build: Passed (all crates compile successfully)
  • Tests: All passed (0 failures across 11 test targets)
  • Warnings: 9 warnings (pre-existing unused struct warnings, not related to this change)

Details

  • cargo build — compiled all workspace crates without errors
  • cargo test — 0 failed, 0 errors across all crate test suites
  • Warnings are all pre-existing (unused model structs, unused import in SDK)
## Test Results - **Build**: ✅ Passed (all crates compile successfully) - **Tests**: ✅ All passed (0 failures across 11 test targets) - **Warnings**: 9 warnings (pre-existing unused struct warnings, not related to this change) ### Details - `cargo build` — compiled all workspace crates without errors - `cargo test` — 0 failed, 0 errors across all crate test suites - Warnings are all pre-existing (unused model structs, unused import in SDK)
Author
Owner

Implementation Summary

Server Changes (hero_whiteboard_server)

New files:

  • src/migrations/003_groups.sql — Migration adding 5 tables: groups, group_workspaces, group_members, group_rights, group_right_workspaces
  • src/handlers/group.rs — 11 RPC handler functions for group CRUD, member management, and security rights

Modified files:

  • src/db/mod.rs — Registered migration 003
  • src/db/models.rs — Added Group, GroupMember, GroupRight structs
  • src/db/queries.rs — Added 11 query functions (group CRUD, members with recursive resolution, rights with workspace scoping)
  • src/handlers/mod.rs — Added pub mod group, group_count in health response
  • src/rpc.rs — Wired 11 group.* methods + system.ping into dispatch
  • openrpc.json — Added 12 new method definitions + 3 new schemas

Admin UI Changes (hero_whiteboard_ui)

New files:

  • scripts/download-assets.sh — Downloads vendor assets (Bootstrap 5.3.3, Bootstrap Icons, Unpoly)
  • static/js/connection-status.js — Reusable connection status poller (from hero_collab_ui)
  • static/css/bootstrap.min.css, static/js/bootstrap.bundle.min.js — Bootstrap 5.3.3
  • static/css/bootstrap-icons.min.css, static/css/fonts/ — Bootstrap Icons 1.13.1
  • static/js/unpoly.min.js, static/css/unpoly.min.css — Unpoly 3.12.1

Rewritten files:

  • Cargo.toml — Added clap, removed unused deps
  • src/main.rs — Clap CLI args, AppState, Unix socket binding via axum::serve
  • src/routes.rs — Newline-delimited JSON RPC proxy, /health, /.well-known/heroservice.json
  • src/assets.rs — Simplified rust-embed static assets
  • templates/base.html — Full SPA layout: navbar with connection status, tabs, stats sidebar, theme toggle
  • templates/index.html — All tab panes (Dashboard, Workspaces, Boards, Users, Groups, API Docs), modals, context menu
  • static/css/dashboard.css — Complete CSS matching hero_collab_ui patterns
  • static/js/dashboard.js — Complete client-side app: RPC, tabs, CRUD, groups with members/rights, context menus, auto-refresh

Deleted:

  • templates/partials/ — All partial templates (replaced by single-file SPA)

Test Results

  • Build passes (all crates)
  • All tests pass (0 failures)
## Implementation Summary ### Server Changes (`hero_whiteboard_server`) **New files:** - `src/migrations/003_groups.sql` — Migration adding 5 tables: `groups`, `group_workspaces`, `group_members`, `group_rights`, `group_right_workspaces` - `src/handlers/group.rs` — 11 RPC handler functions for group CRUD, member management, and security rights **Modified files:** - `src/db/mod.rs` — Registered migration 003 - `src/db/models.rs` — Added `Group`, `GroupMember`, `GroupRight` structs - `src/db/queries.rs` — Added 11 query functions (group CRUD, members with recursive resolution, rights with workspace scoping) - `src/handlers/mod.rs` — Added `pub mod group`, `group_count` in health response - `src/rpc.rs` — Wired 11 `group.*` methods + `system.ping` into dispatch - `openrpc.json` — Added 12 new method definitions + 3 new schemas ### Admin UI Changes (`hero_whiteboard_ui`) **New files:** - `scripts/download-assets.sh` — Downloads vendor assets (Bootstrap 5.3.3, Bootstrap Icons, Unpoly) - `static/js/connection-status.js` — Reusable connection status poller (from hero_collab_ui) - `static/css/bootstrap.min.css`, `static/js/bootstrap.bundle.min.js` — Bootstrap 5.3.3 - `static/css/bootstrap-icons.min.css`, `static/css/fonts/` — Bootstrap Icons 1.13.1 - `static/js/unpoly.min.js`, `static/css/unpoly.min.css` — Unpoly 3.12.1 **Rewritten files:** - `Cargo.toml` — Added clap, removed unused deps - `src/main.rs` — Clap CLI args, AppState, Unix socket binding via axum::serve - `src/routes.rs` — Newline-delimited JSON RPC proxy, /health, /.well-known/heroservice.json - `src/assets.rs` — Simplified rust-embed static assets - `templates/base.html` — Full SPA layout: navbar with connection status, tabs, stats sidebar, theme toggle - `templates/index.html` — All tab panes (Dashboard, Workspaces, Boards, Users, Groups, API Docs), modals, context menu - `static/css/dashboard.css` — Complete CSS matching hero_collab_ui patterns - `static/js/dashboard.js` — Complete client-side app: RPC, tabs, CRUD, groups with members/rights, context menus, auto-refresh **Deleted:** - `templates/partials/` — All partial templates (replaced by single-file SPA) ### Test Results - ✅ Build passes (all crates) - ✅ All tests pass (0 failures)
Author
Owner

Implementation committed: 6b99870

Browse: 6b99870

Implementation committed: `6b99870` Browse: https://forge.ourworld.tf/lhumina_code/hero_whiteboard/commit/6b99870
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_whiteboard#1
No description provided.