Skip to content

[Repo Assist] feat: add status bar item showing phpcbf active/error state#104

Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/feat-status-bar-2026-03-22-a7a2d1abb7af2164
Draft

[Repo Assist] feat: add status bar item showing phpcbf active/error state#104
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/feat-status-bar-2026-03-22-a7a2d1abb7af2164

Conversation

@github-actions
Copy link
Contributor

🤖 This is an automated draft PR from Repo Assist, an AI assistant.

Summary

Adds a status bar item (bottom-right) that gives users immediate visual feedback about the extension state — directly addressing the recurring "Does Nothing!" confusion (#21, #8, #25).

Motivation

Currently there is no visual indication that the phpcbf extension is active for the open PHP file. Users who encounter issues (wrong path, wrong standard, exit-code 0 meaning nothing to fix) see nothing at all and assume the extension is broken. This generates repeated "Does Nothing!" issues.

Many popular VS Code formatters (Prettier, PHP CS Fixer) show a status bar indicator for exactly this reason.

What Changed

extension.js only — no package.json changes required (status bar items do not need a contributes.commands entry):

  • A StatusBarItem is created in activate() and registered as a subscription.
  • updateStatusBarVisibility() shows ✓ phpcbf when the active editor has languageId === "php", hides otherwise.
  • showStatusWarning() flashes ⚠ phpcbf for 4 s after a format failure (promise rejection), then resets to the ready state.
  • The .catch() handler in provideDocumentFormattingEdits calls showStatusWarning() with a hint to enable phpcbf.debug.

User-visible behaviour

Situation Status bar
PHP file is active ✓ phpcbf
Non-PHP file or no file (hidden)
Format failed (ENOENT, exit 3, etc.) ⚠ phpcbf for 4 s, then resets

Trade-offs

  • Adds one item to the status bar (right-aligned, priority 100). This is standard VS Code formatter behaviour.
  • The warning is transient (4 s) to avoid persistent clutter; users who need details should enable phpcbf.debug.

Test Status

✅ All 7 existing unit tests pass (npm run test:unit):

✔ findFiles (4.888057ms)
ℹ tests 7  ℹ pass 7  ℹ fail 0

The full VS Code extension integration test (npm test) requires an X server and is not run in CI on this repo, consistent with all other Repo Assist PRs.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

Adds a status bar item (bottom-right) that:
- Shows '✓ phpcbf' whenever a PHP file is the active editor, giving
  users immediate visual confirmation the extension is loaded and ready.
- Hides automatically when the active file is not PHP.
- Flashes '⚠ phpcbf' for 4 seconds when a format() call fails
  (promise rejects), prompting the user to enable phpcbf.debug.
  After 4 s it resets to the ready state.

No package.json changes required — VS Code status bar items do not
need a contributes.commands entry.

This directly addresses the recurring 'Does Nothing!' confusion (#21,
#8, #25): users can see at a glance whether the extension is active
and whether the last format attempt encountered an error.

Test Status: all 7 unit tests pass (npm run test:unit).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants