Skip to content

Add trash/restore for deleted studies + studies page polish#111

Open
hendriebeats wants to merge 11 commits into
masterfrom
deleted-studies-restore-and-better-styles
Open

Add trash/restore for deleted studies + studies page polish#111
hendriebeats wants to merge 11 commits into
masterfrom
deleted-studies-restore-and-better-styles

Conversation

@hendriebeats

@hendriebeats hendriebeats commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Adds a Trash tab to the studies page where deleted studies can be viewed and restored. After deleting a study, the user is redirected to the studies page with an undo banner that lets them restore immediately. Also polishes the studies page with an empty state, scroll layout fix, and several small bug fixes.

Q&A for Code Reviewers

Restore flow

  • The delete redirect now includes ?deleted=<id>&name=<encoded-name> so the studies page can show an undo banner without a round-trip — name is URL-encoded before being placed in the query string.
  • restoreStudy re-fetches getDeletedDocs to verify ownership before restoring; no separate auth table needed since deleted docs already carry the editor relationship.
  • After restore, the user is redirected straight to the study rather than back to the list.

Trash tab auto-open

  • A small inline script auto-switches to the Trash tab when deletedDocId is in the query string, so the undo banner and the restored item are both visible in context.

Scroll layout

  • overflow: hidden on body + a flex scroll container (#studiesScroll) moves the scrollbar ownership to the inner div, keeping the nav fixed and the footer pinned to the bottom of the content.

Bug fixes (incidental)

  • a&hover was malformed nested CSS; corrected to &:hover.
  • Two buttons had duplicate class= attributes (HTML only honours the last one); merged into single class strings.
  • Modal close icon changed from bare <img> to <button><img></button> for keyboard accessibility.

@hendriebeats

Copy link
Copy Markdown
Contributor Author

@boxyoman this is another decent one you may like.

@hendriebeats hendriebeats force-pushed the deleted-studies-restore-and-better-styles branch from 204bebc to 2ab7ed9 Compare February 19, 2026 08:09
hendriebeats and others added 7 commits February 20, 2026 19:52
…me in redirect

- Replace pencil edit img with a <button> in Editor.tsx for keyboard accessibility
- Replace remove div with a <button> in StudyBlockEditor.ts for keyboard accessibility
- Add button reset styles in editor.css and study.css for the new buttons
- Fix typo "grad" -> "drag" in study.html
- URL-encode doc.name in Study.hs deleteStudy redirect to handle special characters

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Relude already re-exports decodeUtf8 and encodeUtf8, causing an
ambiguous import warning treated as an error by GHC.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix bug: resendInvite fetched share data before extending expiry, so
  the re-rendered badge could still show "Expired" or "Rejected"
- Fix bug: ownershipMemberDoc hardcoded isOwner=True, exposing owner
  controls (role dropdown, remove button) to non-owner members
- Remove dead code: getInvite handler and its /group_study/invite/:groupId
  route (replaced by inline invite form in the group study modal)
- Remove leftover debug logDebugSH/logInfoSH calls
- Consolidate duplicate unsafeAsObject/emptyStudy into Entity.Document
- Convert <img onclick> close icons and bare <a onclick> to proper
  <button> elements with aria-labels
- Add aria-labels to all color swatches, parallel view button, question
  popup close, and study block remove buttons
- Add contenteditable="false" to verse ref, question mark, placeholder,
  and other-cursor ProseMirror widget elements
- Fix duplicate underlineClick function definition in study.html
- Fix duplicate class attributes on Accept/Reject invite buttons
…s on mousedown

- Validate redirect targets in login flow to reject absolute/protocol-relative URLs (safeRedirect)
- Apply same redirect validation in the already-logged-in path in Server.hs
- Move emptyStudy definition to Entity.Document and remove duplicate in GroupStudy.hs
- Fix CSS selector typo: a&hover → &:hover on study card hover state
- Add mousedown preventDefault on editor NodeView buttons and decorations to prevent ProseMirror losing focus on click
- Remove unused Entity.User import from Study.hs
Remove editor fixes, accessibility rewrites, open-redirect fix, and auth
bug fixes that were accidentally bundled in by a wide-scope agent run.
Restore those files to master. Keep only the trash tab, restore endpoint,
and undo banner functionality in Study.hs, Entity/Document.hs, and Server.hs.
- Add hx-target="#groupStudy" to the create group study form so the
  response replaces the dialog content instead of nesting inside the form
- Remove unused getInvite handler and getInviteNewMemberHTML (dead code
  since the inline invite form replaced the separate invite page)
- Remove the /group_study/invite/:groupId GET route from Server.hs

- Add contenteditable="false" to non-editable ProseMirror node view
  elements (verse ref widget, studyBlocks edit icon, Bible text header,
  questions placeholder, add-answer button) to prevent cursor placement
  inside them
- Add mousedown preventDefault to studyBlocks edit icon and add-answer
  button to prevent editor focus loss on click
- Add mouseup to verseRefWidget stopEvent to prevent browser selection
  from overriding the cursor position set by the mousedown handler

- Auto-switch to Trash tab on studies page when landing with ?deleted= params
- Fix closeModalIcon CSS for button-wrapping-img pattern in newstudy.css
  and groupstudy.css
@hendriebeats hendriebeats changed the title Add trash tab with restore functionality for deleted studies Add trash/restore for deleted studies and group study UI improvements Feb 21, 2026
hendriebeats and others added 2 commits February 21, 2026 20:00
Reverts frontend editor, sidebar, and study block editor changes
back to master. Also reverts unrelated GroupStudy, nav, study,
groupstudy, and newstudy style changes. Restores the removed
group_study invite route in Server.hs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New users landing on the studies page with no studies saw a blank
table with column headers and nothing else — not a great first
impression. Replace that with a centered, friendly call-to-action
card that encourages them to create their first study.

- Book emoji, welcoming headline, and short encouraging copy
- Prominent "Start Your First Study" button that opens the new-study modal
- Soft hint about solo vs. group study options
- Light blue card background to make the section feel warm and distinct
@hendriebeats hendriebeats changed the title Add trash/restore for deleted studies and group study UI improvements Add trash/restore for deleted studies + studies page polish Feb 22, 2026
@hendriebeats hendriebeats added the Size: Medium 101–400 lines: Multi-file change, needs focused review but still manageable. label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Medium 101–400 lines: Multi-file change, needs focused review but still manageable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant