UI Phase 2: cosmetic leftovers — compact Profile photo card, fit Users table

- Profile Photo card: replace the tall centered avatar+buttons stack with a
  compact horizontal row (avatar left, caption + Upload/Camera buttons right),
  roughly halving the card height and reclaiming the dead vertical space.
- TasQColumn gains an optional `minWidth`; the adaptive table now sums per-column
  minimums instead of a flat 200 px each. User Management sets narrow widths on
  its short columns (Role/Offices/Status/Last active) so all six columns fit at
  desktop width without the horizontal scroll that was clipping the Status
  column. Other tables keep the 200 px default (unchanged).

Verified: flutter analyze lib clean; flutter build web green; visual QA
(Profile, User Management) in dark.

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-09-26 23:35:19 +08:00
parent 4685430406
commit e7706058b7
3 changed files with 74 additions and 45 deletions
+11 -1
View File
@@ -18,6 +18,7 @@ class TasQColumn<T> {
required this.cellBuilder,
this.technical = false,
this.hideOnMedium = false,
this.minWidth,
});
/// The column header text.
@@ -33,6 +34,11 @@ class TasQColumn<T> {
/// Use this for lower-priority columns (e.g. Timestamp, Status) that
/// would otherwise force a horizontal scrollbar on tablet viewports.
final bool hideOnMedium;
/// Minimum comfortable width for this column, in logical pixels. When null a
/// default of 200 is used. Set a smaller value for short columns (a count, a
/// status pill, a short enum) so the table fits without a horizontal scroll.
final double? minWidth;
}
/// Builds a mobile tile for [TasQAdaptiveList].
@@ -380,9 +386,13 @@ class TasQAdaptiveList<T> extends StatelessWidget {
const double colSpacing = 20.0;
final actionsColumnCount = rowActions == null ? 0 : 1;
final totalCols = visibleColumns.length + actionsColumnCount;
final columnsMinWidth = visibleColumns.fold<double>(
0.0,
(sum, c) => sum + (c.minWidth ?? colMinW),
);
final minColumnsWidth =
hMarginTotal +
(visibleColumns.length * colMinW) +
columnsMinWidth +
(actionsColumnCount * actMinW) +
(math.max(0, totalCols - 1) * colSpacing);
final tableWidth = math.max(contentWidth, minColumnsWidth);