You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2026/04/24 12:42:39 UTC

(streampipes) branch dev updated: Fix for 4373 make table chart header sticky (#4410)

This is an automated email from the ASF dual-hosted git repository.

tenthe pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new ce9b9ec633 Fix for 4373 make table chart header sticky (#4410)
ce9b9ec633 is described below

commit ce9b9ec633d56f8d880c53b477922680b5772564
Author: Jacqueline Höllig <78...@users.noreply.github.com>
AuthorDate: Fri Apr 24 14:42:33 2026 +0200

    Fix for 4373 make table chart header sticky (#4410)
---
 .../charts/table/config/table-widget-config.component.html     | 10 ++++++++++
 .../charts/table/config/table-widget-config.component.ts       |  7 +++++++
 .../components/charts/table/model/table-widget.model.ts        |  1 +
 .../components/charts/table/table-widget.component.html        | 10 +++++++++-
 .../components/charts/table/table-widget.component.scss        |  8 +++-----
 .../components/charts/table/table-widget.component.ts          |  1 +
 .../data-settings/chart-data-settings.component.ts             |  1 +
 7 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/ui/src/app/chart-shared/components/charts/table/config/table-widget-config.component.html b/ui/src/app/chart-shared/components/charts/table/config/table-widget-config.component.html
index abed075a07..ac7cc13f4c 100644
--- a/ui/src/app/chart-shared/components/charts/table/config/table-widget-config.component.html
+++ b/ui/src/app/chart-shared/components/charts/table/config/table-widget-config.component.html
@@ -60,6 +60,16 @@
                 </mat-select>
             </mat-form-field>
         </sp-form-field>
+        <sp-form-field [level]="3" [label]="'Sticky headers' | translate">
+            <mat-checkbox
+                [checked]="
+                    currentlyConfiguredWidget.visualizationConfig.stickyHeaders
+                "
+                (change)="setStickyHeaders($event.checked)"
+            >
+                {{ 'Keep table header visible while scrolling' | translate }}
+            </mat-checkbox>
+        </sp-form-field>
     </sp-split-section>
     <sp-split-section [level]="3" [title]="'Value Highlighting' | translate">
         <div fxLayout="column" class="highlight-color-list">
diff --git a/ui/src/app/chart-shared/components/charts/table/config/table-widget-config.component.ts b/ui/src/app/chart-shared/components/charts/table/config/table-widget-config.component.ts
index 832f9e0411..5e9ec16114 100644
--- a/ui/src/app/chart-shared/components/charts/table/config/table-widget-config.component.ts
+++ b/ui/src/app/chart-shared/components/charts/table/config/table-widget-config.component.ts
@@ -102,6 +102,12 @@ export class TableWidgetConfigComponent extends BaseWidgetConfig<
         this.triggerViewRefresh();
     }
 
+    setStickyHeaders(stickyHeaders: boolean): void {
+        this.currentlyConfiguredWidget.visualizationConfig.stickyHeaders =
+            stickyHeaders;
+        this.triggerViewRefresh();
+    }
+
     colorKey(field: DataExplorerField): string {
         return `${field.fullDbName}:${field.sourceIndex}`;
     }
@@ -181,6 +187,7 @@ export class TableWidgetConfigComponent extends BaseWidgetConfig<
         config.highlightedColumnColors ??= {};
         this.syncHighlightColorMap();
         config.pageSize ??= 20;
+        config.stickyHeaders ??= true;
         config.searchValue ??= '';
     }
 
diff --git a/ui/src/app/chart-shared/components/charts/table/model/table-widget.model.ts b/ui/src/app/chart-shared/components/charts/table/model/table-widget.model.ts
index 1b7372bc6e..a51d0e4881 100644
--- a/ui/src/app/chart-shared/components/charts/table/model/table-widget.model.ts
+++ b/ui/src/app/chart-shared/components/charts/table/model/table-widget.model.ts
@@ -28,6 +28,7 @@ export interface TableVisConfig extends DataExplorerVisConfig {
     highlightedColumns?: DataExplorerField[];
     highlightedColumnColors?: Record<string, string>;
     pageSize?: number;
+    stickyHeaders?: boolean;
     searchValue: string;
 }
 
diff --git a/ui/src/app/chart-shared/components/charts/table/table-widget.component.html b/ui/src/app/chart-shared/components/charts/table/table-widget.component.html
index 346f3119e1..397691eba9 100644
--- a/ui/src/app/chart-shared/components/charts/table/table-widget.component.html
+++ b/ui/src/app/chart-shared/components/charts/table/table-widget.component.html
@@ -42,7 +42,15 @@
     @if (showData) {
         <div class="analytics-table-shell" fxLayout="column" fxFlex>
             <div class="analytics-table-scroll" fxFlex>
-                <table data-cy="data-explorer-table" class="analytics-table">
+                <table
+                    data-cy="data-explorer-table"
+                    class="analytics-table"
+                    [ngClass]="{
+                        'sticky-headers':
+                            dataExplorerWidget.visualizationConfig
+                                .stickyHeaders,
+                    }"
+                >
                     <thead>
                         <tr>
                             @for (
diff --git a/ui/src/app/chart-shared/components/charts/table/table-widget.component.scss b/ui/src/app/chart-shared/components/charts/table/table-widget.component.scss
index f26d8b33bb..872efec123 100644
--- a/ui/src/app/chart-shared/components/charts/table/table-widget.component.scss
+++ b/ui/src/app/chart-shared/components/charts/table/table-widget.component.scss
@@ -53,20 +53,18 @@
     overflow: visible;
 }
 
-.analytics-table .time-column {
+.analytics-table.sticky-headers th {
     position: sticky;
-    left: 0;
+    top: 0;
+    z-index: 3;
 }
 
 .analytics-table th.time-column {
-    z-index: 4;
     min-width: 11rem;
 }
 
 .analytics-table td.time-column {
-    z-index: 1;
     min-width: 11rem;
-    background: var(--color-bg-0);
 }
 
 .analytics-table tbody tr:nth-child(even) td {
diff --git a/ui/src/app/chart-shared/components/charts/table/table-widget.component.ts b/ui/src/app/chart-shared/components/charts/table/table-widget.component.ts
index 037733a333..6f8f467dbb 100644
--- a/ui/src/app/chart-shared/components/charts/table/table-widget.component.ts
+++ b/ui/src/app/chart-shared/components/charts/table/table-widget.component.ts
@@ -847,6 +847,7 @@ export class TableWidgetComponent extends BaseDataExplorerWidgetDirective<TableW
             {};
         this.dataExplorerWidget.visualizationConfig.pageSize ??=
             TableWidgetComponent.DEFAULT_PAGE_SIZE;
+        this.dataExplorerWidget.visualizationConfig.stickyHeaders ??= true;
 
         this.pageSize = this.pageSizeOptions.includes(
             this.dataExplorerWidget.visualizationConfig.pageSize,
diff --git a/ui/src/app/chart/components/chart-view/designer-panel/data-settings/chart-data-settings.component.ts b/ui/src/app/chart/components/chart-view/designer-panel/data-settings/chart-data-settings.component.ts
index 3dbe619bef..478d92561b 100644
--- a/ui/src/app/chart/components/chart-view/designer-panel/data-settings/chart-data-settings.component.ts
+++ b/ui/src/app/chart/components/chart-view/designer-panel/data-settings/chart-data-settings.component.ts
@@ -235,6 +235,7 @@ export class ChartDataSettingsComponent implements OnInit {
             highlightedColumns: [],
             highlightedColumnColors: {},
             pageSize: 20,
+            stickyHeaders: true,
             searchValue: '',
             selectedColumns: fields.allFields,
         };