Skip to content

Add AddOrRemoveAllButton to BundleSearchResult - #2050

Open
TakshPatel5821 wants to merge 1 commit into
aws:mainfrom
TakshPatel5821:patch-1
Open

Add AddOrRemoveAllButton to BundleSearchResult#2050
TakshPatel5821 wants to merge 1 commit into
aws:mainfrom
TakshPatel5821:patch-1

Conversation

@TakshPatel5821

Copy link
Copy Markdown

Description

Adds an "add all / remove all" button to bundle search results, so a bundle containing multiple graphable entities (vertices and/or edges, including nested bundles) can be added to or removed from the graph in one click, instead of adding each entity individually.

This follows the same pattern already used elsewhere in the search sidebar:

  • SearchResultsList's top-level AddAllToGraphButton (bulk add/remove across all results)
  • VertexSearchResult / EdgeSearchResult's per-entity AddOrRemoveButton

The new AddOrRemoveAllButton:

  • Is hidden when the bundle has no graphable entities.
  • Shows an add icon when any entity in the bundle isn't yet in the graph; clicking adds the rest (already-added entities are left alone).
  • Shows a remove icon once every entity in the bundle has been added; clicking removes all of them.
  • Uses getAllGraphableEntities (not getAllGraphableEntityIds) since bundle.values is PatchedResultEntity[], which has different entityType values (patched-vertex/patched-edge) than the raw ResultEntity[] the id-only helper expects.

Validation

  • tsc --noEmit passes with no errors.
  • oxfmt --check passes on the changed file.
  • Existing tests in connector/entities/entities.test.ts (covering getAllGraphableEntities) still pass.
  • Manually reviewed against the existing AddAllToGraphButton / AddOrRemoveButton patterns for consistency (icon-only ghost button, stopPropagation on click so it doesn't toggle the collapsible, size="icon-small", tooltip text).

Related Issues

Fixes #1221

Adds a bulk add/remove button to bundle search results, matching the pattern used for individual vertex/edge results and the top-level "add all" button. Fixes aws#1221.
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.

Add all button for bundle results

1 participant