[bug] Project detail: linked stories not loaded or displayed #32
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_biz#32
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?
Context
Identified in home#211: project detail view cannot display linked stories.
Current state
projects_detailhandler (handlers/mod.rs:4778) loads milestones and tasks for the project but does not callget_stories_for_project(or equivalent).ProjectDetailTemplatehas nostoriesfield. Stories withstory_sid == project.sidare never fetched.Fix
get_stories_for_project(context, project_id)toservices/mod.rs(filteringload_all_stories_for_spacebystory.project_sid)projects_detailhandler and passstories: Vec<Story>toProjectDetailTemplateDependency
Full story detail links require story routes to be added first. The stories list panel in project detail can be added independently.
Implementation Spec for Issue #32
Objective
Display all stories linked to a project on the project detail page. Stories are already modelled, stored, and queryable — the project detail handler simply never fetches them and the template has no field or rendering block for them.
Requirements
get_stories_for_projectalready exists inservices/mod.rsand is correct. No new service function is needed.projects_detailhandler must callget_stories_for_projectand pass the result to the template.ProjectDetailTemplatemust gain astories: Vec<Story>field.render()method ofProjectDetailTemplatemust produce a Stories section in the HTML, following the same visual pattern as the existing Milestones and Tasks sections./c/:context/stories/:id), so story links are safe to emit now.Files to Modify
crates/hero_biz_ui/src/web/templates/mod.rs— Addstoriesfield toProjectDetailTemplate; add Stories section inrender()crates/hero_biz_ui/src/web/handlers/mod.rs— Callget_stories_for_projectinprojects_detailhandler and passstoriesto templateImplementation Plan
Step 1 — Add
stories: Vec<Story>field toProjectDetailTemplateFile:
crates/hero_biz_ui/src/web/templates/mod.rsAdd
stories: Vec<Story>aftertasksand beforecommentsin the struct definition.Step 2 — Add Stories rendering block in
ProjectDetailTemplate::render()File:
crates/hero_biz_ui/src/web/templates/mod.rsIn the
render()method:stories_rowsstring (iterateself.stories, format each as a table row with name (linked), status, story points)<div class="subgrid">section in the HTML output, after Tasks and before comments, showing a table of storiesStep 3 — Fetch stories in the
projects_detailhandlerFile:
crates/hero_biz_ui/src/web/handlers/mod.rsstate.store.get_stories_for_project(&context, &id).await.unwrap_or_default()after fetching tasksstoriesto theProjectDetailTemplate { ... }initialiserAcceptance Criteria
cargo buildcompletes without errors/c/<context>/stories/<story_sid>story_points: Nonedisplay "-" in the Points columnNotes
get_stories_for_projectatservices/mod.rsis already implemented and correctStoryis re-exported viacrate::models::*— no newusestatements neededStoryStatusimplementsDisplayproducing lowercase stringsBuild Results
Implementation Summary
Fixed the missing stories section on the project detail page. Stories are linked to projects via
project_sidand are independent of tasks.Changes
crates/hero_biz_ui/src/web/handlers/mod.rsget_stories_for_projectcall inprojects_detailhandler (after tasks fetch)storiesfield toProjectDetailTemplateinitialisercrates/hero_biz_ui/src/web/templates/mod.rspub stories: Vec<Story>field toProjectDetailTemplatestructstories_rowsbuilder inrender()— iterates stories, produces linked table rows with name, status, and story points (falls back to "-" if None)<div class="subgrid">) in the HTML output, positioned after Tasks and before commentsBuild
cargo buildpassed, no errors or warningsFixed in
feb9680.