fluffychat/lib/pangea/choreographer/assistance_state_enum.dart
wcjord 473ffbaf24
docs: writing assistance redesign design spec (#5655) (#5696)
* "docs: writing assistance redesign design spec (#5655)

Add comprehensive design doc for the WA redesign:
- AssistanceRing replaces StartIGCButton (segmented ring around Pangea icon)
- Background highlights with category colors (not red/orange error tones)
- Simplified match lifecycle: open → viewed → accepted (no ignore)
- Persistent span card with smooth transitions between matches
- Send always available, no gate on unresolved matches

Remove superseded design docs (SPAN_CARD_REDESIGN_FINALIZED.md,
SPAN_CARD_REDESIGN_Q_AND_A.md, choreographer.instructions.md)."

* feat: replace ignored status with viewed status, initial updates to span card

* resolve merge conflicts

* rebuild input bar on active match update to fix span hightlighting

* cleanup

* allow opening span cards for closed matches

* no gate on sending, update underline colors

* animate span card transitions

* initial updates to add segmented IGC progress ring

* update segment colors / opacities based on match statuses

* use same widget for igc loading and fetched

* more segment animation changes

* fix scrolling and wrap in span card

* better disabled color

* close span card on assistance state change

* remove print statements

* update design doc

* cleanup

---------

Co-authored-by: ggurdin <ggurdin@gmail.com>
2026-02-25 13:07:53 -05:00

61 lines
1.8 KiB
Dart

// assistance state is, user has not typed a message, user has typed a message and IGC has not run,
// IGC is running, IGC has run and there are remaining steps (either IT or IGC), or all steps are done
// Or user does not have a subscription
import 'package:flutter/material.dart';
import 'package:fluffychat/config/app_config.dart';
enum AssistanceStateEnum {
noSub,
noMessage,
notFetched,
fetching,
fetched,
complete,
error;
Color stateColor(BuildContext context) {
switch (this) {
case AssistanceStateEnum.noSub:
case AssistanceStateEnum.noMessage:
case AssistanceStateEnum.fetched:
case AssistanceStateEnum.error:
return Colors.grey[400]!;
case AssistanceStateEnum.notFetched:
case AssistanceStateEnum.fetching:
return Theme.of(context).colorScheme.primary;
case AssistanceStateEnum.complete:
return AppConfig.success;
}
}
Color sendButtonColor(BuildContext context) {
switch (this) {
case AssistanceStateEnum.noMessage:
case AssistanceStateEnum.fetched:
return Theme.of(context).disabledColor;
case AssistanceStateEnum.noSub:
case AssistanceStateEnum.error:
case AssistanceStateEnum.notFetched:
case AssistanceStateEnum.fetching:
return Theme.of(context).colorScheme.primary;
case AssistanceStateEnum.complete:
return AppConfig.success;
}
}
bool get allowsFeedback => switch (this) {
AssistanceStateEnum.notFetched => true,
_ => false,
};
bool get showIcon => switch (this) {
AssistanceStateEnum.noSub => true,
AssistanceStateEnum.noMessage => true,
AssistanceStateEnum.notFetched => true,
AssistanceStateEnum.error => true,
AssistanceStateEnum.complete => true,
_ => false,
};
}