From 667922c9094653c82ab4e2779c52ed37ecaca7f7 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Mon, 9 Jun 2025 10:04:57 -0400 Subject: [PATCH 1/6] Add more visible activity outline color in dark mode --- .../message_token_button.dart | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/pangea/message_token_text/message_token_button.dart b/lib/pangea/message_token_text/message_token_button.dart index 7e855e223..cba22ec44 100644 --- a/lib/pangea/message_token_text/message_token_button.dart +++ b/lib/pangea/message_token_text/message_token_button.dart @@ -296,13 +296,18 @@ class MessageTokenButtonContent extends StatelessWidget { BorderRadius.circular(AppConfig.borderRadius - 4); Color _color(BuildContext context) { + final bool isLight = Theme.of(context).brightness == Brightness.light; if (activity == null) { - return Theme.of(context).colorScheme.primary; + return isLight + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.primaryContainer; } if (isActivityCompleteOrNullForToken) { return AppConfig.gold; } - return Theme.of(context).colorScheme.primary; + return isLight + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.primaryContainer; } @override @@ -384,10 +389,15 @@ class MessageTokenButtonContent extends StatelessWidget { borderRadius: _borderRadius, child: CustomPaint( painter: DottedBorderPainter( - color: Theme.of(context) - .colorScheme - .primary - .withAlpha((colorAlpha * 255).toInt()), + color: Theme.of(context).brightness == Brightness.light + ? Theme.of(context) + .colorScheme + .primary + .withAlpha((colorAlpha * 255).toInt()) + : Theme.of(context) + .colorScheme + .primaryContainer + .withAlpha((colorAlpha * 275).toInt()), borderRadius: _borderRadius, ), child: Container( From 68a4bcb84b01da8b17af3269e23cbff761aea624 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Mon, 9 Jun 2025 11:01:11 -0400 Subject: [PATCH 2/6] Decrease padding on mini buttons to fix centering --- lib/pangea/chat_settings/pages/pangea_chat_details.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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( From 649ecc6b15686cecbde8b2444f657e36ff03696c Mon Sep 17 00:00:00 2001 From: ggurdin Date: Mon, 9 Jun 2025 12:27:41 -0400 Subject: [PATCH 3/6] chore: simplifying changes --- .../message_token_button.dart | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/lib/pangea/message_token_text/message_token_button.dart b/lib/pangea/message_token_text/message_token_button.dart index cba22ec44..2b2624948 100644 --- a/lib/pangea/message_token_text/message_token_button.dart +++ b/lib/pangea/message_token_text/message_token_button.dart @@ -297,17 +297,13 @@ class MessageTokenButtonContent extends StatelessWidget { Color _color(BuildContext context) { final bool isLight = Theme.of(context).brightness == Brightness.light; - if (activity == null) { - return isLight - ? Theme.of(context).colorScheme.primary - : Theme.of(context).colorScheme.primaryContainer; - } - if (isActivityCompleteOrNullForToken) { - return AppConfig.gold; - } - return isLight + final defaultColor = isLight ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.primaryContainer; + + return activity != null && isActivityCompleteOrNullForToken + ? AppConfig.gold + : defaultColor; } @override @@ -382,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!) @@ -389,15 +387,11 @@ class MessageTokenButtonContent extends StatelessWidget { borderRadius: _borderRadius, child: CustomPaint( painter: DottedBorderPainter( - color: Theme.of(context).brightness == Brightness.light - ? Theme.of(context) - .colorScheme - .primary + color: theme.brightness == Brightness.light + ? theme.colorScheme.primary .withAlpha((colorAlpha * 255).toInt()) - : Theme.of(context) - .colorScheme - .primaryContainer - .withAlpha((colorAlpha * 275).toInt()), + : theme.colorScheme.primaryContainer + .withAlpha((colorAlpha * 255).toInt()), borderRadius: _borderRadius, ), child: Container( @@ -406,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, ), From ee267e7ae8ef759f11927880b4eff1e1ff26e671 Mon Sep 17 00:00:00 2001 From: wcjord <32568597+wcjord@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:07:39 -0400 Subject: [PATCH 4/6] auto add new issues and auto move closed to done (#2990) --- .github/workflows/issue_closed.yaml | 28 +++++++++++++++++++++ .github/workflows/issue_opened_project.yaml | 22 ++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/issue_opened_project.yaml diff --git a/.github/workflows/issue_closed.yaml b/.github/workflows/issue_closed.yaml index c4daabf65..52b0f7c39 100644 --- a/.github/workflows/issue_closed.yaml +++ b/.github/workflows/issue_closed.yaml @@ -17,3 +17,31 @@ 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 + - 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 + - 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 + - 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..c1e652789 --- /dev/null +++ b/.github/workflows/issue_opened_project.yaml @@ -0,0 +1,22 @@ +# 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 + - 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 } } }' From 103c530bb30b88802a51e39aecdc7dad4edc2a65 Mon Sep 17 00:00:00 2001 From: wcjord <32568597+wcjord@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:20:50 -0400 Subject: [PATCH 5/6] Workflows (#2993) * auto add new issues and auto move closed to done * fix: setting GH_TOKEN for script --- .github/workflows/issue_closed.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/issue_closed.yaml b/.github/workflows/issue_closed.yaml index 52b0f7c39..089817334 100644 --- a/.github/workflows/issue_closed.yaml +++ b/.github/workflows/issue_closed.yaml @@ -22,11 +22,15 @@ jobs: 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: | @@ -34,6 +38,8 @@ jobs: 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 From b8087cb43c0850da2ca7756733e1991fa7be9603 Mon Sep 17 00:00:00 2001 From: wcjord <32568597+wcjord@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:26:33 -0400 Subject: [PATCH 6/6] fix(issue_opened_project) fix(issue_opened_project) --- .github/workflows/issue_opened_project.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/issue_opened_project.yaml b/.github/workflows/issue_opened_project.yaml index c1e652789..2726f9108 100644 --- a/.github/workflows/issue_opened_project.yaml +++ b/.github/workflows/issue_opened_project.yaml @@ -13,6 +13,8 @@ jobs: 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