Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent action log modal from breaking out of stacking context #1883

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

andogq
Copy link
Contributor

@andogq andogq commented Mar 11, 2025

Done

Feels a little bit wacky, but the issue boils down to elements with an opacity != 0 will create a new stacking context, meaning the z-index set within for the backdrop doesn't interact with the rest of the page (eg navigation bars)

  • render modal inside Portal

  • add to framer element:

    • position to create a new stacking context which the modal can't break out of

    • z-index to imitate Vanilla's modal backdrop

QA

  • Pull code
  • Run dotrun clean && dotrun serve
  • Open http://0.0.0.0:8036/
  • Navigate Models -> a model -> Action Logs -> click a result

Details

Screenshots

Screen.Recording.2025-03-11.at.16.27.54.mov

@webteam-app
Copy link

Copy link

github-actions bot commented Mar 11, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 97.95% (🎯 95%) 14499 / 14801
🟢 Statements 97.95% (🎯 95%) 14499 / 14801
🟢 Functions 98.21% (🎯 95%) 604 / 615
🟢 Branches 92.28% (🎯 90%) 3025 / 3278
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/pages/EntityDetails/Model/Logs/ActionLogs/ActionLogs.tsx 96.38% 85.36% 100% 96.38% 86-87, 95, 117-122, 230-231, 241-242
Generated in workflow #226 for commit 88c89e6 by the Vitest Coverage Report Action

Copy link
Contributor

@huwshimi huwshimi left a comment

Choose a reason for hiding this comment

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

Great work figuring this one out.

- render modal inside `Portal`

- add to framer element:

  - `position` to create a new stacking context which the modal can't
    break out of

  - `z-index` to imitate Vanilla's modal backdrop
@andogq andogq force-pushed the fix/1784-action-modal branch from e010acb to 88c89e6 Compare March 11, 2025 23:51
@andogq
Copy link
Contributor Author

andogq commented Mar 11, 2025

Ready to merge, pending juju-dashboard release.

@huwshimi huwshimi merged commit 851054c into canonical:main Mar 12, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Action log modal animates behind sidebar
3 participants