Skip to content

Commit f3aa4c0

Browse files
committed
refactor(my-activity): restyle filters card with settings-style row layout and responsive controls
1 parent 9d15390 commit f3aa4c0

2 files changed

Lines changed: 84 additions & 13 deletions

File tree

src/app/features/activity/components/my-activity/my-activity.component.html

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,19 @@ <h3>Activity Timeline</h3>
7474

7575
<p-card class="activity-filters-card">
7676
<div class="activity-filters-card__header">
77-
<h3>Filters</h3>
77+
<div>
78+
<h3>Filters</h3>
79+
<p>Narrow activity by type or keywords.</p>
80+
</div>
7881
<button pButton type="button" class="p-button-text p-button-sm" icon="pi pi-filter-slash" label="Clear" (click)="clearFilters()"></button>
7982
</div>
8083

8184
<div class="filters-form">
82-
<div class="field">
83-
<label for="typeFilter">Event Type</label>
85+
<div class="filter-row">
86+
<div class="filter-row__meta">
87+
<label for="typeFilter">Event Type</label>
88+
<small>Pick an activity category.</small>
89+
</div>
8490
<p-dropdown
8591
inputId="typeFilter"
8692
[options]="typeOptions"
@@ -91,15 +97,24 @@ <h3>Filters</h3>
9197
</p-dropdown>
9298
</div>
9399

94-
<div class="field">
95-
<label for="searchFilter">Search</label>
96-
<span class="filter-search">
100+
<div class="filter-row">
101+
<div class="filter-row__meta">
102+
<label for="searchFilter">Search</label>
103+
<small>Project, task, or action keywords.</small>
104+
</div>
105+
<span class="filter-search filter-search--row">
97106
<i class="pi pi-search"></i>
98107
<input id="searchFilter" pInputText type="text" [(ngModel)]="search" placeholder="Project, task, or action" />
99108
</span>
100109
</div>
101110

102-
<button pButton type="button" icon="pi pi-refresh" label="Refresh" class="p-button-outlined" [loading]="isLoading" (click)="refresh()"></button>
111+
<div class="filter-row filter-row--action">
112+
<div class="filter-row__meta">
113+
<label>Data</label>
114+
<small>Reload timeline from server.</small>
115+
</div>
116+
<button pButton type="button" icon="pi pi-refresh" label="Refresh" class="p-button-outlined" [loading]="isLoading" (click)="refresh()"></button>
117+
</div>
103118
</div>
104119
</p-card>
105120
</div>

src/app/features/activity/components/my-activity/my-activity.component.scss

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,21 @@
107107
color: var(--text-color-secondary);
108108
}
109109

110+
.activity-filters-card__header p {
111+
margin: 0.25rem 0 0;
112+
color: var(--text-color-secondary);
113+
font-size: 0.82rem;
114+
}
115+
110116
.activity-feed-card__header,
111117
.activity-filters-card__header {
112118
display: flex;
113-
align-items: center;
119+
align-items: flex-start;
114120
justify-content: space-between;
115121
padding-bottom: 0.85rem;
116122
border-bottom: 1px solid var(--surface-border);
117123
margin-bottom: 0.2rem;
124+
gap: 0.75rem;
118125
}
119126

120127
.activity-error {
@@ -181,18 +188,41 @@
181188
.filters-form {
182189
display: flex;
183190
flex-direction: column;
184-
gap: 1rem;
191+
gap: 0.75rem;
185192
}
186193

187-
.field {
194+
.filter-row {
195+
border: 1px solid var(--surface-border);
196+
border-radius: 12px;
197+
background: color-mix(in srgb, var(--surface-100) 65%, transparent);
198+
padding: 0.72rem 0.78rem;
199+
display: flex;
200+
align-items: center;
201+
justify-content: space-between;
202+
gap: 0.85rem;
203+
}
204+
205+
.filter-row--action {
206+
background: color-mix(in srgb, var(--surface-100) 58%, transparent);
207+
}
208+
209+
.filter-row__meta {
188210
display: flex;
189211
flex-direction: column;
190-
gap: 0.35rem;
212+
gap: 0.15rem;
213+
min-width: 0;
214+
}
215+
216+
.filter-row__meta label {
217+
color: var(--text-color);
218+
font-size: 0.86rem;
219+
font-weight: 600;
191220
}
192221

193-
.field label {
194-
font-size: 0.85rem;
222+
.filter-row__meta small {
195223
color: var(--text-color-secondary);
224+
font-size: 0.76rem;
225+
line-height: 1.3;
196226
}
197227

198228
.filter-search {
@@ -201,6 +231,11 @@
201231
align-items: center;
202232
}
203233

234+
.filter-search--row {
235+
width: min(17rem, 100%);
236+
flex: 0 0 min(17rem, 100%);
237+
}
238+
204239
.filter-search i {
205240
position: absolute;
206241
left: 0.6rem;
@@ -212,6 +247,11 @@
212247
padding-left: 2rem;
213248
}
214249

250+
:host ::ng-deep .filters-form .p-dropdown {
251+
width: min(17rem, 100%);
252+
flex: 0 0 min(17rem, 100%);
253+
}
254+
215255
.empty-state {
216256
flex: 1;
217257
min-height: 10rem;
@@ -262,4 +302,20 @@
262302
.activity-kpis {
263303
grid-template-columns: 1fr;
264304
}
305+
306+
.filter-row {
307+
flex-direction: column;
308+
align-items: stretch;
309+
gap: 0.65rem;
310+
}
311+
312+
.filter-search--row {
313+
width: 100%;
314+
flex: 0 0 auto;
315+
}
316+
317+
:host ::ng-deep .filters-form .p-dropdown {
318+
width: 100%;
319+
flex: 0 0 auto;
320+
}
265321
}

0 commit comments

Comments
 (0)