Files
noo/lib/widgets/noo/media/noo_activity_item.dart
T
ayushyaandClaude Opus 5.5 56784ef212 Rebuild UI on the Noo design system
Replaces the Material 3 screens with the Noo design system: warm
neutrals, one violet accent, pill controls, Schibsted Grotesk/
Instrument Sans, Lucide icons, no gradients/shadows.

- New lib/widgets/noo/ component kit (core, lists, files, media, nav,
  overlays) plus lib/theme/design_tokens.dart for the color/type/space/
  radius/motion tokens.
- Rebuilt the app shell (top/bottom bars, drawer, desktop sidebar and
  toolbar), every tab (Files/Offline, Photos, Favorites, Recent,
  Activity, Trash, Shares), Settings, the lock and login screens, the
  media viewer, search, the details/share sheets, and the share-upload
  and move/copy destination pickers.
- Added a design canvas (linked from DESIGN_SYSTEM.md) covering the
  screens the spec didn't already describe, with matching Android and
  iOS chrome; wrote up the approved recipes into DESIGN_SYSTEM.md §4.
- Removed now-dead legacy widgets (media_grid_tile, swipeable_item,
  sync_status_badge, selectable_thumbnail) and updated
  architecture.md/styling.md/standards.md to describe the new
  structure and component/testing conventions.
- Added widget tests for the noo/ component kit.

This is a UI-only rework: no provider/model/service behavior changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 01:51:58 -04:00

117 lines
3.4 KiB
Dart

import 'package:flutter/material.dart';
import '../../../theme/design_tokens.dart';
import '../core/noo_avatar.dart';
/// Activity feed entry (`DESIGN_SYSTEM.md` section 2, "Activity item"):
/// a 36px [NooAvatar], then the sentence **actor** verb **object** tail
/// with the time below in meta style, and an optional [trailing] slot on
/// the right for the 32px/r10 file tile (built by the caller, so this
/// doesn't depend on the file-kind mapping).
class NooActivityItem extends StatelessWidget {
final String actor;
/// Plain text between actor and object, e.g. `"shared"`.
final String verb;
/// Bold subject of the action, e.g. a file name.
final String? object;
/// Plain text after the object, e.g. `"with you"`.
final String? tail;
final String? time;
/// Avatar initials; defaults to the first letter of [actor].
final String? initials;
/// One of [NooColors.avatarPalette].
final Color? avatarColor;
/// Uses the accent-soft current-user avatar.
final bool currentUser;
/// Right-aligned slot, typically a 32px file tile.
final Widget? trailing;
final VoidCallback? onTap;
const NooActivityItem({
super.key,
required this.actor,
required this.verb,
this.object,
this.tail,
this.time,
this.initials,
this.avatarColor,
this.currentUser = false,
this.trailing,
this.onTap,
});
@override
Widget build(BuildContext context) {
final colors = context.nooColors;
final base = NooText.body.copyWith(color: colors.fg1);
const bold = TextStyle(fontWeight: FontWeight.w600);
final fallbackInitials = actor.trim().isEmpty
? ''
: actor.trim().characters.first.toUpperCase();
return Material(
type: MaterialType.transparency,
child: InkWell(
onTap: onTap,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: NooSpace.md,
vertical: NooSpace.sm,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
NooAvatar(
initials: initials ?? fallbackInitials,
size: 36,
color: avatarColor,
current: currentUser,
),
const SizedBox(width: NooSpace.sm),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(
style: base,
children: [
TextSpan(text: actor, style: bold),
TextSpan(text: ' $verb'),
if (object != null) ...[
const TextSpan(text: ' '),
TextSpan(text: object, style: bold),
],
if (tail != null) TextSpan(text: ' $tail'),
],
),
),
if (time != null) ...[
const SizedBox(height: NooSpace.xxs),
Text(time!, style: NooText.meta.copyWith(color: colors.fg3)),
],
],
),
),
if (trailing != null) ...[
const SizedBox(width: NooSpace.sm),
trailing!,
],
],
),
),
),
);
}
}