Skip to content

feat: welcome modal#751

Open
Sriharshitha156 wants to merge 3 commits into
algoscope-hq:mainfrom
Sriharshitha156:feature/welcome-modal
Open

feat: welcome modal#751
Sriharshitha156 wants to merge 3 commits into
algoscope-hq:mainfrom
Sriharshitha156:feature/welcome-modal

Conversation

@Sriharshitha156

@Sriharshitha156 Sriharshitha156 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Pull Request Summary

What changed?

This PR introduces a welcome modal that is displayed to first-time users when they visit AlgoScope. The modal provides a brief introduction to the platform and enhances the onboarding experience. It also integrates with the existing guided tour by adding the required tour attributes and stores the user's preference in local storage so the modal is shown only once.

Why is this needed?

This improves the first-time user experience by providing a clear introduction to the platform before users start exploring its features. It creates a smoother onboarding flow and integrates seamlessly with the guided tour.

Closes #

Type of Change

  • feat - New user-facing feature or algorithm capability
  • fix - Bug fix or regression fix
  • docs - Documentation-only change
  • style - Formatting or styling change with no behavior change
  • refactor - Code restructuring with no feature or bug-fix behavior change
  • perf - Performance improvement
  • test - Test coverage or test infrastructure change
  • build - Build system, dependency, or packaging change
  • ci - GitHub Actions, Docker, or release automation change
  • chore - Maintenance change that does not affect users
  • revert - Reverts a previous change

Release Notes

Release note category:

  • Added
  • Changed
  • Fixed
  • Removed
  • Deprecated
  • Security
  • Not required

Release note entry:

  • Added a welcome modal for first-time users with local storage support and guided tour integration.

Testing and Verification

  • npm ci or npm install
  • npm run format:check
  • npm run lint
  • npm run build
  • Manual browser testing at http://localhost:5173
  • Responsive testing for affected views
  • No new console errors or warnings

Skipped or additional testing notes:

  • npm install completed successfully.
  • npm run format:check, npm run lint, and npm run build were not executed during this contribution.

UI Evidence

Before:
image

image

After:
image

image

CI/CD and Deployment Impact

  • No deployment impact expected
  • Updates GitHub Actions or release automation
  • Updates Docker build/runtime behavior
  • Updates Vercel, Nginx, redirects, or client-side routing behavior
  • Adds or changes environment variables
  • Adds, removes, or updates npm dependencies
  • Requires maintainer follow-up after merge

Deployment notes:

  • No additional deployment steps, environment variables, or configuration changes are required.

Reviewer Checklist

  • PR title follows Conventional Commits and matches the selected change type
  • Scope is focused and unrelated changes are excluded
  • Release note category and entry are accurate
  • CI checks are expected to pass: format, lint, and build
  • UI evidence is included when user-facing screens changed
  • Documentation is updated when behavior, setup, or deployment changed


<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added a first-visit welcome modal with options to start a quick tour or continue to the app.
  * Expanded the guided tour with more steps covering algorithm cards, visualizers, and favorites.
  * Highlighted key areas in the algorithms section to better support onboarding.

* **Bug Fixes**
  * Improved tour and welcome-screen behavior so they open and close more reliably across visits.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@Sriharshitha156 is attempting to deploy a commit to the adityapaul2603-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify

netlify Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploy Preview for astounding-nougat-da0f6a ready!

Name Link
🔨 Latest commit 6f66d9e
🔍 Latest deploy log https://app.netlify.com/projects/astounding-nougat-da0f6a/deploys/6a47d4dc44efdf0008ee60b3
😎 Deploy Preview https://deploy-preview-751--astounding-nougat-da0f6a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a first-visit WelcomeModal component, converts GuidedTour from a self-managed tour into a controlled component (isOpen/onClose props), wires both into Home with new data-tour instrumentation and state handling, and expands tourSteps with three additional steps.

Changes

Onboarding Flow (Welcome Modal + Guided Tour)

Layer / File(s) Summary
AlgoCard dataTour prop forwarding
src/components/AlgoCard.jsx, welcome-modal.patch
AlgoCard destructures a new dataTour prop and forwards it as data-tour on the root motion container.
GuidedTour converted to controlled component
src/components/GuidedTour.jsx, welcome-modal.patch
GuidedTour now takes isOpen/onClose props, removes the auto-start localStorage effect, and routes completion/skip through onClose().
New WelcomeModal component
src/components/WelcomeModal.jsx, welcome-modal.patch
Adds WelcomeModal with WELCOME_STORAGE_KEY, scroll-lock/Escape handling, animated UI, and onExplore/onTakeTour actions.
Home wiring of WelcomeModal and GuidedTour
src/components/Home.jsx, welcome-modal.patch
Home adds welcome/tour state, data-tour instrumentation on cards, and renders both components as controlled.
tourSteps content expansion
src/data/tourSteps.js, welcome-modal.patch
Adds three new tour steps and broadens an existing step's description.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Home
  participant WelcomeModal
  participant localStorage
  participant GuidedTour
  Home->>localStorage: check WELCOME_STORAGE_KEY
  Home->>WelcomeModal: isOpen=true (first visit)
  User->>WelcomeModal: click Take Quick Tour
  WelcomeModal->>Home: onTakeTour()
  Home->>localStorage: set WELCOME_STORAGE_KEY
  Home->>GuidedTour: isOpen=true
  User->>GuidedTour: complete/skip tour
  GuidedTour->>localStorage: set algoscope-tour-completed
  GuidedTour->>Home: onClose()
  Home->>Home: setShowTour(false)
