Skip to content

feat: delete repos from collections IN-1118#1902

Closed
gaspergrom wants to merge 1 commit into
mainfrom
feat/IN-1118-delete-repos-from-collections
Closed

feat: delete repos from collections IN-1118#1902
gaspergrom wants to merge 1 commit into
mainfrom
feat/IN-1118-delete-repos-from-collections

Conversation

@gaspergrom
Copy link
Copy Markdown
Collaborator

Summary

  • Add ability to remove repositories from community collections directly from the collection detail page
  • Collection owners see an × button on hover for each repo row (desktop) or inline on mobile
  • Clicking triggers a confirm dialog, then calls the existing PUT /api/collection/community/:id endpoint with the filtered repositoryUrls array
  • Added repositoryUrls?: string[] to the Collection TypeScript type (was already returned by the API but untyped)

Changes

  • frontend/types/collection.ts — added repositoryUrls field to Collection interface
  • frontend/app/components/modules/collection/components/details/collection-project-item.vue — new canRemove / isRemoving props; remove button shown for type === 'repo' items only
  • frontend/app/components/modules/collection/views/collection-details.vueisOwner computed, handleRemoveRepo with confirm dialog + API call, conditional table header column

@gaspergrom gaspergrom self-assigned this May 13, 2026
Copilot AI review requested due to automatic review settings May 13, 2026 08:41
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 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 repositoryUrls to the Collection TypeScript type to match API responses.
  • Adds remove controls and state (canRemove, isRemoving, remove event) to collection project list items (desktop + mobile).
  • Implements owner-only remove flow in the collection details view (confirm modal + PUT /api/collection/community/:id with filtered repositoryUrls), 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: LfxIconButton is a <div> and disabled doesn’t prevent clicks, so @click.stop can still emit remove while isRemoving is 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);
@gaspergrom gaspergrom force-pushed the feat/IN-1118-delete-repos-from-collections branch from eb67da4 to 8604f5a Compare May 13, 2026 09:33
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
@gaspergrom gaspergrom force-pushed the feat/IN-1118-delete-repos-from-collections branch from 8604f5a to 9ea38b2 Compare May 13, 2026 10:00
@gaspergrom gaspergrom closed this May 15, 2026
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.

2 participants