Skip to content

Commit e62efd4

Browse files
fix mobile layout for saved filters row, active filters and condition inputs
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a85b905 commit e62efd4

4 files changed

Lines changed: 96 additions & 27 deletions

File tree

frontend/src/app/components/dashboard/db-table-view/db-table-view.component.css

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -759,26 +759,41 @@
759759
display: none !important;
760760
}
761761

762+
.saved-filters-row__mobile-actions {
763+
display: none;
764+
}
765+
762766
@media (width <= 600px) {
763767
.saved-filters-row {
764768
display: flex;
769+
flex-direction: column;
765770
align-items: flex-start;
766771
gap: 8px;
767772
}
768773

769774
.saved-filters-row > app-saved-filters-panel {
770-
flex: 1 1 auto;
775+
flex: 0 1 auto;
771776
min-width: 0;
772777
display: block;
773778
}
774779

780+
.saved-filters-row__mobile-actions {
781+
display: flex;
782+
align-items: center;
783+
justify-content: flex-end;
784+
/* grow to fill the row so the buttons sit on the far right; panel keeps its natural width to avoid overlapping .saved-filters-trigger_active */
785+
flex: 1 1 auto;
786+
min-width: 0;
787+
width: 100%;
788+
margin-bottom: -44px;
789+
}
790+
775791
.mobile-sort-button {
776792
display: inline-flex !important;
777793
align-items: center;
778-
gap: 4px;
779794
flex: 0 0 auto;
780795
min-height: 36px;
781-
padding: 0 10px;
796+
padding: 0 4px;
782797
font-size: 13px;
783798
font-weight: 500;
784799
}
@@ -902,6 +917,13 @@
902917
margin-bottom: 12px;
903918
}
904919

920+
@media (width <= 600px) {
921+
.active-filters {
922+
margin-top: -12px;
923+
margin-bottom: 16px;
924+
}
925+
}
926+
905927
::ng-deep .active-filters .mat-mdc-chip {
906928
--mdc-chip-container-color: #e8ecee !important;
907929
--mdc-chip-elevated-container-color: #e8ecee !important;
@@ -965,14 +987,6 @@
965987
}
966988
}
967989

968-
.active-filters {
969-
display: flex;
970-
align-items: center;
971-
flex-wrap: wrap;
972-
gap: 8px;
973-
margin-bottom: 12px;
974-
}
975-
976990
.db-table-active-filter-chip ::ng-deep .mdc-evolution-chip__text-label {
977991
max-width: 300px;
978992
overflow: hidden;
@@ -1026,6 +1040,7 @@
10261040
@media (width <= 600px) {
10271041
.db-table {
10281042
grid-template-columns: minmax(0, 120px) 1fr !important;
1043+
grid-row-gap: 8px;
10291044
background: transparent !important;
10301045
}
10311046

@@ -1042,6 +1057,10 @@
10421057
box-shadow: none !important;
10431058
}
10441059

1060+
.table-surface ::ng-deep mat-paginator {
1061+
margin-top: 20px;
1062+
}
1063+
10451064
.table-box {
10461065
background: transparent;
10471066
}

frontend/src/app/components/dashboard/db-table-view/db-table-view.component.html

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,23 @@ <h2 class="mat-h2 table-name">{{ displayName }}</h2>
285285
</div>
286286

287287
<div class="saved-filters-row">
288+
<div class="saved-filters-row__mobile-actions">
289+
<button mat-icon-button type="button" *ngIf="tableData && tableData.displayedColumns && tableData.columns"
290+
class="saved-filters-row__columns"
291+
matTooltip="Columns"
292+
(click)="openColumnsSheet()">
293+
<mat-icon fontSet="material-symbols-outlined">view_week</mat-icon>
294+
</button>
295+
296+
<button mat-button type="button" *ngIf="tableData && tableData.displayedDataColumns?.length"
297+
class="mobile-sort-button"
298+
[ngClass]="{'mobile-sort-button_active': sort.active && sort.direction}"
299+
(click)="openSortSheet()">
300+
<mat-icon fontSet="material-symbols-outlined">swap_vert</mat-icon>
301+
<span class="mobile-sort-button__label">Sort by</span>
302+
</button>
303+
</div>
304+
288305
<app-saved-filters-panel *ngIf="tableData && tableData.structure && tableData.widgets"
289306
[connectionID]="connectionID"
290307
[selectedTableName]="name"
@@ -295,21 +312,6 @@ <h2 class="mat-h2 table-name">{{ displayName }}</h2>
295312
[tableTypes]="tableData.tableTypes"
296313
(filterSelected)="onFilterSelected($event)"
297314
></app-saved-filters-panel>
298-
299-
<button mat-icon-button type="button" *ngIf="tableData && tableData.displayedColumns && tableData.columns"
300-
class="saved-filters-row__columns"
301-
matTooltip="Columns"
302-
(click)="openColumnsSheet()">
303-
<mat-icon fontSet="material-symbols-outlined">view_week</mat-icon>
304-
</button>
305-
306-
<button mat-button type="button" *ngIf="tableData && tableData.displayedDataColumns?.length"
307-
class="mobile-sort-button"
308-
[ngClass]="{'mobile-sort-button_active': sort.active && sort.direction}"
309-
(click)="openSortSheet()">
310-
<mat-icon fontSet="material-symbols-outlined">swap_vert</mat-icon>
311-
<span class="mobile-sort-button__label">Sort by</span>
312-
</button>
313315
</div>
314316

315317
<!-- Table View -->

frontend/src/app/components/dashboard/db-table-view/saved-filters-panel/saved-filters-dialog/saved-filters-dialog.component.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,20 @@
735735
flex: 0 0 auto;
736736
}
737737

