This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the UI bundle project for the Redpanda documentation site. It produces a UI bundle intended for use with Antora, containing HTML templates (Handlebars), CSS, JavaScript, fonts, and site-wide images. The project uses Gulp as its build system.
gulp preview- Build UI and start local preview server at http://localhost:5252 with live reloadgulp build- Build and stage UI assets (without bundling)gulp bundle- Full production build: clean, lint, build WASM, bundle React, compile widgets, and create bundlenpm install- Install dependencies (required after cloning)
gulp lint- Run CSS and JavaScript lintinggulp lint:css- Lint CSS files onlygulp lint:js- Lint JavaScript files onlygulp format- Format JavaScript using prettier-eslint
gulp build:wasm- Build WebAssembly files from Go source (blobl-editor and console-config-migrator)gulp bundle:react- Bundle React components using esbuildnode compile-partial.js <name> <context>- Compile specific Handlebars partials (header, footer, head-bump)
gulp test:build- Build WASM and run Bloblang playground testsgulp test:quick- Run tests with existing WASM (skip rebuild)npm run test:playground- Alias for test:build
The project uses Gulp 4 with task definitions in gulpfile.js and task implementations in gulp.d/tasks/. The build pipeline:
- Clean build directories
- Lint CSS/JS
- Build WebAssembly modules
- Bundle React components with esbuild
- Compile standalone widget partials (header, footer)
- Build main UI assets
- Package into distributable bundle
layouts/- Top-level Handlebars templates (default.hbs, 404.hbs, search.hbs, etc.)partials/- Reusable Handlebars template fragments included by layoutshelpers/- Handlebars helper functions (each .js file exports a single helper)css/- Stylesheets with vendor subdirectoriesjs/- JavaScript files numbered by load order (01-nav.js, 02-on-this-page.js, etc.)js/react/- React components bundled separately with esbuildstatic/- Files copied directly to bundle (WASM files, compiled widgets)font/- Web fontsimg/- Images and iconsui.yml- Defines which static files to include in bundle
Two WASM modules built from Go:
- Bloblang Playground (
blobl-editor/wasm/) - Executes Bloblang mappings in-browser, used by bloblang-playground.hbs partial - Console Config Migrator (
console-config-migrator/) - Migrates Redpanda Console configs from v2 to v3
Both compile to src/static/*.wasm and are automatically built during bundle process.
React components in src/js/react/ are bundled individually using esbuild into IIFE format at src/static/js/*.bundle.js. Currently includes:
AskAI.jsx- AI chat interfacecomponents/ChatInterface.jsx- Chat UI component
The compile-partial.js script compiles specific Handlebars partials into standalone HTML widgets with inlined CSS/JS. These can be embedded in external sites:
- Header widget (header.hbs)
- Footer widget (footer.hbs + 05-mobile-navbar.js)
- Head bump widget (head-bump.hbs)
Context is provided via JSON files in context/ directory.
Layouts select partials to compose pages. Helpers in src/helpers/ provide template logic (e.g., is-beta-feature.js, is-enterprise.js, get-page-info.js). Pages specify layout via page-layout AsciiDoc attribute.
preview-src/ contains AsciiDoc sample pages for testing UI locally. UI model is defined in preview-src/ui-model.yml. Preview pages are built with Asciidoctor and rendered using the UI templates.
gulpfile.js- Main build configuration defining all taskscompile-partial.js- Standalone widget compiler with Handlebars helpersgulp.d/tasks/build.js- Core UI asset build logicgulp.d/tasks/bundle-react.js- React bundling with esbuildsrc/ui.yml- Static files manifestblobl-editor/wasm/go.mod- Go dependencies for Bloblang WASMconsole-config-migrator/go.mod- Go dependencies for config migrator WASM
- Node.js 18+
- Gulp CLI (install globally:
npm install -g gulp-cli) - Go 1.22.3+ (for building WASM modules)
- CSS changes: Edit files in
src/css/, changes auto-reload in preview - JS changes: Edit numbered files in
src/js/, changes auto-reload in preview - Template changes: Edit
.hbsfiles insrc/layouts/orsrc/partials/ - React components: Edit in
src/js/react/, rungulp bundle:reactto rebuild - WASM modules: Edit Go source in
blobl-editor/wasm/orconsole-config-migrator/, rungulp build:wasm - Helper functions: Add/modify files in
src/helpers/, each exports a single Handlebars helper
Always run gulp lint before committing. Fix any linting errors - the bundle task will fail if lint errors exist.
Releases are automated via GitHub Actions. Push a new tag to trigger:
- Bundle creation
- Release publication
- Bundle upload to GitHub releases
The bundle URL pattern: https://github.com/redpanda-data/docs-ui/releases/latest/download/ui-bundle.zip
The Bloblang Playground allows users to interactively execute Bloblang mappings. There are two implementations:
- Standalone page at
/playground.html - Three Ace editors: Input (JSON), Mapping (Bloblang), Output (read-only)
- CSS in
src/css/bloblang-playground.css
- Inline modal triggered by "Try It" buttons on code blocks
- Dynamically created overlay with three Ace editors
- CSS in
src/css/bloblang-interactive.css
Ace Editor Configuration:
wrap: true- Enables word wrapping to prevent horizontal text cutoffminLines: 5- Minimum editor height- Do NOT use
maxLineswith CSSmax-height- they conflict and cause invisible scrollbars - CSS
max-height: 400pxon.editorcontrols height with proper scrolling - Parent containers must NOT have
overflow: hiddenor scrollbars get clipped
Scrollbar Visibility:
macOS overlay scrollbars can be invisible. The CSS explicitly styles .ace_scrollbar-v and .ace_scrollbar-h with width: 12px for visibility.
Testing Changes:
- Always test with large data (50+ items in Input, long mappings with many lines)
- Verify scrollbars appear and function in all three editors
- Run
gulp test:quickto ensure all 19 tests pass - Test both full playground (
/playground.html) and mini playground ("Try It" buttons on/bloblang-syntax-test.html)
src/partials/bloblang-playground.hbs- Full playground template and JS initializationsrc/css/bloblang-playground.css- Full playground stylessrc/js/16-bloblang-interactive.js- Mini playground modal logicsrc/css/bloblang-interactive.css- Mini playground stylesblobl-editor/wasm/- Go source for WASM modulepreview-src/pages/bloblang-syntax-test.adoc- Test page with code blocks