Skip to content

Rework invite flow with callout cards and modal flow#109

Open
hendriebeats wants to merge 6 commits into
masterfrom
invite-flow-rework
Open

Rework invite flow with callout cards and modal flow#109
hendriebeats wants to merge 6 commits into
masterfrom
invite-flow-rework

Conversation

@hendriebeats

@hendriebeats hendriebeats commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Replaces the flat invite table on the studies page with callout cards and a multi-step modal flow (review → accept/reject → select or create document). Also pulls the owner's name into the invite query so it can be shown to invitees.

Reviewer notes

Invite flow — new modal steps

  • reviewShareModal / confirmRejectModal / selectDocumentModal are three new HTMX endpoints that render successive steps inside a single <dialog> element; each step swaps the dialog's innerHTML rather than navigating.
  • The reject flow goes through a confirmation step before actually deleting the share token, to avoid accidental rejections.
  • selectDocumentModal filters to "ungrouped" documents (those not already in a group study) because linking a document to two studies simultaneously would be incoherent.

Owner name on invite cards

  • GetMyShareData now includes ownerName (shown on the invite card: "Alice has invited you to join…"). The join is a leftJoin_' on groupStudyOwner → user; it's nullable because a study might theoretically have no owner row yet.
  • The join can produce multiple rows when a study has multiple owners, so getSharesForUser now deduplicates by token after mapping. The query already filtered by share.email = user.email so the set is small.
  • Invites are now sorted by created ascending so the oldest invite appears first.

p-select "modern" variant

  • Added a variant="modern" style to the custom <p-select> element for use inside the accept-invite modal, where the default inline style doesn't fit. It positions the dropdown with position: fixed so it escapes any overflow: hidden ancestors in the modal.

Safety fixes (tidy pass)

  • head gdoc.editorsfor_ (listToMaybe gdoc.editors): head is partial and would crash if a doc had no editors; silently skipping is correct behavior here.
  • StopListenToDoc was sending docId (the new doc) instead of currentDocId (the doc being left), which would have caused the server to stop the wrong subscription on doc switch.
  • All clickable <img> close icons replaced with <button type="button"> wrappers; the "Remove" button in the invite form given type="button" to prevent accidental form submission.
  • Six logInfoSH/logInfo debug calls removed from ownershipMemberDoc.
  • CSS typo a&hover&:hover on study row hover rule.

Closes #101

@hendriebeats

Copy link
Copy Markdown
Contributor Author

@boxyoman I think you'll like this one. It's better than the last designs I showed you and solves the problem of people not knowing they can link a document or create a new one intuitively.

hendriebeats and others added 3 commits February 19, 2026 03:20
- Replace flat invite table with blue callout cards showing owner name and study details
- Add multi-step modal: document selection (existing vs new) with reject option
- Add layered confirmation dialog for rejecting invites
- Modernize p-select component: white bg, border styling, fixed-position dropdown with smart viewport-aware positioning
- Add ownerName and created fields to GetMyShareData with owner join
- Sort invites by created date ascending
- Add lighter hover shade (--blue-35) for lightBlue buttons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace clickable <img> close icons with <button> elements (keyboard accessible)
- Add type="button" to remove buttons inside forms to prevent accidental submit
- Add ariaLabel_ helper to Lucid.Htmx and apply aria-label to close/remove buttons
- Add keyboard support (Enter/Space) and ARIA roles to p-select custom element
- Fix partial head on gdoc.editors — wrap with for_/listToMaybe to avoid crash on empty list
- Replace length == 0 check with Prelude.null
- Fix StopListenToDoc sending new docId instead of currentDocId when switching docs
- Remove debug logInfoSH/logInfo calls left in ownershipMemberDoc
- Fix CSS typo a&hover → &:hover on study row hover rule
- Update .closeModalIcon CSS rules for button wrapper in groupstudy/newstudy/studies CSS
@hendriebeats hendriebeats changed the title Rework invite flow with callout cards and modal Rework invite flow with callout cards and modal flow Feb 21, 2026
@hendriebeats hendriebeats added the Size: Large 401–1,000 lines: Higher risk; usually should be split unless it’s a mechanical refactor. label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Large 401–1,000 lines: Higher risk; usually should be split unless it’s a mechanical refactor.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve accepting group study flow.

1 participant