Add whiteboard's admin dashboard #4

Merged
AhmedHanafy725 merged 22 commits from development_hanafy into development 2026-06-22 10:37:19 +00:00
No description provided.
Add a hero_whiteboard admin to the service-parameterized SPA (issue #309,
Step 2). New crate::whiteboard module with a generic CrudTable (list /
search / create / edit / delete via a modal) for Workspaces, Boards, Users
and Groups over the migrated per-domain wire (/<proxy>/rpc/api/<domain>/rpc;
board + users domains), plus a GroupDetail modal for group members and
rights. Registered the <Whiteboard view=.../> markup tag, exported the
module, and switched tabs_for("hero_whiteboard") from read-only <Table>
markup to the compiled views.

Board import (JSON-file -> bulk object creation) is still TODO.
The board create form's workspace_id was a free-text number, hard to recall.
Add an options source to the form-field model and render a <select> populated
live from a list method; the board editor's Workspace field now sources from
workspace_list (labelled "name (#id)"), matching the old admin UI.
No more typing hex codes or remembering ids:
- User Color is a colour swatch picker (input type=color) showing the hex.
- Email / Avatar URL use email / url inputs; descriptions are textareas.
- Group members are picked from a dropdown of real users or groups (by type),
  not a numeric id; a group can't be added to itself.
- Group rights pick the right from a dropdown (viewer/editor/admin) and choose
  workspaces via checkboxes, instead of comma-separated ids.

Generalised the form-field model with a Widget enum (Text/Textarea/Email/Url/
Color/Select) so any field can opt into the right control.
The Logs pane builds its source dropdown by substring match but queries the
'all' option by prefix of the scope token. The tab passed the service name
(hero_whiteboard), but whiteboard's logs are recorded under whiteboard.server
/ whiteboard.admin (root 'whiteboard'), so 'all' -> hero_whiteboard* matched
nothing while individually-picked sources worked. Point the Logs tab at the
real log root 'whiteboard'.
Match the old admin's Boards columns: Name, Workspace, Description, Created,
Updated. Drop the Template column (is_template is not a user-facing feature)
and render workspace_id as the workspace name. Add a lookup column type that
resolves a foreign id to a label from another list (workspace_list here),
fetched once per table.
Landing tab matching the old admin: per-entity counts (workspaces, boards,
objects, users, groups, connectors, comments) as stat cards, plus status,
version, uptime and DB size. Sourced from the system domain's health method.
The shell's bottom Logs pane scope comes from log_source_for(service), which
returned the service name (hero_whiteboard) — the same unmatched prefix that
broke the Logs tab. Map hero_whiteboard -> whiteboard so the bottom pane's
'all' shows logs too.
Drop the Connectors and Comments stat cards (niche per-canvas counts). The
Overview now shows Workspaces, Boards, Objects, Users, Groups.
The version was an absolutely-positioned badge at top:8px/left:8px in the
ServiceMenu island, overlapping the avatar + service name (which start at
pt-3). Render it as a small muted line under the title instead. Affects every
service's sidebar.
Match the old admin: Workspaces, Users and Groups no longer show the numeric
id column (Boards already didn't). Edit/Delete still read the id from the row,
so actions are unaffected.
Bring the whiteboard tables up to the proc tables' look:
- Click any column header to sort (numeric-aware; lookup columns sort by the
  resolved label), with a ▲/▼ indicator.
- Sticky header row so columns stay visible while scrolling.
- Semantic cell styling via a CellKind: Primary (bold name), Muted (secondary
  for descriptions/timestamps/counts), Color (swatch + hex), Text.
The table sat flush against the left edge while the toolbar was indented; add
px-3 (and pb-2) to the table scroll area so columns align with the toolbar and
get breathing room on both sides.
# Conflicts:
#	crates/hero_components_app/src/admin/components/mod.rs
Make the whiteboard panes visually consistent with the rest of the admin after
the development merge: use Button (+Icon), Input, Select, Textarea, Table,
Badge, Alert and Card from dioxus_bootstrap_css instead of raw Bootstrap HTML.
Color picker and checkboxes stay raw (no component for those). Also switch the
<Whiteboard> unknown-view fallback in markup.rs to the Alert component.

cargo check (wasm) clean; lab build release green; admin shell + data path
verified.
AhmedHanafy725 changed title from development_hanafy to Add whiteboard's admin dashboard 2026-06-22 08:15:23 +00:00
The Status, Uptime, Version and DB size were a tiny inline line; surface them
as prominent stat cards (a row above the entity counts), like the old admin.
StatCard now takes a string value + optional accent class (Status shows green
when ok).
Cards looked identical and flat. Give each metric a tinted circular icon chip
(icon + 12% background in a per-metric accent colour) beside a large value and
an uppercase label. Status is green/red by health; counts and system stats each
get a distinct accent.
# Conflicts:
#	crates/hero_components_app/src/main.rs
The Overview pane put its cards directly in the Island (Compact) with no
scroll container, so once content exceeded the viewport it was clipped (the
shell is overflow:hidden). Wrap the body in a flex-grow overflow-auto
container, matching the CRUD tabs.
For a multi-domain service, render_tab wrapped the built-in tab in a
d-flex/flex-column container that lacked flex-grow-1, so it didn't fill the
island height and the inner flex-grow had no room — content overflowed the
overflow:hidden shell with no scroll viewport. Add flex-grow-1 to that wrapper,
and give the Docs/MCP content panes flex-grow-1 + min-height:0 so they also
scroll for single-domain services.
The Compact Island wraps content in a Bootstrap card whose card-body has
flex-grow-1 but min-height:auto, so it couldn't shrink and content overflowed
the overflow:hidden card with no scroll viewport (only fixed-height panes like
the bottom logs scrolled). Add a .hero-island>.card-body{min-height:0} rule so
every island's body can shrink and its inner overflow-auto scrolls (Docs/MCP,
CRUD tables, etc.).
The Docs/MCP scroll container also carried max-width, so the scrollbar landed
at ~920/820px (mid-page). Split it: a full-width overflow-auto container holds
an inner max-width content wrapper, so the scrollbar sits at the content area's
right edge while the text stays a readable width.
The per-service diagnostic report and the fleet router-overview had the same
issue as Docs/MCP: the scroll container carried max-width and lacked
flex-grow-1/min-height:0. Split into a full-width overflow-auto container with
an inner max-width content wrapper so they fill the area and the scrollbar sits
at the right edge.
AhmedHanafy725 merged commit 3137d98a3e into development 2026-06-22 10:37:19 +00:00
AhmedHanafy725 deleted branch development_hanafy 2026-06-22 10:37:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
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_components!4
No description provided.