Skip to content

Reduce usages of setModal #13457

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

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open

Reduce usages of setModal #13457

wants to merge 20 commits into from

Conversation

somebody1234
Copy link
Contributor

Pull Request Description

  • Reduce usages of the unconventional setModal
    • It is being replaced with regular Portal/Dialog usage - opening and closing is handled by a new imperative API
  • This should simplify various usages
  • Fix bug causing paste via Cmd+V to not work after navigating to a new directory

Important Notes

None

Testing Instructions

  • Open and close dialogs:
    • Context menus
    • User Menu
    • About Dialog (in User Menu)
  • Test keyboard shortcuts
    • Copy, cut, paste etc
    • Settings (Cmd + ,)
    • About Dialog (Cmd + /)

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@somebody1234 somebody1234 added the CI: No changelog needed Do not require a changelog entry for this PR. label Jul 9, 2025
@somebody1234 somebody1234 added the x-refactor Changes that should not be visible to the end-user label Jul 9, 2025
@somebody1234 somebody1234 requested a review from indiv0 as a code owner July 9, 2025 11:46
@somebody1234
Copy link
Contributor Author

pinging @kazcw for CR of event handling, maybe
pinging @farmaazon (optional) for general CR

@enso-bot
Copy link

enso-bot bot commented Jul 9, 2025

E-Hern Lee reports a new STANDUP for the provided date (2025-07-08):

Progress: - implement It should be finished by 2025-07-13.

Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

Partial review

Comment on lines 188 to 192
React.useEffect(() => {
if (contextMenuPosition != null) {
setContextMenuPosition(null)
}
}, [contextMenuPosition])
Copy link
Contributor

Choose a reason for hiding this comment

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

So, every time someone is changing contextMenuPosition, we set it back to null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup - this is only the initial context menu position passed to the context menu. feel free to suggest how i can make that clearer

</Popover>
)
<AboutModal ref={aboutModalRef} />
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels a bit like component duplication, doesn't it? IIRC you could even have two about modals displayed at the same time: one through user menu, another through application menu (on macOS)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right - this feels cleaner to me but i do agree that the duplication does feel dirty in a way, it should definitely be possible to deduplicate the component.

@farmaazon farmaazon self-requested a review July 16, 2025 15:04
Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. g-dashboard x-refactor Changes that should not be visible to the end-user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants