feat: delete repos from collections IN-1118#1902
Closed
gaspergrom wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds UI support for collection owners to remove repositories from a community collection directly from the collection detail page, by confirming the action and updating the collection via the existing community collection update endpoint.
Changes:
- Adds
repositoryUrlsto theCollectionTypeScript type to match API responses. - Adds remove controls and state (
canRemove,isRemoving,removeevent) to collection project list items (desktop + mobile). - Implements owner-only remove flow in the collection details view (confirm modal +
PUT /api/collection/community/:idwith filteredrepositoryUrls), plus conditional table column.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| frontend/types/collection.ts | Types repositoryUrls on Collection to align frontend typing with API payload/response. |
| frontend/app/components/modules/collection/views/collection-details.vue | Determines ownership, wires remove event, confirmation, and update call; adds owner-only table column. |
| frontend/app/components/modules/collection/components/details/collection-project-item.vue | Adds remove button UI and emits remove for repo items; shows spinner state while removing. |
Comments suppressed due to low confidence (2)
frontend/app/components/modules/collection/components/details/collection-project-item.vue:168
- Same issue on mobile:
LfxIconButtonis a<div>anddisableddoesn’t prevent clicks, so@click.stopcan still emitremovewhileisRemovingis true. Guard the handler (or ensure the disabled state disables pointer events) to prevent duplicate requests.
props.isRemoving ? 'animate-spin' : 'hover:!text-negative-500',
]"
:disabled="props.isRemoving"
@click.stop="emit('remove', props.project.repoUrl)"
/>
frontend/app/components/modules/collection/components/details/collection-project-item.vue:162
- Same accessibility issue on mobile: the icon-only remove button needs an accessible label (e.g.,
aria-label="Remove repository from collection").
<lfx-icon-button
v-if="props.canRemove && props.project.type === 'repo'"
:icon="props.isRemoving ? 'spinner-third' : 'xmark'"
size="small"
type="transparent"
:class="[
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+128
to
+131
| props.isRemoving ? 'animate-spin' : 'hover:!text-negative-500', | ||
| ]" | ||
| :disabled="props.isRemoving" | ||
| @click="emit('remove', props.project.repoUrl)" |
| v-if="props.project.type === 'repo'" | ||
| :icon="props.isRemoving ? 'spinner-third' : 'xmark'" | ||
| size="small" | ||
| type="transparent" |
Comment on lines
+285
to
+289
| const removingRepoUrl = ref<string | null>(null); | ||
|
|
||
| const handleRemoveRepo = async (repoUrl: string) => { | ||
| const confirmed = await openConfirmModal({ | ||
| title: 'Remove repository', |
| name: currentCollection.value.name, | ||
| repositoryUrls: updatedUrls, | ||
| }); | ||
| handleCollectionUpdated(updated); |
eb67da4 to
8604f5a
Compare
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
8604f5a to
9ea38b2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
×button on hover for each repo row (desktop) or inline on mobilePUT /api/collection/community/:idendpoint with the filteredrepositoryUrlsarrayrepositoryUrls?: string[]to theCollectionTypeScript type (was already returned by the API but untyped)Changes
frontend/types/collection.ts— addedrepositoryUrlsfield toCollectioninterfacefrontend/app/components/modules/collection/components/details/collection-project-item.vue— newcanRemove/isRemovingprops; remove button shown fortype === 'repo'items onlyfrontend/app/components/modules/collection/views/collection-details.vue—isOwnercomputed,handleRemoveRepowith confirm dialog + API call, conditional table header column