-
Notifications
You must be signed in to change notification settings - Fork 5
Allow removal and adding for plugins in iconMenu #861
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
Open
oeninghe-dataport
wants to merge
19
commits into
next
Choose a base branch
from
fix/668-iconMenu-plugin-removal
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e14ded9
feat(iconMenu): `menus` should be mutable
oeninghe-dataport 8f36876
test(snowbox): allow removal and live insertion of iconMenu plugins
oeninghe-dataport 4888d29
fix(filter): reset filter state on plugin removal
oeninghe-dataport 866b395
Merge branch 'next' into fix/668-iconMenu-plugin-removal
oeninghe-dataport d7e23ae
refactor(iconMenu): extract lib function watchArray
oeninghe-dataport b47d6cf
feat(iconMenu): allow adding and removal of plugins
oeninghe-dataport 28a8ef6
refactor(iconMenu): replace watcher with explicit mutations
oeninghe-dataport bb128d2
test(snowbox): adapt new iconMenu modification
oeninghe-dataport 1d136e7
refactor(iconMenu): replace open/focusOpen watcher with mutations
oeninghe-dataport fe13760
fix: remove unused watchArray lib function
oeninghe-dataport d2b0008
refactor(iconMenu): simplify store action calls
oeninghe-dataport ee8f935
docs(iconMenu): fix maturity
oeninghe-dataport 962aa61
docs(iconMenu): fix maturity
oeninghe-dataport 441b0be
docs(iconMenu): fix maturity
oeninghe-dataport 42c1204
docs(iconMenu): fix maturity
oeninghe-dataport b6d0d30
docs(iconMenu): fix maturity
oeninghe-dataport 7b57647
fix(iconMenu): use `toRaw`, better safe than sorry
oeninghe-dataport b44a099
Merge branch 'next' into fix/668-iconMenu-plugin-removal
oeninghe-dataport 7bbdec2
perf: reduce store calls when plugin is removed
oeninghe-dataport File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ import type { | |
| import { toMerged } from 'es-toolkit' | ||
| import i18next from 'i18next' | ||
| import { acceptHMRUpdate, defineStore } from 'pinia' | ||
| import { markRaw, reactive } from 'vue' | ||
| import { markRaw, reactive, readonly } from 'vue' | ||
|
|
||
| import { useMainStore } from './main' | ||
|
|
||
|
|
@@ -67,20 +67,17 @@ export const usePluginStore = defineStore('plugin', () => { | |
| plugins.splice(pluginIndex, 1) | ||
| } | ||
|
|
||
| function getPluginStore<T extends PluginId>( | ||
| function getPluginStore<T extends BundledPluginId>( | ||
| id: T | ||
| ): ReturnType< | ||
| T extends BundledPluginId | ||
| ? BundledPluginStores<typeof id> | ||
| : PolarPluginStore | ||
| > | null { | ||
| ): ReturnType<BundledPluginStores<T>> | null | ||
| function getPluginStore(id: PluginId): ReturnType<PolarPluginStore> | null | ||
| function getPluginStore(id: PluginId): unknown { | ||
| const plugin = plugins.find((plugin) => plugin.id === id) | ||
| // @ts-expect-error | We trust that our internal IDs work. | ||
| return plugin?.storeModule?.(mainStore._instance) || null | ||
| } | ||
|
|
||
| return { | ||
| plugins, | ||
| plugins: readonly(plugins) as readonly PluginContainer[], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the same as using a |
||
| addPlugin, | ||
| removePlugin, | ||
| getPluginStore, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Wasn't it the intention of the function to also be able to retrieve the store of custom plugins with this function?