-
Notifications
You must be signed in to change notification settings - Fork 237
feat(compass, preferences): implement zoom level persistence COMPASS-9905 #7363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… the acceptable range
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements zoom level persistence functionality, allowing users to maintain their preferred zoom level across application restarts. The implementation includes debounced saving of zoom level changes to prevent excessive disk writes and proper restoration of saved zoom levels on startup.
- Adds debounced zoom level persistence with 500ms delay to avoid frequent saves
- Implements zoom level restoration on application startup with validation
- Extends preferences schema to include optional
zoomLevel
property
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/compass/src/app/application.tsx | Implements zoom level persistence logic with debounced saving and startup restoration |
packages/compass-preferences-model/src/preferences-schema.tsx | Adds zoomLevel property to preferences schema with proper validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
const SAVE_DEBOUNCE_DELAY = 500; // 500ms delay for save operations | ||
|
||
// Debounced save zoom level to preferences | ||
let saveTimeout: NodeJS.Timeout | null = null; |
Copilot
AI
Sep 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The saveTimeout variable is declared in function scope but needs to persist across multiple function calls. Consider moving this to a higher scope or using a closure to avoid potential issues with variable lifecycle.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 6b4ce4d
} catch { | ||
// noop |
Copilot
AI
Sep 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty catch block with 'noop' comment provides no debugging information. Consider logging the error or adding a more descriptive comment explaining why errors are intentionally ignored.
Copilot uses AI. Check for mistakes.
Hi @miya thanks for opening the pr! Can you sign the contributors agreement please? https://www.mongodb.com/legal/contributor-agreement |
Hi @Anemy, nice to meet you! |
Co-authored-by: Nikola Irinchev <[email protected]>
This reverts commit bd6d862.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! We'll wait for CI to pass and then will merge, thanks again for the contribution, these are always welcome
Hey @miya! Can you please sign the CLA again? We're having trouble finding your name in the list, it might be a technical issue on our side, but just to make sure it's there |
@gribnoysup |
@miya no worries at all. Took us a bit of time to double-check, but we can see the signature now, thanks for being patient with us and for an amazing contribution! |
Need to restart CI to get rid of flakes, will merge after that |
Description
This PR adds the ability to persist user zoom level settings across application restarts, improving the user experience by maintaining their preferred zoom level.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes