-
Notifications
You must be signed in to change notification settings - Fork 9
feat(cat-voices): Proposal brief card collaborators #3784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
damian-molinski
merged 4 commits into
feat/co-proposers-3677
from
feat/proposal_brief_card_collaborators_3677
Dec 1, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7003418
feat: integrate proposal brief card collaborators
damian-molinski 1776659
Merge branch 'feat/co-proposers-3677' into feat/proposal_brief_card_c…
damian-molinski 320b2bc
loc and
damian-molinski e454150
Merge branch 'feat/proposal_brief_card_collaborators_3677' of github.…
damian-molinski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
catalyst_voices/apps/voices/lib/widgets/user/accounts_text.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| import 'package:catalyst_voices/common/ext/build_context_ext.dart'; | ||
| import 'package:catalyst_voices/widgets/common/affix_decorator.dart'; | ||
| import 'package:catalyst_voices/widgets/user/catalyst_id_text.dart'; | ||
| import 'package:catalyst_voices/widgets/user/username_text.dart'; | ||
| import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; | ||
| import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; | ||
| import 'package:catalyst_voices_models/catalyst_voices_models.dart'; | ||
| import 'package:catalyst_voices_shared/catalyst_voices_shared.dart'; | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class AccountsText extends StatelessWidget { | ||
| final List<CatalystId> ids; | ||
| final TextStyle? style; | ||
| final int? maxLines; | ||
| final TextOverflow? overflow; | ||
|
|
||
| const AccountsText({ | ||
| super.key, | ||
| required this.ids, | ||
| this.style, | ||
| this.maxLines, | ||
| this.overflow, | ||
| }); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| final firstId = ids.firstOrNull; | ||
| final firstUsername = firstId?.username; | ||
| final isAnonymous = firstId != null && (firstUsername == null || firstUsername.isBlank); | ||
|
|
||
| final effectiveFirstUsername = isAnonymous ? context.l10n.anonymousUsername : firstUsername; | ||
|
|
||
| return Text.rich( | ||
| TextSpan( | ||
| text: effectiveFirstUsername, | ||
| style: TextStyle(fontStyle: isAnonymous ? FontStyle.italic : FontStyle.normal), | ||
| children: [ | ||
| if (ids.length > 1) ...[ | ||
| TextSpan(text: ' ${context.l10n.andSign} '), | ||
| WidgetSpan( | ||
| child: Tooltip( | ||
| richMessage: WidgetSpan(child: _OtherTooltipOverlay(ids.sublist(1))), | ||
| padding: EdgeInsets.zero, | ||
| decoration: const BoxDecoration(), | ||
| constraints: const BoxConstraints(maxWidth: 268), | ||
| enableTapToDismiss: false, | ||
| child: Text( | ||
| context.l10n.others(ids.length - 1), | ||
| style: (style ?? const TextStyle()).copyWith( | ||
| color: Theme.of(context).linksPrimary, | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| ], | ||
| ], | ||
| ), | ||
| style: style, | ||
| maxLines: maxLines, | ||
| overflow: overflow, | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| class _OtherTooltipOverlay extends StatelessWidget { | ||
| final List<CatalystId> ids; | ||
|
|
||
| const _OtherTooltipOverlay(this.ids); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Material( | ||
| color: context.colors.elevationsOnSurfaceNeutralLv1White, | ||
| elevation: 4, | ||
| borderRadius: BorderRadius.circular(8), | ||
| child: Column( | ||
| mainAxisSize: MainAxisSize.min, | ||
| children: ids.map(_OtherTooltipOverlayTile.new).toList(), | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| class _OtherTooltipOverlayTile extends StatelessWidget { | ||
| final CatalystId id; | ||
|
|
||
| const _OtherTooltipOverlayTile(this.id); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| final idStyle = context.textTheme.labelSmall; | ||
| final usernameStyle = (context.textTheme.bodyLarge ?? const TextStyle()).copyWith( | ||
| color: context.colors.textOnPrimaryLevel0, | ||
| ); | ||
|
|
||
| return Padding( | ||
| padding: const EdgeInsets.symmetric( | ||
| vertical: 12, | ||
| horizontal: 16, | ||
| ).add(const EdgeInsets.only(right: 8)), | ||
| child: AffixDecorator( | ||
| suffix: CatalystIdText( | ||
| id, | ||
| isCompact: true, | ||
| showCopy: false, | ||
| copyEnabled: false, | ||
| tooltipEnabled: false, | ||
| style: idStyle, | ||
| ), | ||
| child: UsernameText(id.username, style: usernameStyle, maxLines: 1), | ||
| ), | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.