feat(accounts): Epic 3 — personal throughput Hero#1413
Open
srtab wants to merge 6 commits into
Open
Conversation
…y 3.1) - Replace the console-hero skeleton with a live, personal, server-rendered Hero: this-range headline + vs-last delta, range-invariant all-time odometer, copyable Slack one-liner, and a demoted (hidden-in-v1) estimate slot. - Count = merged DAIV MRs for the user via MergeMetric ⋈ Run (session__user), a read-only Exists-join; refactor get_velocity_data to take an optional queryset so the personal Hero and org Manager Lens share one counting body. - Wire the disabled range switcher (today/7d/30d/90d/all) to scope #console-main via hx-get + href fallback + Alpine active pill; flip DEFAULT_PERIOD today -> 7d. - Externalise all new strings (en + pt); a11y aria-live headline, CSS-only odometer. - Extend test_dashboard_console.py with the I/O matrix + ACs.
…y 3.1) Review found the vs-last delta compared an inclusive [cutoff, today] current window (window_days + 1 days) against a window_days-long previous window, biasing the delta positive on a flat cadence (one merge/day showed a spurious +1 on the default 7d view). Make the previous window span the same number of days; add a regression test asserting delta == 0 for a uniform one-merge-per-day cadence.
…e (Story 3.2) Make the Throughput Hero's this-range headline and all-time odometer each click through to a breakdown of the exact merged DAIV MRs the count summed, plus a plain-prose "how computed" (AD-10) disclosure — so the number is auditable in place (FR-19, NFR1). Breakdown rows are annotated onto the SAME _shipped_metrics_for(user) queryset the count aggregates, with the identical range window, so the revealed list can never diverge from the number. Delivered as a generic, hero-agnostic _clickthrough.html partial that Epic 4's Needs-me Queue count will reuse. Presentation-only: no live reads, no new model/migration/URL/cache/JS. Also close the AC12 gap where an expired LangGraph checkpoint dead-ended the Feed drill-through: session_detail's expired block now links each successful run's durable prose report (Run.response_text) via the existing session_run_download_md route. Strings externalised (en + pt); inline Alpine disclosure with aria-expanded/ aria-controls, Esc + click-outside, teal focus ring and >=44px targets.
…ctionable predicate (Story 3.3) Reconcile the Review Console against live GitLab/GitHub MR state at render time (AD-6), presentation-only: - codebase: new MergeRequestState + RepoClient.get_merge_request_state (GitLab/GitHub/SWE); a short-TTL cached read-through (codebase/mr_state.py) with a batch entry point and eager webhook invalidation on merge. - sessions: new read-only still_actionable predicate (sessions/reconcile.py) composing envelope actionability with the live MR read; fail-safe — an item leaves only on a confirmed merged/closed read. - accounts: the attention badge and Feed route liveness through the shared predicate so they can never diverge; adds an i18n 'last checked' freshness stamp. No new model/migration/URL and no writes on the render path. Refs: Story 3.3 (Epic 3 — Throughput Hero & Trust Baseline).
Django's {# … #} comment is single-line only — the lexer's tag_re has
no DOTALL flag, so a {# … #} spanning a newline is not recognised as a
comment: the text renders literally and any {{ … }} / {% … %} inside it
gets evaluated. Convert the multi-line {# … #} blocks in the
review-console templates to {% comment %} … {% endcomment %}, and record
the convention in AGENTS.md.
Standalone adversarial code-review fixes for the Epic 3 console stories: - gitlab: map a transient `locked` MR to OPEN instead of CLOSED, so an item leaves the console only on a confirmed merged/closed read and is never dropped mid-merge (Story 3.3, AC6). - accounts: gate the "last checked" reconcile stamp on an actual live MR-state read and move it into the attention branch, so it never over-claims a source-of-truth check that did not happen nor duplicates the zero-state "last checked" label (Story 3.3, NFR1). - sessions: add the missing pt-PT translations for the report-download controls (Story 3.2, AC4/AC9). Tests updated/added accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on
feat/epic-2-review-console— review/merge that PR first; the diff here is scoped to the Epic 3 delta on top of it.Epic 3 adds the personal throughput Hero to the review console, with range scoping, click-through breakdowns, and live-state reconciliation.
What's in this branch
{# … #}comments to{% comment %}…{% endcomment %}blocks. Django's{# … #}is single-line only, so the multi-line ones were rendering literally (and evaluating any tags inside them); the convention is now recorded inAGENTS.md.Notes
Base is
feat/epic-2-review-console, not the default branch — please review only the delta.