Skip to content

feat(docs): polish default Redoc theme — Inter + JetBrains Mono, optional override#3687

Merged
PierreBrisorgueil merged 1 commit into
masterfrom
feat/docs-redoc-theme-polish
May 21, 2026
Merged

feat(docs): polish default Redoc theme — Inter + JetBrains Mono, optional override#3687
PierreBrisorgueil merged 1 commit into
masterfrom
feat/docs-redoc-theme-polish

Conversation

@PierreBrisorgueil
Copy link
Copy Markdown
Contributor

Summary

  • Replaces default Montserrat/Roboto Redoc fonts with Inter (body + headings) + JetBrains Mono (code)
  • Tighter sidebar spacing (260px width, no uppercase group items), refined right panel (#1a1a1a)
  • Logo wired from config.app.url (href) + optional config.app.logo (url) via info.x-logo
  • Downstream projects deep-merge their own Redoc theme via config.docs.redocTheme — zero devkit edits required
  • Custom CSS slot covers what the theme schema cannot (letter-spacing, font-feature-settings, blockquote)

Closes #3686.

Test plan

  • Unit tests cover default theme markers in served HTML (Inter, JetBrains Mono, 260px, #1a1a1a)
  • Unit tests cover x-logo injection in spec (href from config.app.url, url from config.app.logo)
  • Unit tests cover no x-logo when config.app.url absent (regression guard)
  • Unit tests cover config.docs.redocTheme override reaching served HTML (deep-merge verified)
  • Unit tests cover devkit defaults preserved when override is partial
  • Full unit suite: 1479 tests, 0 failing

…onal override

Closes #3686. Default Redoc theme now ships Inter (body + headings) + JetBrains Mono
(code), tighter sidebar spacing, no uppercase group items, refined right panel.
Logo populated from config.app.url (+ optional config.app.logo). Downstream can
deep-merge their own theme via config.docs.redocTheme without devkit edits.

Tests cover (1) default theme markers in served HTML and (2) override deep-merge applied.
Copilot AI review requested due to automatic review settings May 21, 2026 17:21
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Warning

Rate limit exceeded

@PierreBrisorgueil has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 47 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9222d1b3-420b-4ffb-900d-29503b0fe299

📥 Commits

Reviewing files that changed from the base of the PR and between dee7ea5 and 1fcab34.

📒 Files selected for processing (2)
  • lib/services/express.js
  • lib/services/tests/express.docs.unit.tests.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/docs-redoc-theme-polish

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.62%. Comparing base (fd393ac) to head (1fcab34).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3687      +/-   ##
==========================================
+ Coverage   89.61%   89.62%   +0.01%     
==========================================
  Files         139      139              
  Lines        4736     4744       +8     
  Branches     1482     1488       +6     
==========================================
+ Hits         4244     4252       +8     
  Misses        385      385              
  Partials      107      107              
Flag Coverage Δ
integration 59.63% <75.00%> (+0.02%) ⬆️
unit 65.89% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dee7ea5...1fcab34. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil PierreBrisorgueil merged commit da02947 into master May 21, 2026
8 of 9 checks passed
@PierreBrisorgueil PierreBrisorgueil deleted the feat/docs-redoc-theme-polish branch May 21, 2026 17:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the default /api/docs Redoc rendering to use a more polished baseline theme (typography + layout tweaks), adds optional per-project theme overrides via config deep-merge, and injects an optional info.x-logo into the served OpenAPI spec based on config.app.*.

Changes:

  • Add devkit default Redoc theme (Inter + JetBrains Mono, tighter sidebar, darker right panel) and deep-merge config.docs.redocTheme.
  • Inject info.x-logo into the OpenAPI spec when config.app.url is present (with optional config.app.logo).
  • Add unit tests validating theme markers/override propagation and x-logo behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
lib/services/express.js Adds default Redoc theme + optional deep-merge override, injects info.x-logo, and passes theme/CSS into Redoc options.
lib/services/tests/express.docs.unit.tests.js Adds unit tests covering HTML markers for theme defaults/overrides and x-logo injection into /api/spec.json.

Comment on lines +29 to +41
/**
* Build a mock Express app that captures responses for /api/docs and /api/spec.json
*/
const buildMockApp = () => {
const routes = {};
const app = {
get: (path, handler) => {
routes[path] = handler;
},
_routes: routes,
};
return app;
};
Comment on lines +43 to +58
/**
* Trigger the /api/docs route and capture the HTML sent
*/
const callDocsRoute = (app) => {
const handler = app._routes['/api/docs'];
if (!handler) throw new Error('/api/docs route not registered');
let html = null;
const res = {
type: jest.fn(),
send: (body) => {
html = body;
},
};
handler({}, res);
return html;
};
Comment on lines +60 to +70
/**
* Trigger the /api/spec.json route and capture the JSON spec served
*/
const callSpecRoute = (app) => {
const handler = app._routes['/api/spec.json'];
if (!handler) throw new Error('/api/spec.json route not registered');
let spec = null;
const res = { json: (body) => { spec = body; } };
handler({}, res);
return spec;
};
Comment thread lib/services/express.js
Comment on lines 156 to +160
hideDownloadButton: true,
hideSchemaTitles: true,
expandResponses: '200,201',
theme,
customCss: redocCustomCss,
Comment thread lib/services/express.js
Comment on lines 158 to 161
expandResponses: '200,201',
theme,
customCss: redocCustomCss,
},
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.

feat(docs): polish default Redoc theme — reuse config.app.* + optional override

2 participants