fix(stage-tamagotchi): bring back onboarding dialog#1104
fix(stage-tamagotchi): bring back onboarding dialog#1104shinohara-rin wants to merge 11 commits intomainfrom
Conversation
Summary of ChangesHello, 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 Highlights
Changelog
Using Gemini Code AssistThe 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
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 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
|
⏳ Approval required for deploying to Cloudflare Workers (Preview) for stage-web.
Hey, @nekomeowww, @sumimakito, @luoling8192, @LemonNekoGH, kindly take some time to review and approve this deployment when you are available. Thank you! 🙏 |
There was a problem hiding this comment.
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)
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)
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()"
/>
This reverts commit 4ca92ae.
…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
|
/gemini review |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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() |
| onboardingStore.markSetupCompleted() | ||
| // window.closeWindow() | ||
| await markCompleted() | ||
| await closeWindow() |
There was a problem hiding this comment.
💡 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".
| const { setup: setupConfig, get: getConfig, update: updateConfig } = createConfig('onboarding', 'config.json', onboardingConfigSchema, { | ||
| default: { completed: false, skipped: false }, | ||
| autoHeal: true, | ||
| }) |
There was a problem hiding this comment.
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 👍 / 👎.
…und color Replace inline bg attribute with computed class binding for better reactivity
No description provided.