Skip to content

Conversation

miya
Copy link
Contributor

@miya miya commented Sep 23, 2025

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

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@Copilot Copilot AI review requested due to automatic review settings September 23, 2025 15:28
@miya miya requested a review from a team as a code owner September 23, 2025 15:28
@miya miya requested a review from nbbeeken September 23, 2025 15:28
Copy link
Contributor

@Copilot Copilot AI left a 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.

@miya miya requested a review from Copilot September 23, 2025 15:32
Copy link
Contributor

@Copilot Copilot AI left a 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;
Copy link

Copilot AI Sep 23, 2025

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix: 6b4ce4d

Comment on lines 384 to 385
} catch {
// noop
Copy link

Copilot AI Sep 23, 2025

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.

@miya miya changed the title feat: Implement Zoom Level Persistenc feat: Implement Zoom Level Persistence Sep 23, 2025
@miya miya changed the title feat: Implement Zoom Level Persistence feat: Implement zoom level persistence Sep 23, 2025
@Anemy
Copy link
Member

Anemy commented Sep 23, 2025

Hi @miya thanks for opening the pr! Can you sign the contributors agreement please? https://www.mongodb.com/legal/contributor-agreement
We require folks to do that before we can accept a change.
We've seen some other folks ask for this feature, thank you for looking into it.

@miya
Copy link
Contributor Author

miya commented Sep 23, 2025

Hi @Anemy, nice to meet you!
Thank you for your reply. I’ve signed the contributors agreement as requested.
I’m glad to hear this feature is of interest to others as well. Looking forward to your feedback on the PR!

@gribnoysup gribnoysup changed the title feat: Implement zoom level persistence feat(compass, preferences): implement zoom level persistence COMPASS-9905 Sep 26, 2025
@gribnoysup gribnoysup added release notes feat no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) labels Sep 26, 2025
Copy link
Collaborator

@gribnoysup gribnoysup left a 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

@gribnoysup
Copy link
Collaborator

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

@miya
Copy link
Contributor Author

miya commented Sep 29, 2025

@gribnoysup
Sorry about that. I just checked and it looks like I had signed with the wrong GitHub username. I’ve corrected it and re-signed with the right one. Could you please confirm?

@nbbeeken nbbeeken removed their request for review October 1, 2025 00:51
@gribnoysup
Copy link
Collaborator

@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!

@gribnoysup
Copy link
Collaborator

Need to restart CI to get rid of flakes, will merge after that

@gribnoysup gribnoysup merged commit b5c5907 into mongodb-js:main Oct 1, 2025
31 of 34 checks passed
@miya miya deleted the feat/zoom-level-persistence branch October 7, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants