Skip to content

Round 2 (B): study-group page redesign — one verb per action, scoped download, status badge, pinned columns - #658

Open
mcfrank wants to merge 1 commit into
round2-brookes-docsfrom
round2-group-page
Open

Round 2 (B): study-group page redesign — one verb per action, scoped download, status badge, pinned columns#658
mcfrank wants to merge 1 commit into
round2-brookes-docsfrom
round2-group-page

Conversation

@mcfrank

@mcfrank mcfrank commented Aug 19, 2026

Copy link
Copy Markdown
Member

Part B of the round-2 feedback (the approved group-page proposal), stacked on #657. Design proposal with before/after mockups: https://claude.ai/code/artifact/7a4700c1-5e9d-4d52-ba64-299ee58981c6

No POST names or handlers change. Everything is templates, CSS, and small JS — with one deliberate 3-line backend tweak, called out below. Principle throughout: one verb, one place; scope follows the selection; destructive actions look destructive and ask properly.

Toolbar

  • One primary Add administrations (the split-button arrow is gone; the importer moved inside the dialog).
  • One Download menu. Nothing ticked → posts the whole-group names (download-study-csv…); rows ticked → the same items post the selected-rows names (download-selected…), and a scope header says which. Clinical reports and participant links genuinely need a selection (per-row PDFs; no whole-group links handler), so they stay visible but disabled with "select rows first".
  • Group settings replaces "Update Group".
  • Selection row: "N selected" · Re-administer · Delete. Delete opens a count-stating dialog instead of confirm().
  • Delete group moved off the page into the Group settings danger zone (see below).

Table: 15 columns → 10

  • Pinned left: checkbox · Edit (pencil + label) · Participant ID. Sticky header. Card scrolls horizontally on narrow screens with the pinned columns holding; at 1400 px the table now fits with no overflow at all.
  • Status badge replaces Scored / Completed / Completed background info / Completed survey / Is active: Not started → In progress → Survey pending → Completed → Scored, plus Expired and Inactive; tooltip carries last activity. Opt-out appears as a chip next to the badge only when set.
  • Link cell: Open (new tab) + copy button.
  • Created / Expires / Completed in the viewer's local time via data-utc.
  • Last modified, confirmed-completion, and completion-flag response move into the row's Edit administration dialog as read-only fields.

Group settings page

  • Titled "Group settings · name"; danger zone at the bottom with the GitHub-style type-the-name-to-confirm dialog, posting the existing delete-study action.
  • ⚠️ The one backend change: after delete-study, StudyCreateView.post now redirects to the dashboard instead of the deleted group's page (3 lines; test_post_delete_study updated to the new contract and also asserts the soft-delete). Worth a look, @HenryMehta.
  • Note: both deletes are soft in the backend (is_active/active=False), so the copy says "cannot be undone from your account" rather than promising erasure.

Add administrations dialog

  • Titled "Add administrations"; method tabs (Enter IDs / Generate / Upload CSV / Reusable link / External source / Import completed responses) with one short sentence each, replacing the duplicated wall of text. Field names are unchanged, so admin_new_fun's field-based dispatch is untouched. Footer button follows the tab; link tabs get copy buttons; the importer tab hands off to the (retitled, slimmed) import dialog.

Verification (all local, against this branch)

  • Selection logic: count, enablement, menu name-switching and scope header all tracked ticking 0 → 3 → 2 → 0 rows and the header select-all (20).
  • All eight download / re-administer POST variants return the right CSV / redirect through the real handlers.
  • Delete-selected soft-deletes rows; delete-group (type-to-confirm arms only on exact match) soft-deletes and lands on the dashboard.
  • Add dialog: tab/footer states correct across all tabs; a real submit through the dialog's own JS created two administrations.
  • Status badges verified for Scored / Completed / In progress / Expired and the opt-out chip; row Edit save round-trips Lab ID + opt-out.
  • Pinned columns hold at 768 px; page never scrolls sideways.
  • Full fast suite (CI command): 253 tests OK after the one test update above.

Known follow-ups

  • The Selenium test_delete_study (and the locator rot already tracked in Refresh Selenium browser-test locators for the post-facelift console #648) needs rewriting for the new flow. I kept id_add_participants, id_update_study, id_new_study, the dialog field ids, and id_modal_submit_btn stable so most of those tests survive.
  • The theme CSS is served without cache-busting, so testers may need a hard reload to see the new styles (bit me repeatedly). Consider ManifestStaticFilesStorage as a separate change.
  • checked_only() in researcher_UI.js is no longer called (superseded by the selection sync here); left in place.

🤖 Generated with Claude Code

…us badge, pinned columns

Round-2 feedback, part B (approved design). Principle: one verb, one place;
scope follows the selection; destructive actions look destructive and ask
properly. No POST names or view handlers change; the one backend tweak is
that deleting a group now lands on the dashboard instead of the deleted
group's page.

Toolbar (interface.html)
- Single primary "Add administrations"; the split-button arrow is gone.
- One "Download" menu. With nothing ticked it posts the whole-group names
  (download-study-csv etc.); with rows ticked the same items post the
  selected-rows names (download-selected etc.). A scope header says which.
  Clinical reports and participant links genuinely need a selection, so they
  stay visible but disabled with "select rows first" until rows are ticked.
- "Group settings" replaces "Update Group".
- Selection row reads "N selected" and holds Re-administer and Delete; Delete
  opens a count-stating dialog instead of a browser confirm().
- Delete group leaves the page (see study_form.html).

Table (tables.py, table.html): 15 columns -> 10
- Pinned on the left: checkbox, Edit (pencil + label), Participant ID.
- Status badge replaces Scored / Completed / Completed background info /
  Completed survey / Is active: Not started -> In progress -> Survey pending
  -> Completed -> Scored, plus Expired and Inactive; the tooltip carries last
  activity. Opt-out appears as a chip next to the badge only when set.
- Link cell: Open (new tab) + copy-to-clipboard button.
- Created / Expires / Completed rendered from ISO via data-utc in the viewer's
  local time (the old header-name-keyed conversion is gone).
- Last modified, confirmed-completion and completion-flag response move into
  the row's Edit dialog (retitled "Edit administration") as read-only fields.
- Sticky header; the card scrolls horizontally on narrow screens with the
  pinned columns holding.

Group settings (study_form.html)
- Titled "Group settings · <name>"; danger zone at the bottom with the
  GitHub-style type-the-name-to-confirm dialog, posting the existing
  delete-study action. Both deletes are soft deletes in the backend, so the
  copy says "cannot be undone from your account" rather than promising
  erasure.

Add administrations (administer_new_modal.html, import_data.html)
- Titled "Add administrations"; method tabs (Enter IDs / Generate / Upload
  CSV / Reusable link / External source / Import completed responses) with
  one short sentence each instead of the duplicated wall of text. Field
  names are unchanged, so admin_new_fun's field-based dispatch is untouched.
  Footer button follows the tab; link tabs get copy buttons; the importer tab
  hands off to the (retitled, slimmed) import dialog.

Docs synced to the new names. Theme CSS (both copies) gains the table,
badge, danger-zone and method-tab styles.

Known follow-ups: the Selenium test for deleting a group (and the
locator-rot tracked in #648) needs rewriting for the new flow; the theme CSS
is served without cache-busting, so testers may need a hard reload.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant