implement fancy viewer #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hero Planner — Planning Map Functional Specifications
Purpose
The Planning Map is a new visual navigation experience for Hero Planner.
The existing tabular UI remains the primary interface for managing records through classic tabs, tables, and forms.
The Planning Map adds a graphical, interactive way to understand how all planning elements relate to each other. It allows users to explore a plan from strategy to execution, budget, revenue, resources, and risk.
The goal is not to replace the existing UI.
The goal is to add a dynamic visual layer on top of the existing data model.
Core Principle
Existing UI
The existing UI must remain unchanged as the main operational interface.
It includes classic tabs and table layouts for:
Users can continue to create, edit, update, and delete records through the current forms and tables.
New Planning Map Experience
A new visual experience must be added.
This can be implemented as:
Recommended label:
Optional action label:
The Planning Map should provide a large visual workspace where users can navigate all relationships between planning entities.
Main User Goal
The Planning Map should help a user answer questions such as:
Visual Model
Each planning entity is represented as a visual card, node, or marker.
Relationships between entities are shown as visible lines.
The Planning Map should support open and close behaviour so the user can expand or collapse parts of the plan.
The map should never show the entire database by default. It should always start from a selected focus item and expand outward.
Focus-Based Navigation
The user starts by selecting a focus entity.
Supported focus entities:
After selecting the focus entity, the Planning Map shows that item and its directly related items.
The user can then expand or collapse related branches.
Entry Points
From the Main UI
The existing application should include a new entry point:
This opens the general visual map experience.
From Any Table Row
Every relevant table row should include an action:
When clicked, the Planning Map opens focused on that specific entity.
Example:
This opens the map around the selected story and shows related conditions, deliverables, milestones, resources, costs, and comments.
From Entity Detail Forms
Entity detail forms should also include:
This makes the visual navigation experience available from anywhere in the existing UI.
Core Interaction Requirements
Open and Close
Every visual item should be expandable and collapsible.
When closed, an item displays a summary.
Example:
When opened, it reveals linked entities.
Example:
The user should be able to open one branch without opening the full plan.
Focus on This
Every item should have a focus action:
When selected, the map recenters around that item and hides unrelated entities.
The focus view should show:
This allows the user to move through the plan step by step without losing context.
Click to Inspect
Clicking a visual item opens a side panel.
The side panel should show:
The side panel should include actions:
Search to Focus
The Planning Map should include search.
The user can search across all entity types.
Search results should show:
Selecting a search result should focus the map on that entity.
Filters
The Planning Map should allow users to filter visible entity types.
Supported filters:
Users should be able to hide or show entity types without deleting anything.
View Modes
The Planning Map should support different view modes.
Each view mode shows a different slice of the same underlying plan.
Strategy View
Purpose
To understand why the work exists and what strategic context drives it.
Primary Entities
Main Questions
Typical Flow
Execution View
Purpose
To understand what work needs to be done and what outputs must be produced.
Primary Entities
Main Questions
Typical Flow
Finance View
Purpose
To understand cost, revenue, and budget impact.
Primary Entities
Main Questions
Typical Flow
Risk View
Purpose
To understand where the plan can fail.
Primary Entities
Main Questions
Typical Flow
Resource View
Purpose
To understand people, infrastructure, capacity, and allocation.
Primary Entities
Main Questions
Typical Flow
Visual Entity Types
SWOT Item
A SWOT item should appear as a strategic card.
It should clearly show its kind:
It should show:
Necessary Condition
A necessary condition should appear as a prerequisite or blocker card.
It should show:
Requirement
A requirement should appear as a checklist-style card.
It should show:
Story
A story should appear as a work card.
It should show:
Deliverable
A deliverable should appear as an output card.
It should show:
Milestone
A milestone should appear as a date marker.
It should show:
Cost Center
A cost center should appear as a budget bucket.
It should show:
Cost
A cost should appear as an expense chip or cost card.
It should show:
Revenue Center
A revenue center should appear as an income bucket.
It should show:
Revenue
A revenue should appear as an income chip or revenue card.
It should show:
Resource
A resource should appear as a person or infrastructure card.
It should show:
Comment
Comments should not appear as large primary nodes by default.
They should appear as indicators on entity cards.
Example:
Clicking the indicator opens the comments section in the side panel.
Link
Links should appear as visible relationship lines between entities.
Where possible, the Planning Map should infer a human-readable relationship label from the connected entity types.
Examples:
Collapsed Summary Behaviour
When a node or group is collapsed, it should display summary information.
Examples:
Opportunity Summary
Condition Summary
Story Summary
Resource Summary
Status and Health Indicators
The Planning Map should visually indicate health.
Supported indicators:
These indicators should be visible on cards and usable in filters.
Metrics Panel
The Planning Map should include a compact summary panel.
It should show context-specific metrics for the currently focused map.
Suggested metrics:
The metrics should update when the user changes focus, filters, or view mode.
Breadcrumbs
The Planning Map should show a breadcrumb path when navigating.
Example:
Breadcrumbs allow the user to move back to earlier focus points.
Mini Map
For larger maps, the Planning Map should include a small overview mini map.
The mini map helps users understand where they are in the larger visual structure.
Presentation Mode
The Planning Map should support a read-only presentation mode.
Presentation mode should:
Suggested presentation sequence:
Linking Behaviour
The Planning Map must support creating and removing links between entities.
Users should be able to:
Creating or removing a link in the Planning Map must update the same underlying data used by the existing table UI.
Editing Behaviour
The Planning Map should allow editing through the side panel.
However, the Planning Map does not need to replace the full table forms.
Minimum editing requirements:
The side panel should also include:
or:
This gives access to the existing full editing interface.
Data Consistency
The Planning Map must use the same data as the existing tabs and tables.
Any change made in the Planning Map must be reflected in the classic UI.
Any change made in the classic UI must be reflected in the Planning Map.
The Planning Map must not create a separate planning model.
Empty States
No Focus Selected
Show:
Suggested starting options:
No Links Found
Show:
Suggested actions:
Too Many Items
If the map would show too many items, show a warning:
Suggested actions:
Required Actions
Each visual entity should support these actions where relevant:
Required Controls
The Planning Map should include:
Suggested Navigation Flow
Example: Deal Planning
Close $1M customer deal.Diligence package must be ready.Prepare diligence package.MVP Requirements
Planning Mapentry point.Show in Planning Map.Open in tableaction.Focus on thisaction.Advanced Requirements
Non-Goals
The Planning Map should not replace the existing table UI.
The Planning Map should not require users to manage all records visually.
The Planning Map should not show the full database by default.
The Planning Map should not become a separate data model.
The Planning Map should not force a strict hierarchy, because the underlying system allows any entity to link to any other entity.
Success Criteria
The Planning Map is successful if a user can:
Product Summary
Hero Planner should keep its existing table-based UI for structured data management.
The new Planning Map should provide a graphical, full-screen, open-and-close planning experience.
It should make the system feel alive, connected, and strategic.
The user should be able to move from:
to:
to:
to:
to:
to:
without losing the strategic context.
TECH
use Cytoscape.js
Implementation Spec for Issue #3
Objective
Add a new "Planning Map" — an interactive, focus-based visual graph of planning entities — to the existing
hero_planner_webUI, without altering the data model. Reuses the same/rpcJSON-RPC backend that drives the current table UI; adds a new top-level tab plus "Show in Planning Map" entry points from rows and detail forms. Targets the issue's MVP requirements only.Requirements (MVP, from issue)
link.listresults plus implicit refs (cost/revenueentity_type/entity_id,cost_center_id/revenue_center_id).Tech Approach
<script>tag fits the current Bootstrap-from-CDN pattern inindex.html; no build pipeline change. Built-in nodes/edges, type styling, layouts (cose/breadthfirst/concentric), pan/zoom, click handlers, and BFS/neighborhood selectors. MIT license, ~350 KB minified.maptab alongside existing tabs. Map code added inline inindex.htmlto match the existing single-file pattern. Reuses existingrpc(),ENTITIES,linkType/fromLinkType, andcachehelpers.focus(entity), call (in parallel)<type>.get,link.list,comment.list, plus targeted neighbor.getto resolve neighbor titles. Render Cytoscape with focus + 1-hop neighborhood. The map never holds the full graph in MVP — it always renders one neighborhood for performance.link.listresults between any pair of types; (b) implicit refs (cost.entity_type/entity_id,revenue.entity_type/entity_id,cost.cost_center_id,revenue.revenue_center_id) drawn as dashed edges with a different label.<li>in#main-tabs, hash routes#/mapand#/map/<type>/<id>, and a "Show in Planning Map" button on each entity row card and inside the detail-pane header.Files to Modify/Create
crates/hero_planner_web/src/index.html— add tab nav entry,<div id="map-pane">, Cytoscape<script>, the Map JS module, route handler, and "Show in Planning Map" button hooks in list/detail renderers.index.html).Implementation Plan
Step 1: Map scaffold + tab + Cytoscape load
Files:
crates/hero_planner_web/src/index.html<script>tag next to bootstrap.Planning Mapas the first item in#main-tabs.#/map,#/map/<type>,#/map/<type>/<id>.#map-rootcontaining toolbar (search, filters, breadcrumbs),#cy(cytoscape canvas), and#map-side(side panel).Dependencies: none
Step 2: Focus-fetch + render core (nodes, edges, layout)
Files:
crates/hero_planner_web/src/index.htmlmapState = { focus, history, visibleTypes, elements }.loadFocus(tab, id): parallel*.getfor focus + neighbors vialink.list; for cost/revenue follow implicit refs.elements(nodes per entity, edges withkind: 'link' | 'ref').kind=ref.cosefor >5 nodes, otherwiseconcentric(focus centered).selectNode; double-click ->focusOn(pushes history).Dependencies: Step 1
Step 3: Side panel + actions
Files:
crates/hero_planner_web/src/index.htmlselectNode(tab, id): render side panel — title, description, type, status, priority, owner, deadline, linked-entity chips (click-to-refocus), comments viacomment.list.#/<tab>/<id>), Edit basic fields (open detail), Add linked item (existing quickModal), Create link, Remove link (link.removewith confirm), Add comment (comment.add), Focus on this.loadFocus(currentFocus.tab, currentFocus.id)after every successful action.Dependencies: Step 2
Step 4: Toolbar — search, filters, breadcrumbs, indicators
Files:
crates/hero_planner_web/src/index.html*.list, grouped dropdown ->focusOn.mapState.visibleTypes; cytoscape.style('display', ...)to hide/show.mapState.history(last 6).Dependencies: Step 2
Step 5: Entry points from existing UI + deep links + docs
Files:
crates/hero_planner_web/src/index.htmlbi-diagram-3icon button on each row card ->location.hash = '#/map/<tab>/<id>'.#/map/<tab>/<id>triggersloadFocuson direct page load (refresh-safe deep links).Dependencies: Steps 2, 3
Step 6: Polish + smoke test
Files:
crates/hero_planner_web/src/index.html#/mapwith no focus.loadFocusruns.#/map, add a SWOT, link a story, verify edge, click node, verify side panel.Dependencies: Steps 1–5
Acceptance Criteria (MVP checklist mapping)
Notes
link.list/add/remove,<entity>.get/list/update,comment.add/list) are already used elsewhere inindex.html.Test Results
cargo check -p hero_planner_web: cleancargo test -p hero_planner_web: 0 tests, 0 failures (no unit tests defined in this crate)No backend/test changes were required for this MVP — it is a frontend-only addition.
Implementation Summary
Implemented the MVP of the Planning Map per the spec in this issue, then refactored the new code out of
index.htmlinto separate static assets for maintainability.Files
crates/hero_planner_web/src/index.html— modified (2196 -> 2227 lines, net +31). Contains: newPlanning Maptab as first item in#main-tabs,#map-panecontainer, Cytoscape CDN<script>,<link>to planning map CSS,<script src="/static/planning_map.js">, "Show in Planning Map" buttons on each entity row card and in detail pane headers, hash-router branches for#/mapand#/map/<type>/<id>, and a Docs page entry for the map.crates/hero_planner_web/src/planning_map.js— new (578 lines). IIFE module with all map logic: type/status/priority style constants,mapState,loadFocus,renderMapShell,renderMapTypeFilters,applyMapTypeFilter,renderMapBreadcrumbs,wireMapSearch,renderMapGraph,selectMapNode,renderMapSide, side-panel actions (mapPostComment,mapAddComment,mapEditFocus,mapCreateLink,mapAddLinked),renderMapEmpty,populateMapQuickPicks,docsMap. Exposeswindow.PlanningMapplus the side-panel onclick handlers onwindow.*for backward-compatible inline handlers.crates/hero_planner_web/src/planning_map.css— new (16 lines). Styles for#map-pane,#cy,#map-side,.map-chip,.map-breadcrumb, legend, search-results dropdown.crates/hero_planner_web/src/main.rs— modified. Addedinclude_str!constants for the JS/CSS, two axum handlers with proper Content-Type, and registered/static/planning_map.jsand/static/planning_map.cssroutes before the catch-all fallback.MVP Coverage
#/map,#/map/<type>/<id>, refresh-safe deep links).link.list(solid) and from implicit refs on cost / revenue / cost_center / revenue_center (dashed)./rpcJSON-RPC backend; no new methods, no model changes, no Rust logic changes apart from serving the static assets.Deferred (advanced list, not MVP)
Test
cargo check -p hero_planner_webpasses.cargo test -p hero_planner_webpasses (no unit tests in crate).