Skip to content

[code-simplifier] simplify: merge parallel status switch statements into lookup table in dashboard app.ts #42171

Description

@github-actions

Caution

Protected files were modified in this change.
This pull request is in request_review mode and requires explicit human scrutiny before merge.

Protected files: .github/extensions/agentic-workflows-dashboard/extension.mjs, .github/extensions/agentic-workflows-dashboard/src/app.ts

Targeted simplifications in the recently-added Copilot canvas extension dashboard code.

Files simplified

  • .github/extensions/agentic-workflows-dashboard/src/app.ts
  • .github/extensions/agentic-workflows-dashboard/extension.mjs

Simplifications

src/app.ts

  • Replaced two nearly-identical switch statements (statusClass and stepStatusClass) with a shared LABEL_CLASS lookup table — removes 14 lines of duplication while preserving all type-constrained mappings
  • Simplified 4-element buildStep array in dispatchSelectedWorkflow() to [1, 2, 3, 4].map(i => buildStep(sequence, i, "pending")) — removes repeated literal
  • Simplified this.commandOutput.length === 0 to !this.commandOutput in init() — idiomatic falsy check

extension.mjs

  • Added explicit end variable in paginate() for consistency with web/pagination.js

Behavior

All changes are purely cosmetic — no logic, interface, or runtime behaviour is altered. TypeScript types constrain inputs to statusClass/stepStatusClass so the lookup table never receives out-of-union values.

Source references

  • PR #42137 — Add a Copilot Canvas extension for agentic workflow operations
  • PR #42147 — Add create-canvas skill for cloud agent canvas extension authoring

Validation

The node and make commands are blocked in this sandbox. Changes are mechanical refactors with no behavioral change: the switch-to-lookup transformation preserves all mappings and the end variable is a direct alias for start + pageSize.

Deterministic pre-processing

Used precomputed inputs from /tmp/gh-aw/agent/code-simplifier/ — no additional GitHub API calls were made to discover candidate files or PRs.

Generated by 🔧 Code Simplifier · 154.7 AIC · ⌖ 8.48 AIC · ⊞ 5.6K ·

  • expires on Jun 29, 2026, 9:01 PM UTC-08:00

Note

This was originally intended as a pull request, but the git push operation failed.

Original error: pushSignedCommits: refusing unsigned push for branch 'simplify/dashboard-extension-app-ts-2026-06-29-5a90d6f47939e0b4': Signed-commit payload violates file-protection policy (request_review): .github/extensions/agentic-workflows-dashboard/extension.mjs, .github/extensions/agentic-workflows-dashboard/src/app.ts

Workflow Run: View run details and download bundle artifact

The bundle file is available in the agent artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 28349301375 -n agent -D /tmp/agent-28349301375

# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-28349301375/aw-simplify-dashboard-extension-app-ts-2026-06-29.bundle refs/heads/simplify/dashboard-extension-app-ts-2026-06-29:refs/bundles/create-pr-simplify-dashboard-extension-app-ts-2026-06-29-5a90d6f47939e0b4-5406d7d0
git update-ref refs/heads/simplify/dashboard-extension-app-ts-2026-06-29-5a90d6f47939e0b4 refs/bundles/create-pr-simplify-dashboard-extension-app-ts-2026-06-29-5a90d6f47939e0b4-5406d7d0
git checkout simplify/dashboard-extension-app-ts-2026-06-29-5a90d6f47939e0b4
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-simplify-dashboard-extension-app-ts-2026-06-29-5a90d6f47939e0b4-5406d7d0

# Push the branch to origin
git push origin simplify/dashboard-extension-app-ts-2026-06-29-5a90d6f47939e0b4

# Create the pull request
gh pr create --title '[code-simplifier] simplify: merge parallel status switch statements into lookup table in dashboard app.ts' --base main --head simplify/dashboard-extension-app-ts-2026-06-29-5a90d6f47939e0b4 --repo github/gh-aw

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions