Skip to content

feat(stage-tamagotchi): memorize scroll position#752

Merged
nekomeowww merged 4 commits intomoeru-ai:mainfrom
Mr-Quin:fix-scroll-restoration
Nov 20, 2025
Merged

feat(stage-tamagotchi): memorize scroll position#752
nekomeowww merged 4 commits intomoeru-ai:mainfrom
Mr-Quin:fix-scroll-restoration

Conversation

@Mr-Quin
Copy link
Collaborator

@Mr-Quin Mr-Quin commented Nov 20, 2025

Description

On electron, since the scroll element is not document, scroll position is lost when navigating between pages.
This PR fixes that.

Linked Issues

Additional Context

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Mr-Quin, 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 resolves an issue in the Electron environment where the scroll position was not retained when navigating between different pages, leading to a suboptimal user experience. It achieves this by introducing a dedicated Vue composable (useRestoreScroll) that intelligently saves and restores the scroll state of a specified container based on route changes. The settings.vue layout has been updated to utilize this new composable, ensuring consistent scroll behavior. Additionally, a minor adjustment was made to the index.html viewport meta tag.

Highlights

  • Scroll Position Restoration: Introduced a new Vue composable (useRestoreScroll) to manage and restore scroll positions when navigating between pages, specifically addressing an Electron-specific issue where scroll state was lost.
  • Viewport Meta Tag Update: Modified the index.html to include viewport-fit=cover in the viewport meta tag, which can affect how content is displayed in full-screen modes or on devices with notches/cutouts.
  • Settings Layout Integration: Integrated the new scroll restoration logic into the settings.vue layout, ensuring that the scroll position within the settings page is preserved across route changes.
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.

@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for airi-vtuber ready!

Name Link
🔨 Latest commit 5ff366a
🔍 Latest deploy log https://app.netlify.com/projects/airi-vtuber/deploys/691ec79ed93fe600086e89d1
😎 Deploy Preview https://deploy-preview-752--airi-vtuber.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for airi-docs ready!

Name Link
🔨 Latest commit 5ff366a
🔍 Latest deploy log https://app.netlify.com/projects/airi-docs/deploys/691ec79eeab26f000894eac1
😎 Deploy Preview https://deploy-preview-752--airi-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

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 introduces a fix for restoring scroll position when navigating between pages in Electron. It achieves this by creating a new Vue composable, useRestoreScroll, which tracks and restores the scroll position of a designated container as the route changes. This composable is then implemented in the settings layout.

The changes in settings.vue and index.html look good. My review includes a suggestion to refactor the new useRestoreScroll composable to improve its robustness by making the scroll position storage a singleton, and by adding checks to prevent potential errors from asynchronous updates. This will ensure scroll positions are preserved even when navigating away from and back to pages using this functionality.

autofix-ci bot and others added 3 commits November 20, 2025 03:12
@nekomeowww nekomeowww changed the title fix scroll position not restoring in electron feat(stage-tamagotchi): memorize scroll position Nov 20, 2025
@nekomeowww nekomeowww merged commit 5eb6b82 into moeru-ai:main Nov 20, 2025
16 checks passed
@Mr-Quin Mr-Quin deleted the fix-scroll-restoration branch November 22, 2025 02:35
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.

2 participants