Skip to content

chore(banner): add opt-out#911

Open
avivkeller wants to merge 3 commits into
mainfrom
opt-banner-out
Open

chore(banner): add opt-out#911
avivkeller wants to merge 3 commits into
mainfrom
opt-banner-out

Conversation

@avivkeller

Copy link
Copy Markdown
Member

Ref: nodejs/nodejs.org#9008

Implements the onClose logic needed by nodejs/nodejs.org#9008.

@avivkeller
avivkeller requested a review from a team as a code owner July 17, 2026 22:27
@cursor

cursor Bot commented Jul 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Client-side UI and localStorage only; no auth or server changes. Behavior change: one banner at a time instead of stacking multiple.

Overview
Adds close/dismiss support for remote announcement banners by wiring @node-core/ui-components Banner onClose and persisting opt-out in localStorage (global key banner-dismissal, aligned with nodejs.org).

The old AnnouncementBanner lazy-load path (multiple stacked banners, loadBanners.mjs, related tests/CSS) is removed in favor of a client-only Banner component and useBanners hook that loads the first active banner (global index, then version v{major}), skips dismissed text, and shows again when the banner copy changes.

Layout now renders {CLIENT && <Banner />} instead of RemoteLoadableBanner. @node-core/ui-components is bumped to ^1.7.2; e2e covers the close control and dismissal persistence across reloads.

Reviewed by Cursor Bugbot for commit c604e8c. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Jul 17, 2026 10:38pm

Request Review

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.01%. Comparing base (4f07fee) to head (c604e8c).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
e2e/announcement-banner.spec.js 0.00% 36 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #911      +/-   ##
==========================================
+ Coverage   85.19%   86.01%   +0.82%     
==========================================
  Files         180      188       +8     
  Lines       16570    17179     +609     
  Branches     1514     1540      +26     
==========================================
+ Hits        14116    14776     +660     
+ Misses       2444     2396      -48     
+ Partials       10        7       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 93e4f67. Configure here.

Comment thread src/generators/web/ui/components/Banner.jsx
Comment thread src/generators/web/ui/hooks/useBanners.mjs
Comment thread src/generators/web/ui/hooks/useBanners.mjs
Comment thread src/generators/web/ui/hooks/useBanners.mjs
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

api-links Generator

Performance

Metric Base Head Diff
Elapsed time 1.28 s 1.14 s -140.00 ms (-10.94%)
User CPU time 2.75 s 2.12 s -630.00 ms (-22.91%)
System CPU time 340.00 ms 310.00 ms -30.00 ms (-8.82%)
Peak resident memory 348.51 MB 364.05 MB +15.54 MB (+4.46%)

legacy-html Generator

Performance

Metric Base Head Diff
Elapsed time 12.46 s 19.47 s +7.01 s (+56.26%)
User CPU time 39.93 s 62.17 s +22.24 s (+55.70%)
System CPU time 1.60 s 2.47 s +870.00 ms (+54.38%)
Peak resident memory 2.33 GB 2.28 GB -46.90 MB (-1.97%)

legacy-json Generator

Performance

Metric Base Head Diff
Elapsed time 10.23 s 8.43 s -1.80 s (-17.60%)
User CPU time 27.83 s 25.71 s -2.12 s (-7.62%)
System CPU time 2.06 s 2.04 s -20.00 ms (-0.97%)
Peak resident memory 1.69 GB 1.66 GB -36.90 MB (-2.13%)

llms-txt Generator

Performance

Metric Base Head Diff
Elapsed time 7.74 s 7.67 s -70.00 ms (-0.90%)
User CPU time 23.79 s 23.64 s -150.00 ms (-0.63%)
System CPU time 1.32 s 1.98 s +660.00 ms (+50.00%)
Peak resident memory 1.57 GB 1.64 GB +71.20 MB (+4.43%)

orama-db Generator

Output size

| File | Base | Head | Diff |

|-|-|-|-|

| orama-db.json | 8.90 MB | 8.89 MB | -1.33 KB (-0.01%) |

Performance

Metric Base Head Diff
Elapsed time 8.38 s 9.11 s +730.00 ms (+8.71%)
User CPU time 23.44 s 24.15 s +710.00 ms (+3.03%)
System CPU time 1.44 s 1.95 s +510.00 ms (+35.42%)
Peak resident memory 1.59 GB 1.64 GB +44.43 MB (+2.73%)

