Skip to content

Conversation

@JammingBen
Copy link
Contributor

I also replaced the snapshot tests with proper element checks because they were once again broken without anybody noticing.

Also the refactors the AppWrapper component to script setup.

fixes #1434

@JammingBen JammingBen self-assigned this Oct 28, 2025
Copilot AI review requested due to automatic review settings October 28, 2025 06:23
Copy link
Contributor

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 fixes an issue where save buttons were incorrectly displayed in the top bar for read-only files. The fix introduces an isReadOnly prop that is used to conditionally hide the autosave indicator and save action buttons when files are not writable. Additionally, the PR refactors the AppWrapper component from options API to script setup syntax and replaces brittle snapshot tests with more maintainable element-based assertions.

Key changes:

  • Added isReadOnly prop to AppTopBar component to conditionally render save-related UI elements
  • Refactored AppWrapper.vue from options API to script setup syntax
  • Replaced snapshot tests with explicit element existence checks in AppTopBar.spec.ts

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/web-pkg/tests/unit/components/snapshots/AppTopBar.spec.ts.snap Removed all snapshot test baselines as they were replaced with element checks
packages/web-pkg/tests/unit/components/AppTopBar.spec.ts Updated tests to use element existence checks instead of snapshots and added test for autosave indicator visibility
packages/web-pkg/src/components/AppTopBar.vue Added isReadOnly prop and conditional rendering logic for autosave indicator
packages/web-pkg/src/components/AppTemplates/AppWrapper.vue Refactored from options API to script setup and integrated isReadOnly prop

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Nice 💪

@JammingBen JammingBen merged commit ff4b485 into main Oct 28, 2025
29 checks passed
@JammingBen JammingBen deleted the fix/topbar-save-button-read-only branch October 28, 2025 09:13
@openclouders openclouders mentioned this pull request Oct 28, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Save button and auto-save show up for read-only documents

3 participants