diff --git a/.github/workflows/issue_closed.yaml b/.github/workflows/issue_closed.yaml index c4daabf65..089817334 100644 --- a/.github/workflows/issue_closed.yaml +++ b/.github/workflows/issue_closed.yaml @@ -17,3 +17,37 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.issue.number }} + - name: Get project ID from project number + id: get_project_id + run: | + PROJECT_ID=$(gh api graphql -f query='query { repository(owner: "${{ github.repository_owner }}", name: "${{ github.event.repository.name }}") { projectV2(number: 1) { id } } }' --jq '.data.repository.projectV2.id') + echo "PROJECT_ID=$PROJECT_ID" >> $GITHUB_ENV + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get item ID for issue in project + id: get_item_id + run: | + ITEM_ID=$(gh api graphql -f query='query { repository(owner: "${{ github.repository_owner }}", name: "${{ github.event.repository.name }}") { issue(number: ${{ github.event.issue.number }}) { projectItems(first: 10) { nodes { id project { id } } } } }' --jq '.data.repository.issue.projectItems.nodes[] | select(.project.id==env.PROJECT_ID) | .id') + echo "ITEM_ID=$ITEM_ID" >> $GITHUB_ENV + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get status field and Done option IDs + id: get_status_ids + run: | + STATUS_FIELD_ID=$(gh api graphql -f query='query { node(id: "'$PROJECT_ID'") { ... on ProjectV2 { fields(first: 20) { nodes { id name } } } } }' --jq '.data.node.fields.nodes[] | select(.name=="Status") | .id') + DONE_OPTION_ID=$(gh api graphql -f query='query { node(id: "'$STATUS_FIELD_ID'") { ... on ProjectV2Field { options { id name } } } }' --jq '.data.node.options[] | select(.name=="Done") | .id') + echo "STATUS_FIELD_ID=$STATUS_FIELD_ID" >> $GITHUB_ENV + echo "DONE_OPTION_ID=$DONE_OPTION_ID" >> $GITHUB_ENV + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set status to Done in project + run: | + gh api graphql -f query='mutation($project:ID!, $item:ID!, $field:ID!, $option:ID!) { updateProjectV2ItemFieldValue(input: {projectId: $project, itemId: $item, fieldId: $field, value: { singleSelectOptionId: $option } }) { projectV2Item { id } } }' -f project=$PROJECT_ID -f item=$ITEM_ID -f field=$STATUS_FIELD_ID -f option=$DONE_OPTION_ID + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PROJECT_ID: ${{ env.PROJECT_ID }} + ITEM_ID: ${{ env.ITEM_ID }} + STATUS_FIELD_ID: ${{ env.STATUS_FIELD_ID }} + DONE_OPTION_ID: ${{ env.DONE_OPTION_ID }} +# To get your project, field, and option IDs, see the instructions in the new issue_opened_project.yaml file. +# You must replace the placeholders with your actual project and field IDs. diff --git a/.github/workflows/issue_opened_project.yaml b/.github/workflows/issue_opened_project.yaml new file mode 100644 index 000000000..2726f9108 --- /dev/null +++ b/.github/workflows/issue_opened_project.yaml @@ -0,0 +1,24 @@ +# Auto-add new issues to a GitHub project (replace PROJECT_ID and COLUMN_ID with your values) +name: Add new issues to project +on: + issues: + types: + - opened +jobs: + add_to_project: + runs-on: ubuntu-latest + steps: + - name: Get project ID from project number + id: get_project_id + run: | + PROJECT_ID=$(gh api graphql -f query='query { repository(owner: "${{ github.repository_owner }}", name: "${{ github.event.repository.name }}") { projectV2(number: 1) { id } } }' --jq '.data.repository.projectV2.id') + echo "PROJECT_ID=$PROJECT_ID" >> $GITHUB_ENV + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Add issue to project + run: | + gh api graphql -f query='mutation($project:ID!, $contentId:ID!) { addProjectV2ItemById(input: {projectId: $project, contentId: $contentId}) { item { id } } }' -f project=$PROJECT_ID -f contentId=$ISSUE_ID + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_ID: ${{ github.event.issue.node_id }} +# To get your project ID, use: gh api graphql -f query='query { organization(login: "") { projectV2(number: ) { id } } }' diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index e12ec2356..d5ffaae9d 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -5008,5 +5008,8 @@ "getStartedComplete": "You've completed this section!\nKeep exploring our amazing features by chatting with friends!", "getStartedFriendsComplete": "Woohoo! You've got friends! 😉", "getStartedBotChatButton": "Start chatting!", - "getStartedFriendsButton": "Invite a friend" + "getStartedFriendsButton": "Invite a friend", + "groupChat": "Group Chat", + "directMessage": "Direct Message", + "newDirectMessage": "New direct message" } diff --git a/lib/pages/chat_list/chat_list_view.dart b/lib/pages/chat_list/chat_list_view.dart index 9b090f207..3351a67fe 100644 --- a/lib/pages/chat_list/chat_list_view.dart +++ b/lib/pages/chat_list/chat_list_view.dart @@ -71,9 +71,15 @@ class ChatListView extends StatelessWidget { // Pangea# ? FloatingActionButton.extended( onPressed: () => context.go('/rooms/newprivatechat'), - icon: const Icon(Icons.add_outlined), + // #Pangea + icon: const Icon(Icons.chat_bubble_outline), + // icon: const Icon(Icons.add_outlined), + // Pangea# label: Text( - L10n.of(context).chat, + // #Pangea + L10n.of(context).directMessage, + // L10n.of(context).chat, + // Pangea# overflow: TextOverflow.fade, ), ) diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index d6f964a22..6f60cef4b 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -686,7 +686,7 @@ class _SpaceViewState extends State { // label: Text(L10n.of(context).group), onPressed: () => context.go("/rooms/newgroup?space=${widget.spaceId}"), - label: Text(L10n.of(context).chat), + label: Text(L10n.of(context).groupChat), // Pangea# icon: const Icon(Icons.group_add_outlined), ) diff --git a/lib/pages/new_private_chat/new_private_chat_view.dart b/lib/pages/new_private_chat/new_private_chat_view.dart index b850ea916..171691af5 100644 --- a/lib/pages/new_private_chat/new_private_chat_view.dart +++ b/lib/pages/new_private_chat/new_private_chat_view.dart @@ -30,7 +30,10 @@ class NewPrivateChatView extends StatelessWidget { appBar: AppBar( scrolledUnderElevation: 0, leading: const Center(child: BackButton()), - title: Text(L10n.of(context).newChat), + // #Pangea + title: Text(L10n.of(context).newDirectMessage), + // title: Text(L10n.of(context).newChat), + // Pangea# backgroundColor: theme.scaffoldBackgroundColor, // #Pangea // actions: [ diff --git a/lib/pangea/chat_settings/pages/pangea_chat_details.dart b/lib/pangea/chat_settings/pages/pangea_chat_details.dart index 1baa5cb19..20631b837 100644 --- a/lib/pangea/chat_settings/pages/pangea_chat_details.dart +++ b/lib/pangea/chat_settings/pages/pangea_chat_details.dart @@ -624,7 +624,7 @@ class RoomDetailsButton extends StatelessWidget { : Colors.transparent, borderRadius: BorderRadius.circular(8), ), - padding: const EdgeInsets.all(12.0), + padding: EdgeInsets.all(mini ? 6 : 12.0), child: mini ? buttonDetails.icon : Column( diff --git a/lib/pangea/message_token_text/message_token_button.dart b/lib/pangea/message_token_text/message_token_button.dart index 7e855e223..2b2624948 100644 --- a/lib/pangea/message_token_text/message_token_button.dart +++ b/lib/pangea/message_token_text/message_token_button.dart @@ -296,13 +296,14 @@ class MessageTokenButtonContent extends StatelessWidget { BorderRadius.circular(AppConfig.borderRadius - 4); Color _color(BuildContext context) { - if (activity == null) { - return Theme.of(context).colorScheme.primary; - } - if (isActivityCompleteOrNullForToken) { - return AppConfig.gold; - } - return Theme.of(context).colorScheme.primary; + final bool isLight = Theme.of(context).brightness == Brightness.light; + final defaultColor = isLight + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.primaryContainer; + + return activity != null && isActivityCompleteOrNullForToken + ? AppConfig.gold + : defaultColor; } @override @@ -377,6 +378,8 @@ class MessageTokenButtonContent extends StatelessWidget { (selectedChoice != null ? 0.4 : 0.0) + (accepted.isNotEmpty ? 0.3 : 0.0); + final theme = Theme.of(context); + return InkWell( onTap: selectedChoice != null ? () => onMatch?.call(selectedChoice!) @@ -384,10 +387,11 @@ class MessageTokenButtonContent extends StatelessWidget { borderRadius: _borderRadius, child: CustomPaint( painter: DottedBorderPainter( - color: Theme.of(context) - .colorScheme - .primary - .withAlpha((colorAlpha * 255).toInt()), + color: theme.brightness == Brightness.light + ? theme.colorScheme.primary + .withAlpha((colorAlpha * 255).toInt()) + : theme.colorScheme.primaryContainer + .withAlpha((colorAlpha * 255).toInt()), borderRadius: _borderRadius, ), child: Container( @@ -396,9 +400,7 @@ class MessageTokenButtonContent extends StatelessWidget { width: max(width, 24.0), alignment: Alignment.center, decoration: BoxDecoration( - color: Theme.of(context) - .colorScheme - .primary + color: theme.colorScheme.primary .withAlpha((max(0, colorAlpha - 0.7) * 255).toInt()), borderRadius: _borderRadius, ),