Skip to content

Conversation

@carlosthe19916
Copy link
Collaborator

@carlosthe19916 carlosthe19916 commented Dec 19, 2025

This PR is just a proposal, it needs to be validated with UX and Engineers:

The Package List table contains a column Path and from a personal experience that columns is most of the time empty. It occupies space.

This PR adds the ability to show/hide table columns based on the user preferences. The saved columns will survive even if the user leaves the page because we are using the browser storage.

We are also able to define defaults in regards which columns could be hidden from the beginning, the column path could potentially be hidden as part of the default configuration.

Screencast.From.2025-12-19.07-54-16.mp4

Summary by Sourcery

Add configurable column visibility to the package list table and expose a UI to manage visible columns.

New Features:

  • Allow users to show or hide individual columns in the package list table, with visibility persisted via table column state.
  • Add a toolbar column-management control using PatternFly's ColumnManagementModal to configure which package list columns are visible.

Enhancements:

  • Define initial and default column metadata for the package list, ensuring identity columns remain visible and disabling unused table selection/active-item features.

Build:

  • Add @patternfly/react-component-groups as a client dependency for column management UI components.

Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 19, 2025

Reviewer's Guide

Introduces configurable column visibility for the Package List table, wiring PatternFly's ColumnManagementModal into the toolbar and table controls so users can manage and persist which package columns are shown (e.g., hiding the often-empty path column).

Sequence diagram for managing package list columns

sequenceDiagram
  actor User
  participant PackageToolbar
  participant ManageColumnsToolbar
  participant ColumnManagementModal
  participant TableControls
  participant PackageTable

  User->>PackageToolbar: load package list page
  PackageToolbar->>TableControls: read columnState
  PackageToolbar->>ManageColumnsToolbar: render with columns, defaultColumns, setColumns
  PackageTable->>TableControls: getColumnVisibility(columnKey)
  TableControls-->>PackageTable: visible/hidden flags
  PackageTable->>PackageTable: render visible columns

  User->>ManageColumnsToolbar: click columns button
  ManageColumnsToolbar->>ManageColumnsToolbar: setIsOpen(true)
  ManageColumnsToolbar->>ColumnManagementModal: open with appliedColumns

  User->>ColumnManagementModal: toggle columns, click Apply
  ColumnManagementModal-->>ManageColumnsToolbar: applyColumns(newUiColumns)
  ManageColumnsToolbar->>ManageColumnsToolbar: onApplyColumns(newUiColumns)
  ManageColumnsToolbar->>TableControls: setColumns(newTableColumns)
  TableControls->>TableControls: persist column visibility
  TableControls-->>PackageToolbar: updated columnState
  TableControls-->>PackageTable: updated getColumnVisibility results
  PackageTable->>PackageTable: re-render with new columns
Loading

Class diagram for configurable package list columns

classDiagram
  class PackageTable {
    +ReactFC PackageTable()
    -tableControls
    +render()
  }

  class PackageToolbar {
    +ReactFC PackageToolbar(props)
    -tableControls
    +render()
  }

  class ManageColumnsToolbar~TColumnKey~ {
    +columns ColumnState~TColumnKey~[]
    +defaultColumns ColumnState~TColumnKey~[]
    +setColumns(newColumns ColumnState~TColumnKey~[]) void
    -isOpen boolean
    +onApplyColumns(newUiColumns ColumnManagementModalColumn[]) void
  }

  class ColumnState~TColumnKey~ {
    +id TColumnKey
    +label string
    +isVisible boolean
    +isIdentity boolean
  }

  class TableControls {
    +getColumnVisibility(columnKey string) boolean
    +columnStateColumns ColumnState~string~[]
    +columnStateDefaultColumns ColumnState~string~[]
    +columnStateSetColumns(newColumns ColumnState~string~[]) void
  }

  class PackageSearchProvider {
    +initialColumns map~string, any~
  }

  class ColumnManagementModalColumn {
    +key string
    +title string
    +isShown boolean
    +isShownByDefault boolean
    +isUntoggleable boolean
  }

  PackageTable --> TableControls : uses
  PackageToolbar --> TableControls : uses
  PackageToolbar *-- ManageColumnsToolbar : contains
  ManageColumnsToolbar --> ColumnState : manages
  ManageColumnsToolbar --> ColumnManagementModalColumn : maps to
  TableControls o-- ColumnState : columnState
  PackageSearchProvider --> TableControls : configures
  PackageSearchProvider --> ColumnState : provides initialColumns
