Skip to content

Quick Add Capture(s) to Dataset#259

Open
LLKruczek wants to merge 11 commits intomasterfrom
lk/quick-add-capture
Open

Quick Add Capture(s) to Dataset#259
LLKruczek wants to merge 11 commits intomasterfrom
lk/quick-add-capture

Conversation

@LLKruczek
Copy link
Copy Markdown
Collaborator

No description provided.

@LLKruczek LLKruczek requested a review from lucaspar February 17, 2026 21:00
@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com bot commented Feb 17, 2026

@lucaspar lucaspar added gateway Gateway component styling Special focus on styling of front-end components javascript Pull requests that update non-trivial javascript code labels Feb 17, 2026
@lucaspar lucaspar requested a review from Copilot February 23, 2026 14:21
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

This pull request implements a "Quick Add Capture(s) to Dataset" feature that allows users to add one or multiple captures to a dataset through two workflows: (1) a selection mode in the captures table where users can select multiple captures via checkboxes, and (2) planned support for single-capture quick-add from dropdown menus (though the UI for this is not yet implemented in the templates).

Changes:

  • Added backend API endpoints for quick-adding captures to datasets and retrieving eligible datasets
  • Implemented frontend selection mode with checkbox-based multi-select in the captures table
  • Created a modal interface for selecting the target dataset and confirming the operation
  • Added support for automatic multi-channel capture grouping during addition

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
gateway/sds_gateway/users/views.py Added QuickAddCapturesToDatasetView for adding captures and UserDatasetsForQuickAddView for listing eligible datasets with proper permission checks
gateway/sds_gateway/users/urls.py Registered two new URL patterns for the quick-add API endpoints
gateway/sds_gateway/templates/users/partials/quick_add_to_dataset_modal.html New modal template for dataset selection with accessible form controls
gateway/sds_gateway/templates/users/partials/captures_page_table.html Added selection column with checkboxes (hidden by default, shown in selection mode)
gateway/sds_gateway/templates/users/file_list.html Integrated selection mode buttons and quick-add modal into the file list page
gateway/sds_gateway/static/js/file-list.js Implemented selection mode toggle, checkbox state management, and row click handling
gateway/sds_gateway/static/js/components.js Updated row click handler to ignore clicks on selection checkboxes
gateway/sds_gateway/static/js/actions/QuickAddToDatasetManager.js New manager class handling modal interactions, dataset loading, and API calls for single/multi capture addition
gateway/sds_gateway/static/css/file-list.css Added CSS rules to show/hide selection column based on selection mode state

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

 Changes to be committed:
	modified:   gateway/sds_gateway/static/css/file-list.css
	new file:   gateway/sds_gateway/static/js/actions/QuickAddToDatasetManager.js
	modified:   gateway/sds_gateway/static/js/components.js
	modified:   gateway/sds_gateway/static/js/file-list.js
	modified:   gateway/sds_gateway/templates/users/file_list.html
	modified:   gateway/sds_gateway/templates/users/partials/captures_page_table.html
	new file:   gateway/sds_gateway/templates/users/partials/quick_add_to_dataset_modal.html
	modified:   gateway/sds_gateway/users/urls.py
	modified:   gateway/sds_gateway/users/views.py

 Changes to be committed:
	modified:   gateway/sds_gateway/static/css/file-list.css
	new file:   gateway/sds_gateway/static/js/actions/QuickAddToDatasetManager.js
	modified:   gateway/sds_gateway/static/js/components.js
	modified:   gateway/sds_gateway/static/js/file-list.js
	modified:   gateway/sds_gateway/templates/users/file_list.html
	modified:   gateway/sds_gateway/templates/users/partials/captures_page_table.html
	new file:   gateway/sds_gateway/templates/users/partials/quick_add_to_dataset_modal.html
	modified:   gateway/sds_gateway/users/urls.py
	modified:   gateway/sds_gateway/users/views.py
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3228 to +3252
owned = (
user.datasets.filter(is_deleted=False, is_public=False)
.order_by("name")
.values("uuid", "name")
)
shared_uuids = list(
UserSharePermission.objects.filter(
shared_with=user,
item_type=ItemType.DATASET,
is_deleted=False,
is_enabled=True,
permission_level__in=[
PermissionLevel.CO_OWNER,
PermissionLevel.CONTRIBUTOR,
],
).values_list("item_uuid", flat=True)
)
shared = (
Dataset.objects.filter(
uuid__in=shared_uuids, is_deleted=False, is_public=False
)
.exclude(owner=user)
.order_by("name")
.values("uuid", "name")
)
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This dataset list is intended to populate the quick-add modal with datasets the user can actually add captures to. Right now it filters out deleted/public datasets but does not filter out status == DatasetStatus.FINAL, so published datasets can appear in the dropdown and then fail later with 403 when selected. Filter these querysets to exclude FINAL datasets (consistent with _get_dataset_editable_by_user).

Copilot uses AI. Check for mistakes.
Comment on lines +409 to +417
<!-- Captures Table -->
{% include "users/partials/captures_page_table.html" %}
</main>
</div>
</div>
<!-- Capture Details Modal -->
{% include "users/partials/capture_modal.html" %}
<!-- Quick Add to Dataset Modal (single or multiple captures) -->
{% include "users/partials/quick_add_to_dataset_modal.html" %}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The captures table still renders Share actions targeting #shareModal-<uuid>, but this page no longer includes the per-capture share_modal.html instances (previously rendered in a loop). That will make the Share button a no-op / open nothing. Re-add the share modal includes for each capture on the page, or change the Share UI to target a single generic modal that exists in the DOM.

Copilot uses AI. Check for mistakes.
Comment on lines 414 to +420
<!-- Capture Details Modal -->
{% include "users/partials/capture_modal.html" %}
<!-- Quick Add to Dataset Modal (single or multiple captures) -->
{% include "users/partials/quick_add_to_dataset_modal.html" %}
<!-- Visualization Selection Modal -->
{% if VISUALIZATIONS_ENABLED %}
{% include "visualizations/partials/visualization_modal.html" with visualization_compatibility=visualization_compatibility %}
{% endif %}
{% endblock content %}
{% include "visualizations/partials/visualization_modal.html" with visualization_compatibility=visualization_compatibility %}
<!-- Web Download Modal -->
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

capture_modal.html already conditionally includes visualizations/partials/visualization_modal.html when VISUALIZATIONS_ENABLED is true. This template now includes the visualization modal unconditionally as well, which can produce duplicate modal IDs (and breaks the feature flag behavior when visualizations are disabled). Keep the inclusion behind the same VISUALIZATIONS_ENABLED guard and ensure the modal is included only once.

Copilot uses AI. Check for mistakes.
lucaspar and others added 4 commits March 31, 2026 11:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway component javascript Pull requests that update non-trivial javascript code styling Special focus on styling of front-end components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants