Skip to content

Improve password prompt visibility and session handling logic - #3537

Merged
Baalmart merged 2 commits into
stagingfrom
oauth-setup
May 25, 2026
Merged

Improve password prompt visibility and session handling logic#3537
Baalmart merged 2 commits into
stagingfrom
oauth-setup

Conversation

@OchiengPaul442

@OchiengPaul442 OchiengPaul442 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Status of maturity (all need to be checked before merging):

  • I've tested this locally
  • I consider this code done

Screenshots (optional)

Summary by CodeRabbit

  • Improvements
    • Password prompt dialog now displays with a controlled delay before appearing, providing a refined timing for authentication prompts.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR modifies SetPasswordPromptDialog.tsx to introduce a 5-second delay before showing the password prompt. The component now manages a timeout using a useRef, checks early-exit conditions (unauthenticated user, missing session data, password already exists, or previously dismissed), and schedules the dialog to open asynchronously rather than immediately.

Changes

Delayed Password Prompt Dialog

Layer / File(s) Summary
Timer infrastructure setup
src/platform/src/shared/components/auth/SetPasswordPromptDialog.tsx
Imports useRef from React, adds SET_PASSWORD_PROMPT_DELAY_MS = 5000 constant, and creates openTimerRef to track and manage the timeout across component renders.
Effect logic refactoring with delayed opening
src/platform/src/shared/components/auth/SetPasswordPromptDialog.tsx
Derives hasAuthMethods and hasPassword flags for clearer branch logic, then rewrites the effect to early-return when conditions aren't met (unauthenticated, missing data, already has password, previously dismissed), clears any existing timeout before scheduling, schedules the dialog to open after the delay, and properly cleans up the timeout on unmount or dependency change.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested Reviewers

  • Baalmart

Poem

⏳ A prompt waits five seconds to appear,
No rushing in with password cheer.
When authenticated and ready to go,
The dialog blooms with a measured flow.
Timeouts now clear, logic runs clean—
The smoothest prompt you've ever seen. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding delay logic to the password prompt dialog and improving its visibility/timing behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch oauth-setup

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

New azure analytics_platform changes available for preview here

@Baalmart
Baalmart merged commit 1430079 into staging May 25, 2026
19 of 20 checks passed
@Baalmart
Baalmart deleted the oauth-setup branch May 25, 2026 13:27
@Baalmart Baalmart mentioned this pull request May 25, 2026
2 tasks
@coderabbitai coderabbitai Bot mentioned this pull request May 25, 2026
7 tasks
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.

2 participants