[bug] Milestone list: not scoped to project; missing overdue/today visual indicators #33
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#33
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: milestones are disconnected from projects — you cannot link a project to a sprint/milestone from the milestone list, and there are no visual indicators for overdue or due-today milestones.
Current state
milestones_listhandler (handlers/mod.rs:4957) loads all milestones for the space with no project filter. The milestone list template renders a flat list with no date-based highlighting.Milestone.project_sidis a required field (notOption) so every milestone already belongs to a project — it's just not used for filtering.Fix
1. Project-scoped milestone list
?project=<sid>query param to the milestone list handlerproject_sidwhen param is present/c/:context/milestones?project=<sid>2. Overdue / due-today indicators
milestone.due_dateagainst today's datedangerfor overdue,warningfor due todayNotes
get_milestones_for_projectso that view is correct — only the standalone milestone list needs the filterImplementation Spec: Issue #33 — Milestone List: Project Scoping + Overdue/Today Visual Indicators
Objective
Fix the standalone milestone list page (
/c/:context/milestones) so that:?project=<sid>query param.dangerbadge for overdue,warningfor due-today) on each milestone row based ondue_datevs. today's date.Requirements
MilestonesListQuerystruct with an optionalproject: Option<String>field, mirroringKanbanQuery.milestones_listhandler signature to acceptQuery(params): Query<MilestonesListQuery>.params.projectisSome(sid)and non-empty, filter the full milestone list to only those wherem.project_sid == sid.selected_project: String(empty string when no filter) intoMilestonesListTemplate.MilestonesListTemplate, add a project filter dropdown rendered as a<form method="GET">(server-side redirect, not JS-only), with an "All Projects" default option plus one<option>per project, pre-selected when it matchesselected_project.m.due_dateagainst today's date (ISO 8601 string, lexicographic comparison is valid). Apply a Bootstrapbg-dangerbadge for overdue milestones andbg-warningbadge for due-today milestones. Skip the indicator whendue_dateisNoneor when the milestonestatusisCompletedorMissed.ProjectDetailTemplate, update the milestones section heading to include a link to/c/{context}/milestones?project={project_sid}.Files to Modify
crates/hero_biz_ui/src/web/handlers/mod.rsMilestonesListQuerystruct; updatemilestones_listhandler to accept query param and filter milestones; passselected_projectto templatecrates/hero_biz_ui/src/web/templates/mod.rsselected_project: Stringfield toMilestonesListTemplate; add project dropdown filter form; add due-date indicator logic to row rendering; updateProjectDetailTemplatemilestones section linkImplementation Plan
Step 1: Add
MilestonesListQuerystruct and updatemilestones_listhandlerFile:
crates/hero_biz_ui/src/web/handlers/mod.rsMilestonesListQuery { project: Option<String> }struct afterKanbanQuerymilestones_listto acceptQuery(params): Query<MilestonesListQuery>as fourth parameterselected_project = params.project.unwrap_or_default()milestonesbyproject_sidwhenselected_projectis non-emptyselected_projectto the templateStep 2: Update
MilestonesListTemplatestruct and render methodFile:
crates/hero_biz_ui/src/web/templates/mod.rsselected_project: Stringfield toMilestonesListTemplaterender(): computetodayviachrono::Utc::now().format("%Y-%m-%d")due_indicatorper milestone:bg-dangerbadge if overdue,bg-warningbadge if due today, empty string otherwise — skip for Completed/Missed milestonesdue_indicatorto the due date cellproject_optionsHTML string fromself.projects<form method="GET">with dropdown above the tableproject_optionsandselected_projectto theformat!named argsStep 3: Update
ProjectDetailTemplatemilestones linkFile:
crates/hero_biz_ui/src/web/templates/mod.rs/c/{context}/milestones?project={project_sid}Acceptance Criteria
GET /c/:context/milestonesreturns all milestones (no regression)GET /c/:context/milestones?project=<sid>returns only milestones for that projectOverduebadge; due-today milestones show a yellowTodaybadgeNotes
YYYY-MM-DDstrings compare correctly with</==/>as plain stringsproject_sidis a non-optionalStringonMilestonechronois already used in the codebase for date formattingBuild & Test Results
Build: PASS
Tests: 1 passed, 0 failed
Details:
hero_biz_ui: 1 test passed (parser::tests::test_name_fix)hero_biz_app,hero_biz_sdk, and binary targets: no tests definedBuild completed in 29.56s, test run completed in 42.45s (dev profile).
Implementation Complete
Changes Made
crates/hero_biz_ui/src/web/handlers/mod.rsMilestonesListQuery { project: Option<String> }struct (afterKanbanQuery)milestones_listhandler to acceptQuery(params): Query<MilestonesListQuery>as a fourth parameter?project=<sid>is present, milestones are filtered in-memory byproject_sid; unfiltered when absentselected_projectis passed toMilestonesListTemplatecrates/hero_biz_ui/src/web/templates/mod.rsselected_project: Stringfield toMilestonesListTemplaterender()computes today's date once viachrono::Utc::now().format("%Y-%m-%d")due_indicator:bg-dangerbadge for overdue,bg-warningfor due today; empty for Completed/Missed milestones or those with no due datedue_indicator<form method="GET">dropdown added above the milestone table, with auto-submit on change and a Clear linkProjectDetailTemplatemilestones section updated with a "View All" link to/c/{context}/milestones?project={project_sid}Test Results
Build: PASS (29.56s, only
hero_biz_uirecompiled)Tests: 1 passed, 0 failed
Acceptance Criteria Status
GET /c/:context/milestonesreturns all milestones (no regression)GET /c/:context/milestones?project=<sid>returns only milestones for that projectFixed in commit
4873d01on branch development_casper.