web Generator

Output size

| File | Base | Head | Diff |

|-|-|-|-|

| styles.css | 141.88 KB | 144.52 KB | +2.64 KB (+1.86%) |
| all.html | 21.27 MB | 21.27 MB | -77.00 B (-0.00%) |
| 404.html | 29.88 KB | 29.87 KB | -11.00 B (-0.04%) |
| addons.html | 274.72 KB | 274.71 KB | -11.00 B (-0.00%) |
| assert.html | 347.03 KB | 347.02 KB | -11.00 B (-0.00%) |
| async_context.html | 191.78 KB | 191.77 KB | -11.00 B (-0.01%) |
| async_hooks.html | 162.94 KB | 162.93 KB | -11.00 B (-0.01%) |
| buffer.html | 955.22 KB | 955.21 KB | -11.00 B (-0.00%) |
| child_process.html | 404.88 KB | 404.87 KB | -11.00 B (-0.00%) |
| cli.html | 518.94 KB | 518.93 KB | -11.00 B (-0.00%) |
| cluster.html | 204.12 KB | 204.11 KB | -11.00 B (-0.01%) |
| console.html | 149.79 KB | 149.78 KB | -11.00 B (-0.01%) |
| crypto.html | 1.20 MB | 1.20 MB | -11.00 B (-0.00%) |
| debugger.html | 100.67 KB | 100.66 KB | -11.00 B (-0.01%) |
| deprecations.html | 513.71 KB | 513.70 KB | -11.00 B (-0.00%) |
| dgram.html | 219.14 KB | 219.13 KB | -11.00 B (-0.00%) |
| diagnostics_channel.html | 329.92 KB | 329.91 KB | -11.00 B (-0.00%) |
| dns.html | 319.61 KB | 319.60 KB | -11.00 B (-0.00%) |
| documentation.html | 37.93 KB | 37.92 KB | -11.00 B (-0.03%) |
| domain.html | 106.45 KB | 106.44 KB | -11.00 B (-0.01%) |
| dtls.html | 161.34 KB | 161.33 KB | -11.00 B (-0.01%) |
| embedding.html | 59.32 KB | 59.31 KB | -11.00 B (-0.02%) |
| environment_variables.html | 43.93 KB | 43.92 KB | -11.00 B (-0.02%) |
| errors.html | 495.92 KB | 495.91 KB | -11.00 B (-0.00%) |
| esm.html | 158.92 KB | 158.91 KB | -11.00 B (-0.01%) |
| events.html | 478.85 KB | 478.84 KB | -11.00 B (-0.00%) |
| ffi.html | 143.96 KB | 143.95 KB | -11.00 B (-0.01%) |
| fs.html | 1.66 MB | 1.66 MB | -11.00 B (-0.00%) |
| globals.html | 236.61 KB | 236.60 KB | -11.00 B (-0.00%) |
| http.html | 815.67 KB | 815.66 KB | -11.00 B (-0.00%) |
| http2.html | 837.99 KB | 837.97 KB | -11.00 B (-0.00%) |
| https.html | 154.81 KB | 154.80 KB | -11.00 B (-0.01%) |
| index.html | 40.39 KB | 40.38 KB | -11.00 B (-0.03%) |
| inspector.html | 179.31 KB | 179.29 KB | -11.00 B (-0.01%) |
| intl.html | 58.03 KB | 58.02 KB | -11.00 B (-0.02%) |
| module.html | 349.32 KB | 349.31 KB | -11.00 B (-0.00%) |
| modules.html | 185.39 KB | 185.38 KB | -11.00 B (-0.01%) |
| n-api.html | 811.89 KB | 811.88 KB | -11.00 B (-0.00%) |
| net.html | 455.71 KB | 455.70 KB | -11.00 B (-0.00%) |
| os.html | 151.79 KB | 151.78 KB | -11.00 B (-0.01%) |
| packages.html | 179.02 KB | 179.01 KB | -11.00 B (-0.01%) |
| path.html | 144.96 KB | 144.95 KB | -11.00 B (-0.01%) |
| perf_hooks.html | 408.65 KB | 408.64 KB | -11.00 B (-0.00%) |
| permissions.html | 62.74 KB | 62.73 KB | -11.00 B (-0.02%) |
| process.html | 718.90 KB | 718.89 KB | -11.00 B (-0.00%) |
| punycode.html | 64.09 KB | 64.08 KB | -11.00 B (-0.02%) |
| querystring.html | 66.29 KB | 66.28 KB | -11.00 B (-0.02%) |
| quic.html | 823.49 KB | 823.48 KB | -11.00 B (-0.00%) |
| readline.html | 264.42 KB | 264.41 KB | -11.00 B (-0.00%) |
| repl.html | 188.75 KB | 188.74 KB | -11.00 B (-0.01%) |
| report.html | 175.81 KB | 175.80 KB | -11.00 B (-0.01%) |
| single-executable-applications.html | 108.78 KB | 108.77 KB | -11.00 B (-0.01%) |
| sqlite.html | 311.83 KB | 311.82 KB | -11.00 B (-0.00%) |
| stream.html | 922.96 KB | 922.95 KB | -11.00 B (-0.00%) |
| stream_iter.html | 395.34 KB | 395.33 KB | -11.00 B (-0.00%) |
| string_decoder.html | 56.31 KB | 56.30 KB | -11.00 B (-0.02%) |
| synopsis.html | 42.56 KB | 42.55 KB | -11.00 B (-0.03%) |
| test.html | 895.26 KB | 895.25 KB | -11.00 B (-0.00%) |
| timers.html | 139.91 KB | 139.90 KB | -11.00 B (-0.01%) |
| tls.html | 409.38 KB | 409.37 KB | -11.00 B (-0.00%) |
| tracing.html | 85.14 KB | 85.13 KB | -11.00 B (-0.01%) |
| tty.html | 99.22 KB | 99.21 KB | -11.00 B (-0.01%) |
| typescript.html | 53.36 KB | 53.35 KB | -11.00 B (-0.02%) |
| url.html | 364.08 KB | 364.07 KB | -11.00 B (-0.00%) |
| util.html | 735.88 KB | 735.87 KB | -11.00 B (-0.00%) |
| v8.html | 359.11 KB | 359.09 KB | -11.00 B (-0.00%) |
| vfs.html | 84.80 KB | 84.79 KB | -11.00 B (-0.01%) |
| vm.html | 395.92 KB | 395.91 KB | -11.00 B (-0.00%) |
| wasi.html | 71.60 KB | 71.59 KB | -11.00 B (-0.02%) |
| webcrypto.html | 600.95 KB | 600.94 KB | -11.00 B (-0.00%) |
| webstreams.html | 398.21 KB | 398.20 KB | -11.00 B (-0.00%) |
| worker_threads.html | 394.00 KB | 393.99 KB | -11.00 B (-0.00%) |
| zlib.html | 376.37 KB | 376.36 KB | -11.00 B (-0.00%) |

