Skip to content

Feature/components keep or save on dispose#75

Draft
arneschmid wants to merge 10 commits intomainfrom
feature/components-keep-or-save-on-dispose
Draft

Feature/components keep or save on dispose#75
arneschmid wants to merge 10 commits intomainfrom
feature/components-keep-or-save-on-dispose

Conversation

@arneschmid
Copy link
Copy Markdown
Collaborator

@arneschmid arneschmid commented Mar 17, 2026

Fixes

This PR adds unsaved-changes protection to the Manage Components and Packs dialog.

If the dialog is closed with pending edits, users now get: Save, Don't Save or Cancel.
If there are no changes, it closes immediately.

It also improves state synchronization/reset on close and includes small UI tweaks for better narrow-width handling.

Changes

  • Added unsaved-changes prompt on dialog close: Save, Discard, Reopen.
  • Prevented silent data loss when closing with pending edits.
  • Refactored current project state sync via centralized getter/setter.
  • Reset transient/cached dialog state on discard/close.
  • Improved reload logic to refresh only when project changes.
  • Added minor responsive UI fixes (horizontal overflow wrapper, Variant column ellipsis).

Screenshots

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

…nhance dispose logic; update ComponentPackManager layout for better responsiveness; adjust ComponentsView variant column for improved display.
… button labels and message detail for clarity.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 09dee17.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

… changes; implement save, discard, and cancel options for user prompts.
@qltysh
Copy link
Copy Markdown

qltysh bot commented Mar 17, 2026

Qlty

Coverage Impact

⬆️ Merging this pull request will increase total coverage on main by 0.02%.

Modified Files with Diff Coverage (2)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
...ws/manage-components-packs/view/components/components-view.tsx100.0%
Coverage rating: A Coverage rating: A
...views/manage-components-packs/components-packs-webview-main.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@arneschmid arneschmid marked this pull request as ready for review March 17, 2026 14:05
@arneschmid arneschmid requested a review from Copilot March 17, 2026 14:05
@arneschmid arneschmid requested a review from mguzmanm March 17, 2026 14:06
Copy link
Copy Markdown
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

Adds unsaved-changes protection to the “Manage Components and Packs” webview so closing the dialog doesn’t silently drop pending edits, and includes a couple of narrow-width UI adjustments.

Changes:

  • Add a modal close prompt when there are pending edits (save / don’t save / cancel-reopen) and reset cached/transient state on discard.
  • Centralize current project synchronization via a getter/setter and adjust reload behavior to avoid heavy reload when the project is unchanged.
  • Minor UI responsiveness tweaks (horizontal overflow wrapper; Variant column truncation intent).

Reviewed changes

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

File Description
src/views/manage-components-packs/view/components/components-view.tsx Tweaks the Variant column configuration to support truncation/ellipsis behavior.
src/views/manage-components-packs/view/components/component-pack-manager.tsx Wraps actions + views in a horizontally scrollable container for narrow layouts.
src/views/manage-components-packs/components-packs-webview-main.ts Implements unsaved-changes protection on dispose, resets view state on discard, and refines reload/dirty-state behavior.
src/views/manage-components-packs/components-packs-webview-main.test.ts Updates and adds unit tests for new reload logic and dispose/unsaved-changes flows.

You can also share your feedback on Copilot code review. Take the survey.

@arneschmid arneschmid marked this pull request as draft March 24, 2026 07:12
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.

[Feature Request]: Prevent data loss when closing Manage Components and Packs with unsaved changes

3 participants