feat(accounts): personal-by-default console with admin Manager Lens (Story 2.2)#1408
Closed
srtab wants to merge 6 commits into
Conversation
…Story 2.2) Relocate the org Code Velocity / DAIV-attribution content off the default dashboard into a dedicated admin-gated Manager Lens at /dashboard/manager/, reached via a non-persistent, admin-only top-bar toggle. - Extract get_velocity_data() to module level; both views share one MergeMetric query - Remove velocity/total_users from the personal default (no org content for anyone) - ManagerLensView(AdminRequiredMixin, TemplateView) with partial-on-HTMX (403 for non-admins) - Segmented Personal|Manager Lens toggle in the console topbar_start slot, stateless two-route swap - Cold-load .skeleton for not-yet-computed org metrics (never a misleading zero) - i18n: externalize all new strings, add pt catalog entries - Tests cover AC1-6, HTMX fragment, non-persistence, and i18n
…ry 2.2 review) Review found the Lens inherited the personal console's "today" default, so it showed the cold-load skeleton on any day without a merge-today despite abundant history, with no range control to widen it — defeating its purpose out of the box. - Manager Lens now defaults to the cumulative "all" window (org velocity is cumulative); the cold-load skeleton fires only for a genuinely-empty org - Drop dead periods/current_period context from ManagerLensView (no range UI yet) - Strengthen the AC4 non-persistence test to reject any app-level session key - Add a regression test proving the default Lens shows historical (non-today) velocity
Multi-line {# #} comments leak into rendered HTML; {% comment %} blocks don't.
Owner
Author
|
Superseded by #1412, which consolidates Stories 2.1–2.4 (the full Personal Review Console epic) into a single branch ( |
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.
Stacked on #1407 (Story 2.1). Review the 2-commit diff against
feat/2-1-console-shell-and-dark-visual-foundation; merge #1407 first — GitHub will retarget this PR tomainautomatically once the base branch is gone.What & why
The post-2.1 console had no personal/admin split:
DashboardViewstill computed the orgvelocity/total_users(admin-gated) with nothing rendering them, admins had no surface to see org impact, and there was no route-level protection. This delivers the role split (Epic 2, Story 2.2):/dashboard/for everyone (admin and member); the default carries zero org/aggregate content.ManagerLensViewat/dashboard/manager/renders the relocated velocity/attribution (reusing the extracted module-levelget_velocity_dataoverMergeMetric, no duplicated query), with a server-side 403 for non-admins viaAdminRequiredMixin, and the partial-on-HTMX idiom.Personal | Manager Lenssegmented control in the console top bar (topbar_start), HTMX-swapping#console-mainwith a plain-link fallback; stateless (two routes, nothing persisted), so a fresh landing is always personal..skeletonfor a genuinely-empty org, never a0that reads as "DAIV did nothing".pt) for all new strings; a11y (teal focus ring,aria-current/live announcement, ≥44px touch targets).Acceptance criteria
AC1 personal-by-default · AC2 toggle present (admin) / absent (member) · AC3 relocated Lens content · AC4 non-persistent · AC5 cold-load skeleton · AC6 server-side 403 — all covered by tests.
Testing
make test(full unit suite) → 3916 passed.make lint-fixclean (ruff / ruff-format / djade);make lint-typingadds zero new diagnostics (pre-existing baseline only).tests/unit_tests/accounts/test_dashboard_console.py: AC1–AC6 + HTMX fragment + non-persistence + i18n + a regression test for the Lens default window.Review note
The Manager Lens defaults to the cumulative (all-time) window because org velocity is cumulative — a personal-console-style "today" default would show the cold-load skeleton on any merge-less day. This means one full-table
MergeMetricaggregate per load; admin-only and low-traffic, but flagged for a perf sanity-check on very large orgs.Deferred / follow-ups
is_htmxignoresHX-History-Restore-Request, so an HTMX history-restore cache-miss can return a chrome-less fragment on anyhx-push-urlpartial-on-HTMX view (pre-existing pattern —DashboardView/SessionListViewtoo). Best fixed once in the shared idiom.