Loading

File-Level Changes

Change Details Files
Make table headers and cells in PackageTable conditional on column visibility from tableControls.
  • Destructure getColumnVisibility from tableControls and use it to wrap each
header definition for package attributes.
  • Gate each
  • cell in the body rows behind corresponding getColumnVisibility checks while preserving existing cell content and props.
  • Keep expansion and row control behavior unchanged while integrating visibility checks around existing components like PackageLicenses, PackageQualifiers, and PackageVulnerabilities.
  • client/src/app/pages/package-list/package-table.tsx
    Add a Manage Columns control to the package list toolbar using PatternFly ColumnManagementModal wired to table column state.
    • Extend tableControls destructuring in the toolbar to include columnState.
    • Render a new ManageColumnsToolbar action in the toolbar, passing current, default, and setter for columns from columnState.
    • Ensure pagination and existing filters remain intact alongside the new manage-columns control.
    client/src/app/pages/package-list/package-toolbar.tsx
    client/src/app/components/TableControls/ManageColumnsToolbar.tsx
    Configure table controls for column management and disable selection-related features in the package search context.
    • Provide an initialColumns configuration marking the name column as the identity column so it cannot be hidden by users.
    • Explicitly disable active item and selection features via isActiveItemEnabled and isSelectionEnabled flags in the table controls configuration.
    client/src/app/pages/package-list/package-context.tsx
    Implement ManageColumnsToolbar component using PatternFly component groups and hook it to reusable ColumnState.
    • Create a generic ManageColumnsToolbar component that maps between ColumnState objects and ColumnManagementModalColumn props, including visibility, default visibility, and untoggleable identity columns.
    • Use local state to control the open/close lifecycle of ColumnManagementModal and apply changes back to the table by updating columnState via setColumns.
    • Present the column management entry point as a plain icon button (ColumnsIcon) inside an OverflowMenu for responsive layout in the toolbar.
    client/src/app/components/TableControls/ManageColumnsToolbar.tsx
    Add PatternFly React Component Groups dependency required for ColumnManagementModal.
    • Add @patternfly/react-component-groups to client package.json dependencies and update package-lock accordingly.
    client/package.json
    package-lock.json

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    @codecov
    Copy link

    codecov bot commented Dec 19, 2025

    Codecov Report

    ❌ Patch coverage is 71.87500% with 9 lines in your changes missing coverage. Please review.
    ✅ Project coverage is 62.34%. Comparing base (71a168b) to head (12de051).

    Files with missing lines Patch % Lines
    .../components/TableControls/ManageColumnsToolbar.tsx 46.66% 6 Missing and 2 partials ⚠️
    ...lient/src/app/pages/package-list/package-table.tsx 94.11% 0 Missing and 1 partial ⚠️
    Additional details and impacted files
    @@            Coverage Diff             @@
    ##             main     #855      +/-   ##
    ==========================================
    + Coverage   61.33%   62.34%   +1.00%     
    ==========================================
      Files         172      173       +1     
      Lines        3122     3152      +30     
      Branches      710      728      +18     
    ==========================================
    + Hits         1915     1965      +50     
    + Misses        949      918      -31     
    - Partials      258      269      +11     

    ☔ View full report in Codecov by Sentry.
    📢 Have feedback on the report? Share it here.

    🚀 New features to boost your workflow:
    • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
    • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

    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.

    1 participant