Skip to content

only popup the vscode env var dialog once #1066

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

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Conversation

aaronvg
Copy link
Contributor

@aaronvg aaronvg commented Oct 21, 2024

Important

Ensure the VSCode environment variables dialog only appears once by tracking its closed state with hasClosedEnvVarsDialogAtom.

  • Behavior:
    • Introduces hasClosedEnvVarsDialogAtom in EventListener.tsx to track if the environment variables dialog has been closed.
    • Updates ShowSettingsButton and SettingsDialog in SettingsDialog.tsx to check hasClosedEnvVarsDialogAtom before showing the dialog.
  • State Management:
    • Uses atomWithStorage for hasClosedEnvVarsDialogAtom to persist the closed state across sessions.
  • UI Logic:
    • In SettingsDialog.tsx, the dialog only opens automatically if hasClosedEnvVarsDialogAtom is false.

This description was created by Ellipsis for 2ac140b. It will automatically update as commits are pushed.

Copy link

vercel bot commented Oct 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baml ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 21, 2024 4:47am

@aaronvg aaronvg enabled auto-merge October 21, 2024 03:03
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 4e09b54 in 22 seconds

More details
  • Looked at 65 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_TfkOxh1kcYM03uhN


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

<Dialog open={showSettings} onOpenChange={setShowSettings}>
<Dialog open={showSettings} onOpenChange={(open) => {
setShowSettings(open)
setHasClosedEnvVarsDialog(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic for setting hasClosedEnvVarsDialog is incorrect. It should be set to true only when the dialog is closed, not when it is opened. Consider updating the logic to:

Suggested change
setHasClosedEnvVarsDialog(true)
setHasClosedEnvVarsDialog(!open)

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 2ac140b in 17 seconds

More details
  • Looked at 35 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. typescript/playground-common/src/shared/SettingsDialog.tsx:250
  • Draft comment:
    Consider adding hasClosedEnvVarsDialog to the dependency array of the useEffect hook to ensure the effect re-runs when it changes.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_ZqYOItH3JtUaXYpF


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@aaronvg aaronvg added this pull request to the merge queue Oct 21, 2024
Merged via the queue into canary with commit 1951474 Oct 21, 2024
9 of 10 checks passed
@aaronvg aaronvg deleted the vscode-dialog-popupfix branch October 21, 2024 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant