-
-
Notifications
You must be signed in to change notification settings - Fork 445
Improve Program plugin delete button logic #3539
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
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 refactors the delete button logic for program sources in the Flow launcher plugin by separating the deletion action for non-auto-loaded (user-added) sources from the auto-loaded ones.
- Adds a new hidden/shown delete button in the view to support deletion of non-auto-loaded program sources.
- Implements a new async event handler to ensure that only user-added sources can be deleted along with UI refresh and reindexing operations.
- Updates language resources to include a new translation key for non-user added sources.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs | Adds new deletion logic, updates visibility handling, and refactors message handling. |
Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml | Adds a new button for deletion. |
Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml | Adds new translation string for invalid deletion attempts. |
Comments suppressed due to low confidence (1)
Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs:422
- [nitpick] The variables 'msg1' and 'msg2' used for storing messages are ambiguous; consider renaming them to more descriptive names (e.g., nonUserDeleteMsg and confirmDeleteMsg) to enhance clarity.
if (!IsAllItemsUserAdded(selectedItems))
🥷 Code experts: onesounds, jjw24 Jack251970, onesounds have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
This comment has been minimized.
This comment has been minimized.
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughA "Delete" button for program sources was added to the Programs plugin settings UI. Supporting logic was implemented to allow deletion of user-added program sources, including validation, user confirmation, and UI refresh. Two English resource strings for relevant prompts were also introduced. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ProgramSetting (UI)
participant ProgramSourceCollection
participant MessageBox
User->>ProgramSetting: Clicks "Delete" button
ProgramSetting->>ProgramSourceCollection: Validate selection (user-added only)
alt Not all selected are user-added
ProgramSetting->>MessageBox: Show "Please select program sources that are added by you."
else All selected are user-added
ProgramSetting->>MessageBox: Show confirmation dialog
alt User confirms
ProgramSetting->>ProgramSourceCollection: Remove selected sources
ProgramSetting->>ProgramSetting: Refresh view, clear selection
else User cancels
ProgramSetting->>ProgramSetting: Do nothing
end
end
Assessment against linked issues
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
@cibere As shown above, firstly you need to add one custom program source, and then select it before deleting it. |
Improve Program plugin delete button logic
Originally, Flow only uses three buttons: Enable/Disable/Delete, Edit, Add which can cause confusion.
Now Flow uses four buttons for program source management: Enable/Disable, Edit, Delete, Add.
I think it can help users know our logic as follows. And if we use buttons for wrong actions, Flow will notify users with message box.
Note:
D:\Test
. They will not be loaded automatically so users need to add and delete them manually.Resolve #3196.
Test
2025-05-14.13-50-41.mp4