Performance

Metric Base Head Diff
Elapsed time 77.88 s 73.83 s -4.05 s (-5.20%)
User CPU time 161.49 s 155.65 s -5.84 s (-3.62%)
System CPU time 4.90 s 4.92 s +20.00 ms (+0.41%)
Peak resident memory 5.59 GB 5.37 GB -228.37 MB (-3.99%)

@bmuenzenmeyer bmuenzenmeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Functionally works, but I want to align on how to move through this change management.

@@ -0,0 +1,5 @@
---
'@node-core/doc-kit': patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is a breaking change

https://github.com/nodejs/learn/blob/main/components/Layout/index.jsx#L3

Suggested change
'@node-core/doc-kit': patch
'@node-core/doc-kit': major

@avivkeller avivkeller Jul 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

My concern with making this a major is that we will have tens of doc-kit releases as we adapt the code base. we will need to make a lot of changes (which may be breaking) for Node.js Core to adopt this project.

I think we either:

  1. Accept that doc-kit will have many major releases throughout it's development
  2. Wait for Node Core to adopt this project, then begin following semver
  3. Make all of the changes required by node core, and any other breaking changes (e.g. monorepo) and release doc-kit 2.0, begin following semver with that release

Not sure?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Personally, I think we treat doc-kit v1.0 as our "beta", and make doc-kit 2.0 the first release to follow semver.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i am fine with that - but we need to coordinate changes then. we dont necessarily know all of our customers. we THINK we do right now, and the list is already like 5 places

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.

2 participants