feat: show announcement banners#1018
Merged
Merged
Conversation
723aafb to
9c063da
Compare
mtojek
reviewed
Jul 8, 2026
7fd389c to
819daa9
Compare
819daa9 to
29de019
Compare
- Store seen banners per deployment (coder.seenBanners.<host>) to match the per-deployment key convention and avoid cross-window races - Skip the seen-banner write when keys are unchanged - Reuse errToStr so API error messages surface in refresh failures - Guard against appearance responses missing banner fields - Drop the raw hex color from the announcements QuickPick - Cover the periodic refresh timer with a fake-timers test
Centralize status bar item names and priorities in util/statusBar while preserving each item's pre-registry id and placement. Read the deprecated service_banner only when announcement_banners is absent so modern deployments that mirror the first announcement into it show no duplicates, and derive banner keys from the message alone. Union seen keys instead of overwriting, mark banners seen only when the user could see them, and guard overlapping fetches with a generation counter so stale responses never apply. Open the picker from the popup without refetching, show the empty-state message only after a successful refresh, avoid awaiting non-modal notifications, truncate popup text by code points, and align tests with the setup() factory pattern.
Fixes truncation to break on word boundaries, dedupes banners with identical content, clarifies the empty vs. absent announcement_banners case, guards against showing an empty picker after banners are cleared, and renames "seen" banners to "surfaced" throughout to match what the tracking actually represents.
…colors) Replaces the QuickPick + per-item toast flow with a real Markdown Preview tab (via a TextDocumentContentProvider on an extensionless virtual URI), so the full list renders with working markdown instead of raw syntax. Each banner is boxed in its own div using the deployment's configured background_color when set (matching coder/coder's own dashboard, contrast heuristic included), falling back to the VS Code blockquote theme otherwise; links inside custom-colored boxes inherit the box's text color instead of the theme's link-blue, which can clash. Other changes bundled into this pass: - Status bar hover renders as MarkdownString, capped at 5 banners with a "+N more" pointer to the full preview, lines hard-broken instead of a numbered/bulleted list (indent, implied order). - Popups always show a generic count, never raw (possibly markdown-laden) banner text, since they can't render it and "View" already does. - A warning-colored status bar background flags unsurfaced banners, clearing as soon as the list is opened rather than requiring a fetch. - showAnnouncements() debounces concurrent calls and wraps the load in a window progress indicator. - "seen" terminology renamed to "surfaced" throughout to match what's actually being tracked (shown, not necessarily read). - Fixed a race where a session change mid-refresh could open a blank preview, and centralized error handling so preview/storage failures show a friendly message instead of an unhandled rejection.
Flatten fetch()'s notify branching into guard clauses and drop the redundant manual-path marking (the preview already marks banners surfaced). Merge tryMarkSurfaced into markSurfaced. Follow the codebase pattern for popup action handling: bare .then() without a catch. This surfaced that the message mocks returned undefined instead of a Thenable, so make them resolve like the real API.
afba1e8 to
c9646b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #101
Summary
$(megaphone) Coderor$(megaphone) Coder N.coder.disableNotifications.Coder: View Announcementsquick pick to read full messages.util/statusBarso their relative order lives in one place.Testing
pnpm typecheckpnpm lintpnpm format:checkpnpm test:extensionpnpm buildImplementation notes
announcement_banners[0]into the deprecatedservice_banner, so the latter is only read whenannouncement_bannersis absent (older deployments); nothing is double-counted.coder.disableNotificationsstay eligible for a popup after notifications are re-enabled.agentMetadatakeeps its id and effective priority 0, and items that never had an explicit id stay id-less so users' show/hide preferences survive.SecretsManager), Set a default timeout for REST requests #1024 (default REST timeout; like the other pollers, a hung request currently stalls the announcement poll).Generated by Coder Agents on behalf of @EhabY.
Visuals