738+
/* ndc-dynamic renders the component as a sibling and leaves an empty anchor element behind; keep it from taking up flex space */
739+
.condition-card__inputs > ndc-dynamic {
740+
flex: 0 0 auto;
741+
width: auto;
742+
}
743+
744+
/* the actual component is rendered as the sibling right after the anchor; let it (and its host child) fill the available space */
745+
.condition-card__inputs > ndc-dynamic + *,
746+
.condition-card__inputs ::ng-deep ndc-dynamic + * {
747+
flex: 1 1 0;
748+
width: 100%;
749+
min-width: 0;
750+
}
751+
738752
.comparator-trigger__symbol {
739753
display: none;
740754
}
@@ -770,6 +784,20 @@
770784
min-width: 0;
771785
}
772786

787+
/* ndc-dynamic renders the component as a sibling and leaves an empty anchor element behind; keep it from taking up flex space */
788+
.condition-card__value > ndc-dynamic {
789+
flex: 0 0 auto;
790+
width: auto;
791+
}
792+
793+
/* the actual component is rendered as the sibling right after the anchor; let it (and its host child) fill the available space */
794+
.condition-card__value > ndc-dynamic + *,
795+
.condition-card__value ::ng-deep ndc-dynamic + * {
796+
flex: 1 1 0;
797+
width: 100%;
798+
min-width: 0;
799+
}
800+
773801
.condition-card__value ::ng-deep .full-width {
774802
width: 100%;
775803
}

frontend/src/app/components/dashboard/db-table-view/saved-filters-panel/saved-filters-panel.component.css

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,25 @@
3030
display: inline-flex;
3131
}
3232

33+
.saved-filters-trigger_active {
34+
width: calc(100vw - 130px - 2*24px);
35+
box-sizing: border-box;
36+
}
37+
38+
/* let the button's label shrink and ellipsis when it can't fit into calc(100% - 130px) */
39+
.saved-filters-trigger_active ::ng-deep .mdc-button__label {
40+
display: flex;
41+
align-items: center;
42+
min-width: 0;
43+
overflow: hidden;
44+
}
45+
46+
.saved-filters-trigger_active .saved-filters-trigger__label {
47+
max-width: none;
48+
min-width: 0;
49+
flex: 1 1 auto;
50+
}
51+
3352
.create-filter-button,
3453
.saved-filters-tabs {
3554
display: none !important;
@@ -301,7 +320,8 @@
301320
flex-direction: row;
302321
flex-wrap: wrap;
303322
gap: 6px;
304-
margin: 8px 0 16px;
323+
margin-top: 0;
324+
margin-bottom: 16px;
305325
padding: 8px 16px;
306326
border-radius: 10px;
307327
background: rgba(0, 0, 0, 0.03);

0 commit comments

Comments
 (0)