Skip to content

feat: add HIDE_UPDATE_BANNER environment variable#2051

Merged
im-adithya merged 3 commits intogetAlby:masterfrom
joelklabo:hide-update-banner
Feb 10, 2026
Merged

feat: add HIDE_UPDATE_BANNER environment variable#2051
im-adithya merged 3 commits intogetAlby:masterfrom
joelklabo:hide-update-banner

Conversation

@joelklabo
Copy link
Copy Markdown
Contributor

@joelklabo joelklabo commented Feb 9, 2026

Summary

  • Adds HIDE_UPDATE_BANNER env var (default: false) that suppresses the version update banner and "What's New" widget
  • Useful for platform operators (e.g. Start9) that provide their own update notification mechanism
  • VSS migration banner is still shown when applicable, regardless of this setting

Changes

  • config/models.go: Add HideUpdateBanner field to AppConfig
  • api/models.go: Add HideUpdateBanner to InfoResponse
  • api/api.go: Pass env value through to response
  • frontend/src/types.ts: Add hideUpdateBanner to InfoResponse
  • frontend/src/hooks/useBanner.tsx: Skip version check when flag is set
  • frontend/src/components/home/widgets/WhatsNewWidget.tsx: Hide widget when flag is set

Usage

HIDE_UPDATE_BANNER=true alby-hub

Closes #2048

Summary by CodeRabbit

  • New Features

    • Added a configuration option to hide the update banner so admins can disable its display.
  • Improvements

    • Banner and "What's New" widget now respect the new hide-setting, preventing the update banner from rendering when disabled.

Add a new HIDE_UPDATE_BANNER env var that allows platform operators
(e.g. Start9) to suppress the built-in version update banner when
they provide their own update notification mechanism.

When set to true, the "What's New" widget is hidden and the header
banner only shows for VSS migration notices. The version comparison
against the Alby API is skipped entirely.

Closes getAlby#2048
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

Adds a HideUpdateBanner configuration flag propagated from backend config -> API -> frontend; frontend banner components now suppress rendering when this flag is true. (≤50 words)

Changes

Cohort / File(s) Summary
Backend Config
config/models.go
Added HideUpdateBanner bool to AppConfig with env tag HIDE_UPDATE_BANNER and default false.
Backend API
api/models.go, api/api.go
Added HideUpdateBanner bool to InfoResponse and set InfoResponse.HideUpdateBanner = api.cfg.GetEnv().HideUpdateBanner in GetInfo.
Frontend Types
frontend/src/types.ts
Added hideUpdateBanner: boolean to InfoResponse interface to match backend payload.
Frontend Banner Logic & Widget
frontend/src/hooks/useBanner.tsx, frontend/src/components/home/widgets/WhatsNewWidget.tsx
Early-return guards updated to skip banner/widget rendering when info.hideUpdateBanner is true; minor comment date update in useBanner.tsx.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I slipped a flag into the stream,
Hide the banner, hush the gleam,
From env to API to view,
Quiet updates, soft and new,
Hops of joy — a stealthy dream 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding a HIDE_UPDATE_BANNER environment variable to suppress update notifications.
Linked Issues check ✅ Passed The PR successfully implements the requirement from #2048 to provide an environment variable allowing operators to hide the version banner.
Out of Scope Changes check ✅ Passed All changes are within scope, except for a minor VSS migration TODO date update (2026-01-01 to 2026-08-01) which appears to be a necessary adjustment unrelated to the primary feature.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@im-adithya im-adithya requested a review from rolznz February 10, 2026 15:11
Copy link
Copy Markdown
Member

@im-adithya im-adithya left a comment

Choose a reason for hiding this comment

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

I changed it so we still show the What's New Widget, also removed the outdated vssMigration check in banner cc @rolznz

@rolznz
Copy link
Copy Markdown
Contributor

rolznz commented Feb 10, 2026

@im-adithya unfortunately not all our subscriptions have moved to VSS yet, so we still should keep this banner.

I think the What's New Widget check might need to be re-added, because there's a CTA which cannot be used to update (this is for Start9 which has their own update and release notes).

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/hooks/useBanner.tsx (1)

14-33: ⚠️ Potential issue | 🔴 Critical

Bug: hideUpdateBanner suppresses the VSS migration banner too.

The early return on line 15 bails out before the VSS migration check runs, so showBanner stays false even when VSS migration is required. This directly contradicts the PR objective that the VSS migration banner must remain visible regardless of the flag.

Move the flag into the version-comparison logic instead of the top-level guard.

🐛 Proposed fix
   React.useEffect(() => {
-    if (!info || !albyInfo || info.hideUpdateBanner || isDismissedRef.current) {
+    if (!info || !albyInfo || isDismissedRef.current) {
       return;
     }

     // vss migration (alby cloud only)
     // TODO: remove after 2026-08-01
     const vssMigrationRequired =
       info.oauthRedirect &&
       !!albyMe?.subscription.plan_code.includes("buzz") &&
       info.vssSupported &&
       !info.ldkVssEnabled;

-    const upToDate =
+    const upToDate = info.hideUpdateBanner ||
       Boolean(info.version) &&
       info.version.startsWith("v") &&
       compare(info.version.substring(1), albyInfo.hub.latestVersion, ">=");

     setShowBanner(!upToDate || vssMigrationRequired);
   }, [info, albyInfo, albyMe?.subscription.plan_code]);

Note: with this approach, when hideUpdateBanner is true, upToDate evaluates to true, so the banner only shows if vssMigrationRequired is also true — matching the stated requirement.

@im-adithya
Copy link
Copy Markdown
Member

Fixed! (Updated the date in TODO to 01-08-2026)

@im-adithya im-adithya merged commit 4353aa4 into getAlby:master Feb 10, 2026
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add environment variable to hide new version banner

3 participants