Skip to content

Conversation

@itisAliRH
Copy link
Member

@itisAliRH itisAliRH commented Jan 21, 2026

This PR introduces the first iteration of GTable component as the first step toward replacing Bootstrap Vue's BTable across the UI. The Dataset List serves as the first migration target, demonstrating the component's capabilities.

Ref: #20787 #21338

Before After
Screenshot 2026-01-29 at 13 01 15 image

Show/hide columns

image

What's New

GTable Component

  • Generic Vue3 component with full TypeScript support (generic="T"), item types flow through to all slots and event payloads.
  • Declarative column definitions via TableField[] with sorting, alignment, width, and responsive visibility (hideOnSmall)
  • Built-in row selection with select-all/indeterminate state
  • Per-row actions dropdown configured via TableAction[] (label, icon, handler, visibility, disabled state, routing)
  • Optional Row status icons rendered inline in the first data column via a statusIcon function prop
  • Two distinct loading states: initial load, and overlay (sort/filter)
  • Sticky column headers and scoped slots for custom cell/header rendering

ListHeader Enhancements

  • Configurable sort options via sortOptions prop
  • Column visibility dropdown with reset option

Dataset List Migration

  • Migrated from BTable to GTable with server-side sorting and pagination
  • Dataset state icons (ok, error, deleted, purged, running, etc.) shown per row
  • Breadcrumb navigation, bulk delete with confirmation dialog, toast notifications
  • Row actions extracted into useDatasetTableActions composable (copy, show in history, delete, purge)
  • New loadDatasets API helper with pagination, sorting, and search support

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. Navigate to Datasets from activity bar

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

Introduces a new reusable table component that extends BTable with:
- Loading state with customizable message
- Empty state with customizable message and variant
- Type definitions for props and events
- Proper TypeScript interfaces for type safety
Updates DatasetList component to use the new GTable component:
- Replace BTable with GTable for consistent loading/empty states
- Remove LoadingSpan and BAlert components in favor of GTable states
- Add explicit field labels to table configuration
- Pass loading state and messages as props to GTable
- Simplify template by removing duplicate state handling
Make ListHeader more flexible by accepting dynamic sort and column
options via props. Add dropdown support for column visibility, emit
events for sort and column changes, and keep default sort behavior for
backward compatibility.
Introduce separate loading states for table interactions and pagination. Add support for an overlay loader during sorting/filtering and a bottom "load more" indicator for infinite scroll or pagination, using BOverlay and new configurable props and messages to improve UX clarity.
Refactors dataset deletion to support both soft delete and purge
via a configurable deleteDataset function. Keeps purgeDataset as a
wrapper for backward compatibility while enabling non-purge deletes
through the same API call.
Enhance the dataset list with selectable rows, single and bulk delete functionality, and a confirmation modal. Introduce a configurable list header with column visibility, contextual actions, loading states, and improved feedback to make dataset management clearer and more efficient.
Refactor GTable layout to rely on Bootstrap utility classes instead of
custom CSS, simplifying markup and styles while preserving behavior.
Remove unused container and wrapper styles, adjust table classes for
full-width rendering, and clean up selection header markup.

Also clean up DatasetList by removing an unused ListHeader ref and
adding DelayedInput for improved dataset search handling.
Update GTable to use explicit slots and props for actions and selection,
removing the legacy actions toolbar and scoped slot checks. Introduce a
dedicated head-select slot, adjust actions header naming, and clarify row
selection tooltip text to better support bulk
Refactor the dataset list to use GTable’s actions API instead of a custom dropdown, adding copy, show, and delete actions with icons. Make dataset names clickable links to show them in the history panel and simplify footer styling for better consistency and usability.
Add size, routing, and link-related properties to TableAction and update the handler signature to receive item and index. This enables richer
actions (navigation, external links, sizing) and provides more context to action handlers, at the cost of a breaking type change.
Deletes the DatasetName Vue component and its associated test file as they are no longer used in the codebase.
Refactor GTable local sorting to use clearer sortBy/sortDesc
state with sensible defaults. Simplify the sort-changed event
signature to emit primitive values instead of an object, and
update all sorting logic and UI bindings to align with the new
state for more predictable behavior.
Clean up unused sorting logic by removing header sort options and
consolidating sort handling, simplifying the component API. Also fix
a bug where `query` was treated as a plain value instead of a ref to
ensure empty-state logic works correctly.
Remove the unused `noSortReset` prop and `SortChangeEvent` import, and standardize JSDoc-style comments across GTable props and emits to improve clarity and maintainability without changing runtime behavior.
Reorder and group GTable props and default values for better clarity and consistency without changing behavior. Improves readability and maintainability of the component’s public API.
Removes the internal computed sorting logic and replaces it with a
simple localItems reference to props.items. This ensures the table
renders data in the order provided by the parent, avoiding duplicate
or conflicting sorting when sorting is handled externally (e.g.
server-side or higher-level components).
Reorganized reactive refs and moved the `fields` computed property
after its dependencies to improve readability and avoid referencing
state before declaration. Also removed redundant inline comments to
clean up the component logic.
Creates a reusable composable that encapsulates all dataset table operations, including copying, displaying, deleting, and purging datasets.

