Skip to content

fix(stage-tamagotchi): bring back onboarding dialog#1104

Open
shinohara-rin wants to merge 11 commits intomainfrom
sr/onboarding-dialog
Open

fix(stage-tamagotchi): bring back onboarding dialog#1104
shinohara-rin wants to merge 11 commits intomainfrom
sr/onboarding-dialog

Conversation

@shinohara-rin
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request re-enables and refactors the onboarding experience for the stage-tamagotchi application. Instead of a separate onboarding page, the onboarding dialog is now integrated directly into the main application layout, ensuring a more seamless initial user setup. This change simplifies the application structure while maintaining the necessary onboarding steps.

Highlights

  • Onboarding Dialog Reintegration: The onboarding dialog has been reintroduced and integrated directly into the main application component (App.vue), replacing a standalone onboarding page.
  • Streamlined Onboarding Flow: The dedicated onboarding.vue page has been removed, simplifying the application's initial setup flow.
  • Enhanced Dialog Event Handling: The OnboardingDialog component now emits a 'skipped' event when the dialog is closed without the user completing the setup, allowing for better state management.
Changelog
  • apps/stage-tamagotchi/src/renderer/App.vue
    • Imported the OnboardingDialog component.
    • Added a reactive reference to shouldShowSetup from the onboarding store.
    • Implemented handleSetupConfigured and handleSetupSkipped functions to manage onboarding state.
    • Rendered the OnboardingDialog component, binding its visibility and event handlers.
  • apps/stage-tamagotchi/src/renderer/pages/onboarding.vue
    • Removed the dedicated onboarding page.
  • packages/stage-ui/src/components/scenarios/dialogs/onboarding/onboarding-dialog.vue
    • Modified the DialogRoot to emit a skipped event when the dialog is closed by the user without completing the setup.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

⏳ Approval required for deploying to Cloudflare Workers (Preview) for stage-web.

Name Link
🔭 Waiting for approval For maintainers, approve here

Hey, @nekomeowww, @sumimakito, @luoling8192, @LemonNekoGH, kindly take some time to review and approve this deployment when you are available. Thank you! 🙏

@shinohara-rin shinohara-rin marked this pull request as ready for review March 4, 2026 08:55
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request brings back the onboarding flow as a dialog. The implementation is mostly correct, but I've found a couple of areas for improvement. There's an inconsistency in how the dialog dismissal is handled between desktop and mobile views, which could lead to different behavior. I've also suggested a simplification in App.vue to make the code more concise by removing unnecessary wrapper functions.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/stage-ui/src/components/scenarios/dialogs/onboarding/onboarding-dialog.vue (24)

high

While this change correctly handles the dismissal of the dialog on desktop by emitting a skipped event, the same logic appears to be missing for the mobile view, which uses <DrawerRoot> on line 35. To ensure consistent behavior, the @update:open handler for <DrawerRoot> should also emit the skipped event when the drawer is closed.

apps/stage-tamagotchi/src/renderer/App.vue (100-104)

medium

You can simplify this by calling the store methods directly. This makes the code more concise and removes the need for the handleSetupConfigured and handleSetupSkipped wrapper functions defined on lines 85-91.

  <OnboardingDialog
    v-model="shouldShowSetup"
    @configured="onboardingStore.markSetupCompleted()"
    @skipped="onboardingStore.markSetupSkipped()"
  />

@shinohara-rin shinohara-rin marked this pull request as draft March 4, 2026 09:02
…racking

- Add onboarding window manager setup and initialization
- Implement close, completed, and skipped event handlers
- Add onboarding config interface and eventa definitions
- Update onboarding page to handle skip/complete actions and close window
- Show onboarding window on app ready if not completed
- Add background color styling to onboarding page
@shinohara-rin shinohara-rin marked this pull request as ready for review March 4, 2026 10:41
@shinohara-rin
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request re-introduces the onboarding dialog for the Electron version of the application, including a new window manager, event definitions, and updates to the Vue component. However, two critical security issues were identified in the setupOnboardingWindowManager function: the renderer sandbox is explicitly disabled, weakening defense-in-depth, and URLs passed to shell.openExternal are not validated, posing an exploitation risk if the renderer process is compromised. Additionally, the review highlighted an inconsistent use of setMaxListeners that should be centralized and redundant window-closing calls in the frontend component that can be removed for cleaner code.


newWindow.on('ready-to-show', () => newWindow.show())
newWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
Copy link
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The setWindowOpenHandler uses shell.openExternal to open URLs without any validation. This could allow a compromised renderer to open malicious URLs, including local files or system commands, potentially leading to remote code execution or information disclosure. It is highly recommended to validate the URL protocol (e.g., allowing only http: and https:) before calling shell.openExternal.

await load(newWindow, withHashRoute(baseUrl(resolve(getElectronMainDirname(), '..', 'renderer')), '/onboarding'))

// Setup IPC handlers for this window
ipcMain.setMaxListeners(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Setting ipcMain.setMaxListeners(0) here is inconsistent with the global setting of 100 in main/index.ts. This can hide potential listener leaks by setting an unlimited number of listeners for ipcMain. It's preferable to rely on the global configuration for consistency. If more listeners are required, the global limit in main/index.ts should be increased with justification.

async function handleSkipped() {
onboardingStore.markSetupSkipped()
await markSkipped()
await closeWindow()
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The closeWindow() call here is redundant. The markSkipped() event handler in the main process already closes the window. Removing this call will make the code cleaner and avoid invoking the close logic twice.

onboardingStore.markSetupCompleted()
// window.closeWindow()
await markCompleted()
await closeWindow()
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to handleSkipped, the closeWindow() call here is redundant because the markCompleted() event handler in the main process is already responsible for closing the window. This can be removed.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3eb7d4a330

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +32 to +35
const { setup: setupConfig, get: getConfig, update: updateConfig } = createConfig('onboarding', 'config.json', onboardingConfigSchema, {
default: { completed: false, skipped: false },
autoHeal: true,
})

Choose a reason for hiding this comment

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

P2 Badge Unify onboarding persistence with desktop reset flow

This change makes desktop onboarding state file-backed via createConfig('onboarding', 'config.json', ...), but the desktop reset action still only clears renderer onboarding state (onboardingStore.resetSetupState() in packages/stage-ui/src/composables/use-data-maintenance.ts). As a result, after a user completes or skips onboarding once, using “Reset Desktop Application State” (packages/stage-pages/src/pages/settings/data/index.vue) will not reopen onboarding on next launch because showIfNeeded() still reads completed/skipped from the untouched main-process config file; please clear/sync this file-backed state during reset or consolidate to one source of truth.

Useful? React with 👍 / 👎.

@shinohara-rin shinohara-rin requested review from nekomeowww and removed request for nekomeowww March 5, 2026 20:47
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