Skip to content

refactor: make upgrade notification non-blocking and use bordered box#365

Merged
kfirstri merged 14 commits intomainfrom
claude/plan-update-notifier-XnmbU
Mar 11, 2026
Merged

refactor: make upgrade notification non-blocking and use bordered box#365
kfirstri merged 14 commits intomainfrom
claude/plan-update-notifier-XnmbU

Conversation

@gonengar
Copy link
Contributor

@gonengar gonengar commented Mar 4, 2026

Note

Description

This PR improves the upgrade notification UX by making it distribution-aware and non-blocking. Instead of always showing npm install -g base44@latest, the CLI now detects whether it was installed via npm, Homebrew, or as a standalone binary and shows the appropriate upgrade command. The notification is moved to display after the command completes (rather than before) and is skipped entirely when a command errors.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added Distribution type ("npm" | "binary") and distribution field to CLIContext; binary-entry.ts passes "binary" at startup while npm defaults to "npm"
  • Added detectInstallMethod() to distinguish npm, brew (by checking process.execPath for Homebrew paths), and binary distributions
  • Added getUpgradeInstruction() to return the correct upgrade command per install method (npm install -g base44@latest, brew upgrade base44, or a GitHub releases download link)
  • Refactored upgrade check into startUpgradeCheck() (starts early, in parallel with the command) and printUpgradeNotification() (awaits and displays after command success only)
  • Switched from log.message() to note() for a boxed, more visually distinct notification
  • Split upgrade message into two lines: version diff on the first, install instruction on the second
  • Upgrade notification is skipped when the command throws an error
  • Removed test assertion for hardcoded npm install -g base44@latest text (now distribution-dependent)

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

The upgrade check promise is started immediately after the banner is printed (before the command runs), so the network request runs in parallel with command execution and adds no latency to the notification display.


🤖 Generated by Claude | 2026-03-11 00:10 UTC

…gent hints

Move the upgrade notification to appear after command execution (just before
outro) so it's the last substantive output. Display it in a unicode-bordered
box using log.warn for visual prominence. Add [Agent Hints] section so AI
agents can easily parse the upgrade suggestion.

https://claude.ai/code/session_01GDFqeAimhxEVBWJNLEB96Z
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.44-pr.365.b07a1d8

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.44-pr.365.b07a1d8"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.44-pr.365.b07a1d8"
  }
}

Preview published to npm registry — try new features instantly!

@gonengar gonengar requested a review from kfirstri March 5, 2026 10:06
The command is already displayed in the human-readable lines — the
[Agent Hints] block just duplicated it unnecessarily.

https://claude.ai/code/session_01GDFqeAimhxEVBWJNLEB96Z
Copy link
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude claude bot changed the title Refactor upgrade notification to display in bordered box with agent hints refactor: make upgrade notification non-blocking and use bordered box Mar 9, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Ready in CLI Development Mar 9, 2026
@kfirstri kfirstri force-pushed the claude/plan-update-notifier-XnmbU branch from 781918c to 9884c47 Compare March 11, 2026 17:14
@kfirstri kfirstri merged commit 21e1eea into main Mar 11, 2026
10 checks passed
@kfirstri kfirstri deleted the claude/plan-update-notifier-XnmbU branch March 11, 2026 17:22
@github-project-automation github-project-automation bot moved this from Ready to Done in CLI Development Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants