From bdd0b7c24cfc0143c7e91dd07dcbc3b7bedceddb Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Thu, 17 Sep 2026 16:21:33 +0530 Subject: [PATCH 01/11] Enhance pull request comment workflow with artifact handling Refactor artifact downloading and PR comment updating logic in workflow. --- .github/workflows/pull-request-comment.yml | 283 ++++++++------------- 1 file changed, 107 insertions(+), 176 deletions(-) diff --git a/.github/workflows/pull-request-comment.yml b/.github/workflows/pull-request-comment.yml index 3cd3c99f8..e3ffcd66b 100644 --- a/.github/workflows/pull-request-comment.yml +++ b/.github/workflows/pull-request-comment.yml @@ -12,157 +12,136 @@ jobs: if: > github.event.workflow_run.event == 'pull_request' steps: - - name: Download artifacts + - name: Download artifacts safely id: download-artifacts uses: actions/github-script@v9 with: script: | - var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + const fs = require('fs'); + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, + run_id: ${{ github.event.workflow_run.id }}, }); - var pr = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "pr" - })[0]; - var download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: pr.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - - var androidScreenshots = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "Android Screenshots" - })[0]; - var downloadAndroidScreenshots = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: androidScreenshots.id, - archive_format: 'zip', - }); - - fs.writeFileSync('${{github.workspace}}/androidScreenshots.zip', Buffer.from(downloadAndroidScreenshots.data)); - - var iPadScreenshots = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "iPad Screenshots" - })[0]; - var downloadiPadScreenshots = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: iPadScreenshots.id, - archive_format: 'zip', - }); - - fs.writeFileSync('${{github.workspace}}/iPadScreenshots.zip', Buffer.from(downloadiPadScreenshots.data)); - - var iPhoneScreenshots = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "iPhone Screenshots" - })[0]; - var downloadiPhoneScreenshots = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: iPhoneScreenshots.id, - archive_format: 'zip', - }); + async function downloadIfAvailable(name, fileName) { + const artifact = artifacts.data.artifacts.find((a) => a.name === name); + if (artifact) { + const download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: 'zip', + }); + fs.writeFileSync(`${{github.workspace}}/${fileName}`, Buffer.from(download.data)); + return true; + } + return false; + } - fs.writeFileSync('${{github.workspace}}/iPhoneScreenshots.zip', Buffer.from(downloadiPhoneScreenshots.data)); + await downloadIfAvailable("pr", "pr.zip"); + await downloadIfAvailable("Android Screenshots", "androidScreenshots.zip"); + await downloadIfAvailable("iPad Screenshots", "iPadScreenshots.zip"); + await downloadIfAvailable("iPhone Screenshots", "iPhoneScreenshots.zip"); - name: Unzip Artifacts shell: bash run: | - unzip pr.zip - mkdir screenshots - unzip androidScreenshots.zip -d screenshots/ - unzip iPadScreenshots.zip -d screenshots/ - unzip iPhoneScreenshots.zip -d screenshots/ + if [ -f "pr.zip" ]; then unzip pr.zip; fi + mkdir -p screenshots + if [ -f "androidScreenshots.zip" ]; then unzip androidScreenshots.zip -d screenshots/; fi + if [ -f "iPadScreenshots.zip" ]; then unzip iPadScreenshots.zip -d screenshots/; fi + if [ -f "iPhoneScreenshots.zip" ]; then unzip iPhoneScreenshots.zip -d screenshots/; fi - name: Fetch PR Number id: fetch-pr-number uses: actions/github-script@v9 with: script: | - var fs = require('fs') - var issue_number = Number(fs.readFileSync('./NR')); + const fs = require('fs'); + let issue_number; + + if (fs.existsSync('./NR')) { + issue_number = Number(fs.readFileSync('./NR', 'utf8').trim()); + } else { + const { data } = await github.rest.repos.listPullRequestsAssociatedWithCommit({ + owner: context.repo.owner, + repo: context.repo.repo, + commit_sha: '${{ github.event.workflow_run.head_sha }}' + }); + if (data.length > 0) { + issue_number = data[0].number; + } else { + core.setFailed("Could not determine PR number."); + return; + } + } core.setOutput("pr_number", issue_number); - name: Update PR Screenshots shell: bash run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git clone --branch=pr-screenshots --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} pr-screenshots - cd pr-screenshots - - for file in ../screenshots/*; do - if [[ -f "$file" ]]; then - filename=$(basename "$file") - - if [[ "$filename" =~ -([0-9]+_.*\.png)$ ]]; then - screenshot_part="${BASH_REMATCH[1]}" - - if [[ "$filename" == *"iPhone"* ]]; then - generic_name="iPhone-${screenshot_part}" - elif [[ "$filename" == *"iPad"* ]]; then - generic_name="iPad-${screenshot_part}" + # Only run git commands if we actually downloaded screenshots + if [ -d "screenshots" ] && [ "$(ls -A screenshots 2>/dev/null)" ]; then + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git clone --branch=pr-screenshots --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} pr-screenshots + cd pr-screenshots + + for file in ../screenshots/*; do + if [[ -f "$file" ]]; then + filename=$(basename "$file") + if [[ "$filename" =~ -([0-9]+_.*\.png)$ ]]; then + screenshot_part="${BASH_REMATCH[1]}" + if [[ "$filename" == *"iPhone"* ]]; then + generic_name="iPhone-${screenshot_part}" + elif [[ "$filename" == *"iPad"* ]]; then + generic_name="iPad-${screenshot_part}" + else + generic_name="Android-${screenshot_part}" + fi else - generic_name="Android-${screenshot_part}" + generic_name="$filename" fi - else - generic_name="$filename" + cp -f "$file" "./${{ steps.fetch-pr-number.outputs.pr_number }}_${generic_name}" fi - - cp -f "$file" "./${{ steps.fetch-pr-number.outputs.pr_number }}_${generic_name}" - fi - done - - # Force push to pr-screenshots branch - git checkout --orphan temporary - git add --all . - git commit -am "[Auto] Update screenshots for #${{ steps.fetch-pr-number.outputs.pr_number }} ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D pr-screenshots - git branch -m pr-screenshots - git push --force origin pr-screenshots - - - name: Build success - if: ${{ github.event.workflow_run.conclusion == 'success' }} + done + + git checkout --orphan temporary + git add --all . + git commit -am "[Auto] Update screenshots for #${{ steps.fetch-pr-number.outputs.pr_number }} ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D pr-screenshots + git branch -m pr-screenshots + git push --force origin pr-screenshots + else + echo "No screenshots found to process. Skipping." + fi + + - name: Update PR Comment uses: actions/github-script@v9 with: script: | - var issue_number = ${{ steps.fetch-pr-number.outputs.pr_number }}; + const issue_number = ${{ steps.fetch-pr-number.outputs.pr_number }}; const owner = context.repo.owner; const repo = context.repo.repo; - var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + const conclusion = '${{ github.event.workflow_run.conclusion }}'; + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner, repo, - run_id: ${{github.event.workflow_run.id }}, + run_id: ${{ github.event.workflow_run.id }}, }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "apk-files" - })[0]; - const artifact_url = `https://github.com/${owner}/${repo}/actions/runs/${{ github.event.workflow_run.id }}/artifacts/${matchArtifact.id}`; + let artifactLinks = ""; + const ignoredArtifacts = ["pr", "Android Screenshots", "iPad Screenshots", "iPhone Screenshots"]; - const comments = await github.rest.issues.listComments({ - owner, - repo, - issue_number - }); - - let comment_id; - for (const comment of comments.data) { - if (comment.user.login === 'github-actions[bot]') { - comment_id = comment.id; - break; + artifacts.data.artifacts.forEach(artifact => { + if (!ignoredArtifacts.includes(artifact.name)) { + const url = `https://github.com/${owner}/${repo}/actions/runs/${{ github.event.workflow_run.id }}/artifacts/${artifact.id}`; + artifactLinks += `- **${artifact.name}**: [Download](${url})\n`; } - } - - var statusText = `Build successful. APKs to test: ${artifact_url}.`; + }); - var androidScreenshots = ` + const screenshotsSection = `
Android Screenshots @@ -175,15 +154,11 @@ jobs: - +
- -
- `; - var iPhoneScreenshots = `
iPhone Screenshots @@ -196,15 +171,11 @@ jobs: - +
- -
- `; - var iPadScreenshots = `
iPad Screenshots @@ -217,76 +188,36 @@ jobs: - +
- -
`; - const body = ` - ## Build Status - ${statusText} - - ## Screenshots - ${androidScreenshots} - ${iPhoneScreenshots} - ${iPadScreenshots} - `; - - if (comment_id) { - await github.rest.issues.updateComment({ - owner, - repo, - comment_id, - body - }); + let body = `## Build Status\n`; + if (conclusion === 'success') { + body += `**Build successful.**\n\n## Build artifacts to test\n${artifactLinks || '_No artifacts uploaded._'}\n\n## Screenshots\n${screenshotsSection}`; } else { - await github.rest.issues.createComment({ - owner, - repo, - issue_number, - body - }); + body += `**Build workflow failed.** _Please check the Actions logs for details._\n`; + if (artifactLinks) { + body += `\n## Build artifacts to test (Available before failure)\n${artifactLinks}\n`; + } + body += `\n> *Note: Screenshots are not generated on failed builds. Below are the latest screenshots from the \`pr-screenshots\` branch, if they exist.*\n\n## Screenshots\n${screenshotsSection}`; } - - name: Build failed - if: ${{ github.event.workflow_run.conclusion == 'failure' }} - uses: actions/github-script@v9 - with: - script: | - var issue_number = ${{ steps.fetch-pr-number.outputs.pr_number }}; - const owner = context.repo.owner; - const repo = context.repo.repo; - const comments = await github.rest.issues.listComments({ owner, repo, issue_number }); - let comment_id; - for (const comment of comments.data) { - if (comment.user.login === 'github-actions[bot]') { - comment_id = comment.id; - break; - } - } - - const body = ` - ## Build Status - _Build workflow failed. Please check the logs for more information._ + const botComment = comments.data.find(comment => comment.user.login === 'github-actions[bot]'); - ## Screenshots - _Not able to fetch screenshots._ - `; - - if (comment_id) { + if (botComment) { await github.rest.issues.updateComment({ owner, repo, - comment_id, + comment_id: botComment.id, body }); } else { @@ -296,4 +227,4 @@ jobs: issue_number, body }); - } \ No newline at end of file + } From f4fb70b61bdb23e193012a6f6acdcf9b0c84a228 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Thu, 17 Sep 2026 16:23:20 +0530 Subject: [PATCH 02/11] testing testing --- lib/main.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 32c77b929..97f879b8b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -116,8 +116,6 @@ class MyApp extends StatelessWidget { routes: { '/': (context) => const _LocaleAware(child: InstrumentsScreen()), - '/oscilloscope': (context) => - const _LocaleAware(child: OscilloscopeScreen()), '/multimeter': (context) => const _LocaleAware(child: MultimeterScreen()), '/waveGenerator': (context) => From 39834744d8c4faa371af297d5b3e60ea8b93026e Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Thu, 17 Sep 2026 16:25:54 +0530 Subject: [PATCH 03/11] Adjust design size and add new route for oscilloscope --- lib/main.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 97f879b8b..182d835b2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -90,7 +90,7 @@ class MyApp extends StatelessWidget { AppLocalizations? appLocalizations; _preCacheImages(context); return ScreenUtilInit( - designSize: const Size(360, 690), + designSize: const Size(361, 690), builder: (context, child) { return Consumer( builder: (context, provider, child) { @@ -116,6 +116,8 @@ class MyApp extends StatelessWidget { routes: { '/': (context) => const _LocaleAware(child: InstrumentsScreen()), + '/oscilloscope': (context) => + const _LocaleAware(child: OscilloscopeScreen()), '/multimeter': (context) => const _LocaleAware(child: MultimeterScreen()), '/waveGenerator': (context) => From e6ee3ce33e0300e900ad32c960cdf353feba241d Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Thu, 17 Sep 2026 19:59:20 +0530 Subject: [PATCH 04/11] Update pull-request-comment.yml --- .github/workflows/pull-request-comment.yml | 29 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-comment.yml b/.github/workflows/pull-request-comment.yml index e3ffcd66b..e04be323d 100644 --- a/.github/workflows/pull-request-comment.yml +++ b/.github/workflows/pull-request-comment.yml @@ -86,8 +86,16 @@ jobs: git config --global user.name "github-actions[bot]" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git clone --branch=pr-screenshots --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} pr-screenshots - cd pr-screenshots + # Try to clone. If the branch doesn't exist yet, initialize it automatically. + if ! git clone --branch=pr-screenshots --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} pr-screenshots; then + echo "Branch pr-screenshots not found. Creating a new one." + mkdir pr-screenshots + cd pr-screenshots + git init + git remote add origin https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} + else + cd pr-screenshots + fi for file in ../screenshots/*; do if [[ -f "$file" ]]; then @@ -111,7 +119,7 @@ jobs: git checkout --orphan temporary git add --all . git commit -am "[Auto] Update screenshots for #${{ steps.fetch-pr-number.outputs.pr_number }} ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D pr-screenshots + git branch -D pr-screenshots || true git branch -m pr-screenshots git push --force origin pr-screenshots else @@ -137,7 +145,18 @@ jobs: artifacts.data.artifacts.forEach(artifact => { if (!ignoredArtifacts.includes(artifact.name)) { const url = `https://github.com/${owner}/${repo}/actions/runs/${{ github.event.workflow_run.id }}/artifacts/${artifact.id}`; - artifactLinks += `- **${artifact.name}**: [Download](${url})\n`; + + // Map raw artifact names to pretty platform names + let platformName = artifact.name; + if (artifact.name.includes('apk-files')) platformName = 'Android'; + else if (artifact.name.includes('iOS IPA')) platformName = 'iOS'; + else if (artifact.name.includes('windows-installer')) platformName = 'Windows'; + else if (artifact.name.includes('macos-app')) platformName = 'macOS'; + else if (artifact.name === 'linux-packages') platformName = 'Linux'; + else if (artifact.name === 'linux-packages-arm64') platformName = 'Linux (ARM64)'; + else if (artifact.name.includes('web-app') || artifact.name.includes('web')) platformName = 'Web'; + + artifactLinks += `- **${platformName}**: [Download](${url})\n`; } }); @@ -194,7 +213,7 @@ jobs: `; - let body = `## Build Status\n`; + let body = `## Build Status: `; if (conclusion === 'success') { body += `**Build successful.**\n\n## Build artifacts to test\n${artifactLinks || '_No artifacts uploaded._'}\n\n## Screenshots\n${screenshotsSection}`; } else { From 8adec248fd490987412d5207fa79e7f6527cb45c Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Thu, 17 Sep 2026 20:02:21 +0530 Subject: [PATCH 05/11] Enhance PR screenshot update workflow --- .github/workflows/pull-request-comment.yml | 28 ++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-comment.yml b/.github/workflows/pull-request-comment.yml index e3ffcd66b..b48e62c94 100644 --- a/.github/workflows/pull-request-comment.yml +++ b/.github/workflows/pull-request-comment.yml @@ -81,13 +81,18 @@ jobs: - name: Update PR Screenshots shell: bash run: | - # Only run git commands if we actually downloaded screenshots if [ -d "screenshots" ] && [ "$(ls -A screenshots 2>/dev/null)" ]; then git config --global user.name "github-actions[bot]" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git clone --branch=pr-screenshots --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} pr-screenshots - cd pr-screenshots + if ! git clone --branch=pr-screenshots --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} pr-screenshots; then + echo "Branch pr-screenshots not found. Creating a new one." + mkdir pr-screenshots + cd pr-screenshots + git init + git remote add origin https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} + else + cd pr-screenshots + fi for file in ../screenshots/*; do if [[ -f "$file" ]]; then @@ -111,7 +116,7 @@ jobs: git checkout --orphan temporary git add --all . git commit -am "[Auto] Update screenshots for #${{ steps.fetch-pr-number.outputs.pr_number }} ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D pr-screenshots + git branch -D pr-screenshots || true git branch -m pr-screenshots git push --force origin pr-screenshots else @@ -137,7 +142,16 @@ jobs: artifacts.data.artifacts.forEach(artifact => { if (!ignoredArtifacts.includes(artifact.name)) { const url = `https://github.com/${owner}/${repo}/actions/runs/${{ github.event.workflow_run.id }}/artifacts/${artifact.id}`; - artifactLinks += `- **${artifact.name}**: [Download](${url})\n`; + let platformName = artifact.name; + if (artifact.name.includes('apk-files')) platformName = 'Android'; + else if (artifact.name.includes('iOS IPA')) platformName = 'iOS'; + else if (artifact.name.includes('windows-installer')) platformName = 'Windows'; + else if (artifact.name.includes('macos-app')) platformName = 'macOS'; + else if (artifact.name === 'linux-packages') platformName = 'Linux'; + else if (artifact.name === 'linux-packages-arm64') platformName = 'Linux (ARM64)'; + else if (artifact.name.includes('web-app') || artifact.name.includes('web')) platformName = 'Web'; + + artifactLinks += `- **${platformName}**: [Download](${url})\n`; } }); @@ -194,7 +208,7 @@ jobs: `; - let body = `## Build Status\n`; + let body = `## Build Status: `; if (conclusion === 'success') { body += `**Build successful.**\n\n## Build artifacts to test\n${artifactLinks || '_No artifacts uploaded._'}\n\n## Screenshots\n${screenshotsSection}`; } else { From 698f06634d92f027605d105b2c930acd2ab9d943 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Thu, 17 Sep 2026 22:30:10 +0530 Subject: [PATCH 06/11] Refactor build status message formatting --- .github/workflows/pull-request-comment.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-comment.yml b/.github/workflows/pull-request-comment.yml index 1da62a3d1..06b38b7bf 100644 --- a/.github/workflows/pull-request-comment.yml +++ b/.github/workflows/pull-request-comment.yml @@ -213,16 +213,17 @@ jobs: `; - let body = `## Build Status: `; + let body = `**Build Status:** `; if (conclusion === 'success') { - body += `**Build successful.**\n\n## Build artifacts to test\n${artifactLinks || '_No artifacts uploaded._'}\n\n## Screenshots\n${screenshotsSection}`; + body += `Build successful.\n\n## Build artifacts to test\n${artifactLinks || '_No artifacts uploaded._'}\n\n## Screenshots\n${screenshotsSection}`; } else { - body += `**Build workflow failed.** _Please check the Actions logs for details._\n`; + body += `Build workflow failed. _Please check the Actions logs for details._\n`; if (artifactLinks) { - body += `\n## Build artifacts to test (Available before failure)\n${artifactLinks}\n`; + body += `\n## Build artifacts to test\n(Available before failure)\n\n${artifactLinks}\n`; } body += `\n> *Note: Screenshots are not generated on failed builds. Below are the latest screenshots from the \`pr-screenshots\` branch, if they exist.*\n\n## Screenshots\n${screenshotsSection}`; } + const comments = await github.rest.issues.listComments({ owner, @@ -246,4 +247,4 @@ jobs: issue_number, body }); - } \ No newline at end of file + } From 62c5c0e6cf5120f9a6e24530bf27086c177d1329 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Thu, 17 Sep 2026 23:49:52 +0530 Subject: [PATCH 07/11] Adjust design size in main.dart --- lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 182d835b2..79262f9b9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -90,7 +90,7 @@ class MyApp extends StatelessWidget { AppLocalizations? appLocalizations; _preCacheImages(context); return ScreenUtilInit( - designSize: const Size(361, 690), + designSize: const Size(362, 690), builder: (context, child) { return Consumer( builder: (context, provider, child) { From ff160ccdbc8d201401d0c4255531c7ac65fcb9d8 Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sat, 19 Sep 2026 17:32:05 +0530 Subject: [PATCH 08/11] Remove import for oled_display_screen.dart --- lib/main.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 79262f9b9..2667fc6b1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -38,7 +38,6 @@ import 'package:pslab/view/soundmeter_screen.dart'; import 'package:pslab/view/thermometer_screen.dart'; import 'package:pslab/view/wave_generator_screen.dart'; import 'package:pslab/view/experiments_screen.dart'; -import 'package:pslab/view/oled_display_screen.dart'; import 'constants.dart'; import 'package:pslab/src/rust/frb_generated.dart'; From 4e2131bfd28c1176cefad569f91621867a43761b Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sat, 19 Sep 2026 17:39:55 +0530 Subject: [PATCH 09/11] Update pull-request-comment.yml --- .github/workflows/pull-request-comment.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-comment.yml b/.github/workflows/pull-request-comment.yml index 06b38b7bf..4df640340 100644 --- a/.github/workflows/pull-request-comment.yml +++ b/.github/workflows/pull-request-comment.yml @@ -213,15 +213,18 @@ jobs: `; - let body = `**Build Status:** `; + let body = 'Build Status: '; + if (conclusion === 'success') { - body += `Build successful.\n\n## Build artifacts to test\n${artifactLinks || '_No artifacts uploaded._'}\n\n## Screenshots\n${screenshotsSection}`; + body += 'Build successful.\n\n## Build artifacts to test\n\n' + (artifactLinks || '_No artifacts uploaded._') + '\n\n## Screenshots\n\n' + screenshotsSection; } else { - body += `Build workflow failed. _Please check the Actions logs for details._\n`; + body += 'Build workflow failed. Please check the Actions logs for details.\n'; + if (artifactLinks) { - body += `\n## Build artifacts to test\n(Available before failure)\n\n${artifactLinks}\n`; + body += '\n## Build artifacts to test\n\n(Available before failure)\n\n' + artifactLinks + '\n'; } - body += `\n> *Note: Screenshots are not generated on failed builds. Below are the latest screenshots from the \`pr-screenshots\` branch, if they exist.*\n\n## Screenshots\n${screenshotsSection}`; + + body += '\n> *Note: Screenshots are not generated on failed builds. Below are the latest screenshots from the `pr-screenshots` branch, if they exist.*\n\n## Screenshots\n\n' + screenshotsSection; } From 8d1ffbc708f4d8da1844bca2b0ebce8096348b9b Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sat, 19 Sep 2026 17:42:22 +0530 Subject: [PATCH 10/11] Update main.dart --- lib/main.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 2667fc6b1..32c77b929 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -38,6 +38,7 @@ import 'package:pslab/view/soundmeter_screen.dart'; import 'package:pslab/view/thermometer_screen.dart'; import 'package:pslab/view/wave_generator_screen.dart'; import 'package:pslab/view/experiments_screen.dart'; +import 'package:pslab/view/oled_display_screen.dart'; import 'constants.dart'; import 'package:pslab/src/rust/frb_generated.dart'; @@ -89,7 +90,7 @@ class MyApp extends StatelessWidget { AppLocalizations? appLocalizations; _preCacheImages(context); return ScreenUtilInit( - designSize: const Size(362, 690), + designSize: const Size(360, 690), builder: (context, child) { return Consumer( builder: (context, provider, child) { From 361a39f19e0efab4b7f46858e22b9c1e23c7420d Mon Sep 17 00:00:00 2001 From: Rahul Das Date: Sun, 20 Sep 2026 19:41:49 +0530 Subject: [PATCH 11/11] Refactor screenshot update logic in workflow --- .github/workflows/pull-request-comment.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pull-request-comment.yml b/.github/workflows/pull-request-comment.yml index 4df640340..7ef128c91 100644 --- a/.github/workflows/pull-request-comment.yml +++ b/.github/workflows/pull-request-comment.yml @@ -81,14 +81,11 @@ jobs: - name: Update PR Screenshots shell: bash run: | - # Only run git commands if we actually downloaded screenshots if [ -d "screenshots" ] && [ "$(ls -A screenshots 2>/dev/null)" ]; then git config --global user.name "github-actions[bot]" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - # Try to clone. If the branch doesn't exist yet, initialize it automatically. if ! git clone --branch=pr-screenshots --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} pr-screenshots; then - echo "Branch pr-screenshots not found. Creating a new one." mkdir pr-screenshots cd pr-screenshots git init @@ -122,8 +119,6 @@ jobs: git branch -D pr-screenshots || true git branch -m pr-screenshots git push --force origin pr-screenshots - else - echo "No screenshots found to process. Skipping." fi - name: Update PR Comment @@ -146,7 +141,6 @@ jobs: if (!ignoredArtifacts.includes(artifact.name)) { const url = `https://github.com/${owner}/${repo}/actions/runs/${{ github.event.workflow_run.id }}/artifacts/${artifact.id}`; - // Map raw artifact names to pretty platform names let platformName = artifact.name; if (artifact.name.includes('apk-files')) platformName = 'Android'; else if (artifact.name.includes('iOS IPA')) platformName = 'iOS'; @@ -213,20 +207,16 @@ jobs: `; - let body = 'Build Status: '; - + let body = `**Build Status:** `; if (conclusion === 'success') { - body += 'Build successful.\n\n## Build artifacts to test\n\n' + (artifactLinks || '_No artifacts uploaded._') + '\n\n## Screenshots\n\n' + screenshotsSection; + body += `Build successful.\n\n## Build artifacts to test\n\n${artifactLinks || '_No artifacts uploaded._'}\n\n## Screenshots\n\n${screenshotsSection}`; } else { - body += 'Build workflow failed. Please check the Actions logs for details.\n'; - + body += `Build workflow failed. _Please check the Actions logs for details._\n`; if (artifactLinks) { - body += '\n## Build artifacts to test\n\n(Available before failure)\n\n' + artifactLinks + '\n'; + body += `\n## Build artifacts to test\n\n(Available before failure)\n\n${artifactLinks}\n`; } - - body += '\n> *Note: Screenshots are not generated on failed builds. Below are the latest screenshots from the `pr-screenshots` branch, if they exist.*\n\n## Screenshots\n\n' + screenshotsSection; + body += `\n> *Note: Screenshots are not generated on failed builds. Below are the latest screenshots from the \`pr-screenshots\` branch, if they exist.*\n\n## Screenshots\n\n${screenshotsSection}`; } - const comments = await github.rest.issues.listComments({ owner,