Skip to content

feat: add "Installed" filter to Roo Marketplace #7007

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
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/i18n/locales/ca/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/de/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/en/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
"noResults": "No tags found.",
"selected": "Showing items with any of the selected tags"
},
"installed": {
"label": "Show installed only",
"description": "Showing only installed items"
},
"title": "Marketplace"
},
"done": "Done",
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/es/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/fr/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/hi/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/id/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/it/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ja/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ko/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/nl/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/pl/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/pt-BR/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ru/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/tr/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/vi/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/zh-CN/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/zh-TW/marketplace.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 34 additions & 1 deletion webview-ui/src/components/marketplace/MarketplaceListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ export function MarketplaceListView({ stateManager, allTags, filteredTags, filte
const allItems = state.displayItems || []
const organizationMcps = state.displayOrganizationMcps || []

// Update state manager with installed metadata when it changes
React.useEffect(() => {
if (marketplaceInstalledMetadata && state.installedMetadata !== marketplaceInstalledMetadata) {
// Update the state manager's installed metadata
manager.transition({
type: "UPDATE_FILTERS",
payload: { filters: state.filters },
})
}
}, [marketplaceInstalledMetadata, state.installedMetadata, state.filters, manager])
Copy link
Author

Choose a reason for hiding this comment

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

Is this useEffect intentional? It seems redundant since the state manager already handles installedMetadata updates through the handleMessage method. This could cause unnecessary re-renders and state updates when the metadata changes.


// Filter items by type if specified
const items = filterByType ? allItems.filter((item) => item.type === filterByType) : allItems
const orgMcps = filterByType === "mcp" ? organizationMcps : []
Expand Down Expand Up @@ -55,6 +66,28 @@ export function MarketplaceListView({ stateManager, allTags, filteredTags, filte
}
/>
</div>
{/* Installed filter toggle */}
<div className="mt-2 flex items-center gap-2">
<label className="flex items-center gap-2 cursor-pointer">
<input
type="checkbox"
className="rounded border-vscode-input-border"
Copy link
Author

Choose a reason for hiding this comment

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

Could we add proper ARIA labels here for better accessibility? Screen reader users might have difficulty understanding the purpose of this checkbox without proper labeling.

Suggested change
className="rounded border-vscode-input-border"
<input
type="checkbox"
className="rounded border-vscode-input-border"
checked={state.filters.installed}
aria-label="Show installed items only"
onChange={(e) =>

checked={state.filters.installed}
onChange={(e) =>
manager.transition({
type: "UPDATE_FILTERS",
payload: { filters: { installed: e.target.checked } },
})
}
/>
<span className="text-sm">{t("marketplace:filters.installed.label")}</span>
</label>
{state.filters.installed && (
<span className="text-xs text-vscode-descriptionForeground">
({t("marketplace:filters.installed.description")})
</span>
)}
</div>
{allTags.length > 0 && (
<div className="mt-2">
<div className="flex items-center justify-between mb-1">
Expand Down Expand Up @@ -187,7 +220,7 @@ export function MarketplaceListView({ stateManager, allTags, filteredTags, filte
onClick={() =>
manager.transition({
type: "UPDATE_FILTERS",
payload: { filters: { search: "", type: "", tags: [] } },
payload: { filters: { search: "", type: "", tags: [], installed: false } },
})
}
className="mt-4 bg-vscode-button-secondaryBackground text-vscode-button-secondaryForeground hover:bg-vscode-button-secondaryHoverBackground transition-colors">
Expand Down
Loading
Loading