Skip to content

Refactors the Privacy modal component#45

Merged
algotyrnt merged 6 commits intomainfrom
dev
Mar 26, 2026
Merged

Refactors the Privacy modal component#45
algotyrnt merged 6 commits intomainfrom
dev

Conversation

@algotyrnt
Copy link
Copy Markdown
Owner

@algotyrnt algotyrnt commented Mar 26, 2026

resolves: #44

This pull request refactors the Privacy modal component for improved maintainability, consistency, and user experience, and updates the Footer to better handle opening the privacy policy. The changes include extracting style objects for clarity, using MUI's Stack for layout, and ensuring smoother modal transitions.

Refactoring and UI improvements in the Privacy modal:

  • Extracted style objects (dialogTitleSx, dialogTitleBoxSx, dialogContentSx, dialogContentBoxSx) for cleaner and more maintainable code in Privacy.tsx.
  • Replaced nested Box and manual margin logic with MUI's Stack component for consistent vertical spacing between sections [1] [2].
  • Added useTheme usage and passed theme values directly for responsive sizing and spacing [1] [2].
  • Added dialog transition durations and disabled scroll lock for a smoother modal experience.

Footer interaction update:

  • Changed the "Privacy Policy" trigger in the Footer from a Link to a Box styled as a button, and wrapped the modal open action in a React transition for better UI responsiveness [1] [2].

@algotyrnt algotyrnt requested a review from Copilot March 26, 2026 07:34
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
personal-site Ready Ready Preview, Comment Mar 26, 2026 9:19am

@algotyrnt algotyrnt self-assigned this Mar 26, 2026
@algotyrnt algotyrnt added the enhancement New feature or request label Mar 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Privacy dialog’s perceived performance by keeping the dialog mounted in the DOM between open/close cycles, reducing mount/unmount work during animations (aligned with Issue #44’s “mounting stutter/lag” item).

Changes:

  • Add keepMounted to the MUI <Dialog> in Privacy to avoid teardown/remount between opens.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@algotyrnt algotyrnt requested a review from Copilot March 26, 2026 08:27
@algotyrnt algotyrnt changed the title Apply the keepMounted prop directly to the parent to reduce animation lag Refactors the Privacy modal component Mar 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 82 to +89
<Dialog
open={open}
onClose={onClose}
maxWidth="md"
fullWidth
scroll="paper"
sx={(theme) => ({
disableScrollLock
transitionDuration={{ enter: 300, exit: 200 }}
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title/Issue #44 mention applying keepMounted on the parent <Dialog> to avoid mount/unmount jank, but the Dialog here still omits keepMounted. Add keepMounted (or justify why it’s not needed) so the modal stays mounted between opens and the performance goal is actually met.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

becous second we close the modal, React completely destroys the entire HTML tree inside of it from global Footer, freeing up your browser's memory footprint entirely.

@algotyrnt algotyrnt merged commit d7742f8 into main Mar 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize Privacy Policy Modal for Mobile Responsiveness and Performance

2 participants