Loading

Possibly related issues

Possibly related PRs

Suggested labels: type:feature, level:advanced

Suggested reviewers: adityapaul26

Hey, nice work turning GuidedTour into a controlled component — that's the right call since it decouples "when to show" from "how to show," letting Home orchestrate onboarding state cleanly. One thing worth double-checking: the rect-sync effect now gates on the isOpen prop, so verify cleanup (interval/listeners) still fires correctly when isOpen flips to false mid-tour to avoid stale DOM references. Also worth a quick check that WELCOME_STORAGE_KEY writes happen before onClose/onTakeTour fire, so a fast double-click can't race past the localStorage write.

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Conventional Commits ⚠️ Warning The repo expects feat:-style titles, but one commit is Added Welcome modal, and the PR title shown in context (Feature/welcome modal (#751)) isn’t conventional either. Rename the PR title to feat: ... and rewrite any non-conventional commit subjects, e.g. feat: add welcome modal.
✅ Passed checks (6 passed)
Check name Status Explanation
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.
Algorithm Complexity ✅ Passed PASS: This PR only adds onboarding/tour UI and data-tour hooks; no algorithm implementation or complexity docs changed, so there’s no complexity mismatch to verify.
Title check ✅ Passed The title is a clear conventional commit and accurately summarizes the main change: adding a welcome modal.
Description check ✅ Passed The description follows the template and covers summary, motivation, type, release notes, testing, UI evidence, and deployment impact.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/WelcomeModal.jsx (1)

7-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Move focus into the modal on open (and consider a focus trap).

No focus is set when the modal opens, so keyboard/screen-reader users don't land on "Take Quick Tour"/"Explore Platform" — they can Tab through whatever was focused on the page behind it. Since this dialog has role="dialog"/aria-modal="true", it should manage focus per WAI-ARIA authoring practices.

♿ Proposed fix: move focus to the primary CTA on open
-import React, { useEffect } from 'react'
+import React, { useEffect, useRef } from 'react'
 import { motion, AnimatePresence } from 'framer-motion'
 import { Compass, MapPin, Sparkles } from 'lucide-react'

 export const WELCOME_STORAGE_KEY = 'algoscope-welcome-seen'

 export const WelcomeModal = ({ isOpen, onExplore, onTakeTour }) => {
+  const primaryButtonRef = useRef(null)
+
+  useEffect(() => {
+    if (isOpen) primaryButtonRef.current?.focus()
+  }, [isOpen])
+
   // Prevent background scroll while the modal is open
                 <button
                   type="button"
+                  ref={primaryButtonRef}
                   onClick={onTakeTour}
                   className="w-full flex items-center justify-center gap-2 px-5 py-3 rounded-xl text-sm font-bold theme-button-primary shadow-sm hover:scale-[1.02] active:scale-95 transition-all cursor-pointer"
                 >

For a complete solution (Tab-cycling focus trap, focus restoration on close), consider focus-trap-react rather than hand-rolling the key handling.

Also applies to: 44-54

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/WelcomeModal.jsx` around lines 7 - 27, WelcomeModal currently
opens without moving keyboard focus, so users can tab into the page behind the
dialog; update the WelcomeModal component to set initial focus when isOpen
becomes true, ideally on the primary CTA ("Take Quick Tour" / "Explore
Platform") using a ref and effect in the existing useEffect flow. Since the
modal already behaves like a dialog, also add or plan for a proper focus trap
and focus restoration on close, using the WelcomeModal/handleKeyDown logic as
the place to integrate it or replace it with a library like focus-trap-react.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/components/WelcomeModal.jsx`:
- Around line 7-27: WelcomeModal currently opens without moving keyboard focus,
so users can tab into the page behind the dialog; update the WelcomeModal
component to set initial focus when isOpen becomes true, ideally on the primary
CTA ("Take Quick Tour" / "Explore Platform") using a ref and effect in the
existing useEffect flow. Since the modal already behaves like a dialog, also add
or plan for a proper focus trap and focus restoration on close, using the
WelcomeModal/handleKeyDown logic as the place to integrate it or replace it with
a library like focus-trap-react.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: caabc05e-12c1-4ae8-b4d1-f70b7ef305e3

📥 Commits

Reviewing files that changed from the base of the PR and between 7784d9a and 344cf9c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • src/components/AlgoCard.jsx
  • src/components/GuidedTour.jsx
  • src/components/Home.jsx
  • src/components/WelcomeModal.jsx
  • src/data/tourSteps.js
  • welcome-modal.patch

@Sriharshitha156 Sriharshitha156 changed the title Feature/welcome modal feat: welcome modal Jul 3, 2026
@Sriharshitha156

Sriharshitha156 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi @Bimbok @adityapaul26 , I've completed the implementation and verified the changes locally. All required CI checks are passing (except the expected Vercel authorization checks for forked PRs). I'd appreciate a review whenever you have time. Thank you!

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