This extraction improves code organization by centralizing dataset manipulation logic and makes it easier to share these actions across different components. The composable handles user confirmations, error messaging, and history store updates consistently.
Move dataset table action definitions and handlers into a dedicated
useDatasetTableActions composable. This simplifies DatasetList.vue,
removes unused imports and state, and improves reuse and maintainability
of table action logic.
Introduces a breadcrumb heading component to the dataset list page for improved navigation and user orientation.
Introduce built-in select-all support in GTable with proper disabled,
indeterminate, and all-selected states, and emit a new select-all event
for bulk actions.
Update the header slot to render a default checkbox when enabled.
Also refresh the row actions menu by switching to an ellipsis icon and larger trigger size, and remove redundant show-select-all usage from DatasetList.
Introduce a new loadDatasets API helper that supports pagination, sorting, and text search.
The helper returns summarized dataset records along with a total match count parsed from response headers, enabling more efficient dataset listing and UI pagination.
Replace infinite scroll with pagination using BPagination and a dedicated loadDatasets API. Track total dataset count, adjust page size, reset selections on query/sort changes, and simplify loading state handling for clearer UX and maintainable data fetching.
Refactor dataset bulk deletion to use the shared confirm dialog
composable instead of a dedicated modal. This simplifies state
management, removes unused modal-related logic, and provides a
consistent confirmation UX while keeping deletion feedback and
error handling intact.
Remove local alert state and error handler in DatasetList and use Toast
notifications instead to surface load, history switch, and tag update
errors consistently across the UI.
Update the list header column selector to use a cog icon button
without a caret, and group options under a clear header. This
creates a cleaner, more compact UI and improves clarity when
showing or hiding columns.
Introduce a RowIcon interface to support configurable row status icons, including size, tooltip, and loading state. Remove the unused TableField `html` flag.
Introduce a `statusIcon` prop to render an inline FontAwesome icon
in the first data column of each row.
Display contextual status icons for datasets (purged, deleted,
successful, or in-progress) in the dataset list. This improves visual
feedback and makes it easier for users to quickly understand dataset
state at a glance.
Remove the clickable dataset name that applied history filters and
clean up unused history store imports and logic.
Pass a refresh callback into useDatasetTableActions and invoke it
after copy, delete, or purge operations so the dataset list stays
in sync with backend changes and reflects updates immediately.
Update the history switch link text to better explain that it switches to the selected history and displays the dataset, improving clarity for users who own the history.
Adjust sort option handling to reliably fall back to the default
sort when no custom options are provided. This prevents undefined
initial sort values and ensures consistent list behavior.
Adds a reset columns control to the list header dropdown that appears when any column is hidden. This allows users to quickly restore the default column visibility, improving usability when managing column settings.
Add an `onResetColumns` handler to restore all dataset columns
to their default visibility and wire it to the table’s
`reset-columns` event, allowing users to quickly revert column
customizations.
Update the first-column v-if condition to call getStatusIcon(item, index)
directly instead of relying on a shared statusIcon value, ensuring the
correct icon is evaluated and rendered for each row.
Update SwitchToHistoryLink tests to reflect the new tooltip
label "Switch to history and view dataset" when switching
histories with filters applied, ensuring assertions match
current UI behavior and intent.
Update Selenium test selectors to use correct selectors, ensuring tests correctly locate and interact with sort
controls after label changes.
@itisAliRH itisAliRH force-pushed the init-g-table-component branch from 340c9c1 to 5b74186 Compare January 28, 2026 22:48
@itisAliRH itisAliRH marked this pull request as ready for review January 29, 2026 11:55
@itisAliRH itisAliRH changed the title [WIP] Introduce reusable GTable component Introduce reusable GTable component Jan 29, 2026
@github-actions github-actions bot added this to the 26.1 milestone Jan 29, 2026
Copy link
Contributor

@davelopez davelopez left a comment

Choose a reason for hiding this comment

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

I love it! It works pretty well on my local testing, and I'm looking forward to using it instead of BTable.

@davelopez
Copy link
Contributor

I'll get this in so we can start replacing other existing tables and see what other features we need to support for GTable.
Thanks a lot!

I will also follow up with the small refactoring mentioned here #21635 (comment)

@davelopez davelopez merged commit 7b9d086 into galaxyproject:dev Jan 30, 2026
45 checks passed
@itisAliRH
Copy link
Member Author

I'll get this in so we can start replacing other existing tables and see what other features we need to support for GTable.

Thanks a lot!

I will also follow up with the small refactoring mentioned here #21635 (comment)

@davelopez, thanks! I’ve approved the refactor PR✌🏻

@itisAliRH itisAliRH deleted the init-g-table-component branch January 30, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants