Skip to content

feat: add settings link to dashboard and vendor sidebar; enhance onbo… - #14

Merged
royal334 merged 1 commit into
mainfrom
react-joyride-addition
Aug 11, 2026
Merged

feat: add settings link to dashboard and vendor sidebar; enhance onbo…#14
royal334 merged 1 commit into
mainfrom
react-joyride-addition

Conversation

@royal334

@royal334 royal334 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

…arding tour with navigation prompts

Summary by CodeRabbit

  • New Features
    • Added Settings links to the dashboard and vendor navigation menus.
    • Enhanced the onboarding tour with guided navigation across pages, including mobile menu interactions.
    • Improved tour behavior when moving forward or backward between routes.
  • Bug Fixes
    • Ensured navigation prompts advance correctly when menu targets become visible.
    • Improved mobile header menu detection and tour progression.

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
my-school-and-i Ready Ready Preview Aug 11, 2026 8:53am
my-school-and-i-9enh Ready Ready Preview Aug 11, 2026 8:53am
my-school-and-i-h4cj Ready Ready Preview Aug 11, 2026 8:53am
my-school-and-i-t7lp Ready Ready Preview Aug 11, 2026 8:53am

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds Settings links to dashboard sidebars and extends the onboarding tour with route-aware prompts, mobile header-menu handling, navigation click capture, target polling, and cross-route backward navigation.

Changes

Dashboard navigation and onboarding

Layer / File(s) Summary
Navigation entries and tour targets
src/components/dashboard/app-sidebar.tsx, src/components/vendors/vendor-sidebar.tsx, src/components/dashboard/mobile-header-menu.tsx, src/components/tour/tour-steps.ts
Both sidebars add a Settings link. The mobile menu trigger receives a tour target. Tour step types and target resolvers support desktop and mobile navigation.
Route prompt generation
src/components/tour/tour-steps.ts, src/components/tour/onboarding-tour.tsx
The tour inserts navigation prompts between steps on different routes. Mobile header-menu routes use two-stage prompts.
Navigation prompt execution
src/components/tour/onboarding-tour.tsx
The tour polls for menu targets, captures menu-item navigation clicks, and skips prompts when navigating backward to a route’s content step.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant OnboardingTour
  participant NavigationMenu
  participant DestinationRoute
  User->>OnboardingTour: Start tour
  OnboardingTour->>NavigationMenu: Show route navigation prompt
  User->>NavigationMenu: Select destination menu item
  NavigationMenu->>DestinationRoute: Navigate to route
  DestinationRoute->>OnboardingTour: Expose next tour target
  OnboardingTour->>User: Advance to destination content step
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both the sidebar settings links and the onboarding tour enhancements.
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.
✨ 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 react-joyride-addition

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

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@src/components/tour/onboarding-tour.tsx`:
- Around line 326-336: Update the ACTIONS.PREV branch to select the destination
route’s content step immediately before the inserted header-menu prompt steps,
rather than the first matching route returned by stepsRef.current.findIndex.
Skip both navigation-prompt steps when calculating targetIndex, then pass that
adjacent content-step index to setPending while preserving the existing forward
fallback.

In `@src/components/tour/tour-steps.ts`:
- Line 4: Update the FloatingOptions type to remove the explicit any index
signature and replace it with an appropriate type-safe value type compatible
with the project’s strict TypeScript configuration, while preserving the
strategy property and support for additional keys.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42ad17fc-6e8f-4af2-a902-128572a7a499

📥 Commits

Reviewing files that changed from the base of the PR and between 11901a9 and a450c9a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • src/components/dashboard/app-sidebar.tsx
  • src/components/dashboard/mobile-header-menu.tsx
  • src/components/tour/onboarding-tour.tsx
  • src/components/tour/tour-steps.ts
  • src/components/vendors/vendor-sidebar.tsx

Comment on lines +326 to +336
if (action === ACTIONS.PREV) {
// Going back across pages: land on that page's content step,
// skipping the navigation-prompt steps on either side.
const targetIndex = stepsRef.current.findIndex(
(s) => s.route === nextStep.route,
);
setPending(nextStep.route, targetIndex);
} else {
// Forward fallback for a route without a clickable menu item.
setPending(nextStep.route, nextIndex);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore the adjacent source-page step on Back.

findIndex selects the first step for the destination route. For example, Back from Materials selects the Dashboard welcome step instead of the Dashboard navigation step immediately before the prompt. For header-menu navigation, skip both inserted menu prompt steps before selecting the preceding content step.

Proposed fix
-            const targetIndex = stepsRef.current.findIndex(
-              (s) => s.route === nextStep.route,
-            );
+            let targetIndex = nextIndex - 1;
+            while (
+              targetIndex >= 0 &&
+              (stepsRef.current[targetIndex]?.menuOpener ||
+                stepsRef.current[targetIndex]?.menuItemRoute)
+            ) {
+              targetIndex -= 1;
+            }
+            if (targetIndex < 0) return;
             setPending(nextStep.route, targetIndex);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (action === ACTIONS.PREV) {
// Going back across pages: land on that page's content step,
// skipping the navigation-prompt steps on either side.
const targetIndex = stepsRef.current.findIndex(
(s) => s.route === nextStep.route,
);
setPending(nextStep.route, targetIndex);
} else {
// Forward fallback for a route without a clickable menu item.
setPending(nextStep.route, nextIndex);
}
if (action === ACTIONS.PREV) {
// Going back across pages: land on that page's content step,
// skipping the navigation-prompt steps on either side.
let targetIndex = nextIndex - 1;
while (
targetIndex >= 0 &&
(stepsRef.current[targetIndex]?.menuOpener ||
stepsRef.current[targetIndex]?.menuItemRoute)
) {
targetIndex -= 1;
}
if (targetIndex < 0) return;
setPending(nextStep.route, targetIndex);
} else {
// Forward fallback for a route without a clickable menu item.
setPending(nextStep.route, nextIndex);
}
🤖 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/tour/onboarding-tour.tsx` around lines 326 - 336, Update the
ACTIONS.PREV branch to select the destination route’s content step immediately
before the inserted header-menu prompt steps, rather than the first matching
route returned by stepsRef.current.findIndex. Skip both navigation-prompt steps
when calculating targetIndex, then pass that adjacent content-step index to
setPending while preserving the existing forward fallback.


export type TourKind = 'student' | 'vendor';
export type TourStep = Step & { route: string };
type FloatingOptions = { strategy:string; [key: string]: any };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 2 '\bany\b|no-explicit-any' \
  src/components/tour/tour-steps.ts \
  eslint.config.* .eslintrc* 2>/dev/null || true

Repository: royal334/my-school-and-I

Length of output: 950


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- tour-steps.ts ---'
cat -n src/components/tour/tour-steps.ts | sed -n '1,35p;60,95p;150,230p'

printf '%s\n' '--- FloatingOptions references ---'
rg -n -C 3 'FloatingOptions|floatingOptions|strategy' src/components/tour src 2>/dev/null | head -n 240

printf '%s\n' '--- TypeScript and lint configuration ---'
fd -HI -t f '^(tsconfig.*|eslint\.config\..*|\.eslintrc.*)$' . -x sh -c 'echo "--- $1"; cat -n "$1"' sh {} \;

Repository: royal334/my-school-and-I

Length of output: 50381


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- project lint rule ---'
rg -n -C 2 'no-explicit-any' \
  node_modules/eslint-config-next \
  node_modules/@next/eslint-plugin-next \
  node_modules/@typescript-eslint 2>/dev/null | head -n 80 || true

printf '%s\n' '--- react-joyride type ---'
rg -n -C 5 'interface Step|type Step|floatingOptions|FloatingOptions' \
  node_modules/react-joyride 2>/dev/null | head -n 120 || true

Repository: royal334/my-school-and-I

Length of output: 9394


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- tour step consumers ---'
rg -n -C 5 'insertNavPromptSteps|TourStep|Joyride|steps=' src/components/tour src 2>/dev/null | head -n 220

printf '%s\n' '--- Joyride package metadata and declarations ---'
fd -HI -t f . node_modules/react-joyride node_modules/@types/react-joyride 2>/dev/null | head -n 80
rg -n -C 5 'floatingOptions|Floater|interface Step|type Step' \
  node_modules/react-joyride node_modules/@types/react-joyride \
  package.json package-lock.json 2>/dev/null | head -n 180

Repository: royal334/my-school-and-I

Length of output: 15485


Replace any in FloatingOptions.

@typescript-eslint/no-explicit-any rejects this type, and the project uses strict TypeScript.

Proposed fix
-type FloatingOptions = { strategy:string; [key: string]: any };
+type FloatingOptions = { strategy: string; [key: string]: unknown };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
type FloatingOptions = { strategy:string; [key: string]: any };
type FloatingOptions = { strategy: string; [key: string]: unknown };
🧰 Tools
🪛 ESLint

[error] 4-4: Unexpected any. Specify a different type.

(@typescript-eslint/no-explicit-any)

🤖 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/tour/tour-steps.ts` at line 4, Update the FloatingOptions type
to remove the explicit any index signature and replace it with an appropriate
type-safe value type compatible with the project’s strict TypeScript
configuration, while preserving the strategy property and support for additional
keys.

Sources: Coding guidelines, Linters/SAST tools

@royal334
royal334 merged commit e988dad into main Aug 11, 2026
6 checks passed
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