feat(kb): show the measured duration on the article #488
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-732-article-measured-duration"
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?
Final slice of the client-request frontend, after #485, #486 and #487. The article that documents a procedure now shows how long that procedure has actually been taking.
Adds a Measured duration card at the top of the KB article's right rail, above version history, reading
GET /kb/articles/{id}/measured-duration(mokosh-server #499).What it shows
The typical per-request figure, the sample it was drawn from, and the window it covers. Rendered through
fmt_duration, so it honours the user's stored h:mm or decimal preference like every other duration in the app.Details worth reviewing
Three states, kept distinct on purpose.
0h. Zero minutes would be a measurement ("these take no time"); the absence of one is not the same claim, and the server is careful to send null rather than zero for exactly this reason.The period is always rendered. The server defaults this endpoint to a trailing 90 days, deliberately unlike the calendar-month accounting
/reports/request-typesuses, because an estimate needs a sample. Showing the window keeps the two numbers from looking like they disagree when a reader sees both.It measures the request type, not the category. The server joins through
form_submissions, so ad-hoc tickets carrying the same article are excluded. Nothing to do here beyond not undoing it, but it is why the figure is trustworthy as an estimate.Verification
cargo check --target wasm32-unknown-unknown,cargo fmt --all --check,cargo test(261 passed, 0 failed), and both guard scripts.The two pre-existing clippy failures in
src/pages/projects.rsandsrc/pages/time.rsare unchanged and unrelated (flagged on #485, #486 and #487).Loop status
With this merged, the whole client-request loop is reachable from the UI: define a form, send a client the link, they fill it in, it becomes a ticket carrying the procedure, time is tracked against it, and the measured duration comes back to the article for the next person.
Mirrors the shape `GET /kb/articles/{id}/measured-duration` returns. Every measurement field is `Option` and they move together, matching the server: an article no request type has tracked time against reports null, not zero. Zero minutes would be a measurement ("these take no time"), and rendering that as a confident estimate is worse than the hand-written guess this is meant to replace. `from` and `to` are always present, so a rendered figure can never be ambiguous about what window it measured. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011myibMMwyb6za3GVWJGkiX