Elffuss BraidHub

kikocis/VibeCodeViewer public

300105aa82c9 · 13.9 KiBSourceRawPermalink

VibeCodeViewer — Technical reference

Home / Technical reference · Español

A procedural glass-building city (Three.js) that visualizes a code repository as a sharp, nineties-hacker-style metropolis: cyan wireframes, a circuit-board floor, local-first folder scanning, Git/ownership layers, blast-radius analysis, and visual controls that increase drama without depending on HDR postprocessing.

Product presentation demo

VibeCodeViewer product presentation showing repository topology, navigation, search, Git, ownership, blast radius, themes and guided demo mode

GitHub README rendering is most reliable with animated GIF previews. Click the animation to open the optimized web MP4.

Language support

The application UI is available in Spanish and English.

Highlighted capabilities

Repository → city mapping

Sizing rules:

Hierarchical density lighting

Selecting a file (click or search) lights its cell at full intensity and the light decays level by level outward (×0.56 per hop):

file ▓▓▓▓▓▓ → drawer ▓▓▓▓ → cabinet ▓▓▓ → room ▓▓ → floor ▓ → building ░ → district ·

Lit interior levels receive a subtle volumetric fill. Buildings and districts only light edges and fresnel so the interior remains readable.

Anti-blur recipe

  1. Thin edges in one LineSegments object, with color and opacity tunable from Settings.
  2. Minimal-opacity fresnel glass (α ≈ 0.02 in the face center).
  3. No permanent additive volumes; fills exist only while a level is active.
  4. Direct render by default. The old HDR/bloom composer remains experimental via ?bloom=1 because some drivers produce black screen-space rectangles while orbiting.

Extras

Coloring modes

The top-center selector exposes Basic · Git · Owners · Blast. File color is attenuated through the hierarchy: drawer, room, floor, building, and district.

When a file is selected in Blast mode:

The analysis is cached with key version|path|size|mtime: Node uses .cache/analysis.json; the browser uses IndexedDB. Re-scanning only reanalyzes changed files.

Color themes

The selector displays Theme · …. Full palettes live in src/themes.js; changing theme rebuilds only the city while keeping the model, camera, and selection.

The Opaque Ground button (G) hides basements by writing depth; translucent ground lets you glimpse them.

Visual settings and bloom

The Settings button opens four presets:

Sliders apply live and persist in localStorage under vcc.visualSettings.v1. The HUD shows whether you are using direct render or bloom ×N.

?bloom=1 enables EffectComposer + UnrealBloomPass. It is kept for experimentation but is not the default because some GPU/driver combinations show black rectangles during orbit. Remove bloom from the URL or uncheck Bloom HDR to return to stable mode.

GPU diagnostics

Detection uses the real WebGL renderer exposed by the browser (WEBGL_debug_renderer_info when available). On Windows/WSLg or virtualized layers it may show D3D12 virtual, Mesa, or Microsoft even when the host has an NVIDIA GPU. In that case the app treats it as hardware accelerated but cannot invent the hidden brand.

Useful debug overrides:

Keyboard in the tree

With the tree focused:

Large monorepos

Tested with a real monorepo of about 120k files and 42 first-level districts.

Run

A static server is required because ES modules and import maps do not work from file://:

./serve.sh          # serves on all network interfaces and lists URLs
./serve.sh 9000     # alternate port
# or manually: python3 -m http.server 8137 --bind 0.0.0.0

The File System Access API (Open Folder…) requires a secure context. From another machine on the network use HTTPS or a tunnel; http://localhost works.

No build step is required: Three.js r160 is vendored in vendor/ for offline use.

Regenerate the repository snapshot (src/data.js):

node scan.mjs            # scans the parent folder
node scan.mjs /other/path # scans another tree

Automated visual verification

Use these tools to record orbits and detect black-frame regressions:

# 1. Start the app and a Chromium instance with remote DevTools.
./serve.sh 8137
chromium-browser --headless --disable-gpu-sandbox --no-sandbox \
  --remote-debugging-port=9223 --window-size=2048,1152 about:blank

# 2. Capture an orbit with a theme/preset.
node tools/capture-orbit.mjs \
  --url=http://localhost:8137/ \
  --out=/tmp/vcc-orbit \
  --frames=120 --width=2048 --height=1152 --port=9223 --theme=matrix \
  --visuals='{"exposure":1.24,"brightness":1.08,"contrast":1.28,"saturate":1.65,"lines":1.22,"files":1.35,"glass":1.16,"facades":1.12,"labels":1.45,"ground":1.08,"fog":0.92}'

# 3. Optionally generate a video.
ffmpeg -y -framerate 30 -i /tmp/vcc-orbit/frame-%04d.png \
  -pix_fmt yuv420p /tmp/vcc-orbit.mp4

# 4. Detect black rectangles in an orbit.
python3 tools/detect-black-rects.py /tmp/vcc-orbit

# 5. Detect the case of one screenshot, more sensitive to black windows.
python3 tools/detect-black-rects.py --scan-windows screenshot.png

# 6. Compare a candidate against a stable baseline.
python3 tools/compare-black-regressions.py /tmp/candidate /tmp/baseline

tools/detect-black-rects.py uses Pillow/NumPy instead of OpenCV to avoid new dependencies. It exits with code 1 when bad frames are found.

Test mode: ./serve.sh --test N M [K]

Generates deterministic synthetic src/data.js via tools/gentest.mjs for rendering tests with controlled geometry.

Examples:

./serve.sh --test 2 3
./serve.sh --test 500 8
./serve.sh --test 1000 8 250
./serve.sh --test 1000 4 250
./serve.sh --test 2500 3 2500
./serve.sh --test 9000 9 300
./serve.sh 8200 --test 100 10

Restore the real snapshot with git checkout -- src/data.js or rerun scan.mjs. ./serve.sh --help prints a summary.

Controls

Structure

index.html        HTML shell + importmap
scan.mjs          repository scanner → src/data.js
README.md         Spanish documentation
README.en.md      English documentation
src/
  data.js         tree snapshot (generated)
  i18n.js         Spanish/English UI strings and language persistence
  model.js        hierarchy + layout (nested boxes, urban packing)
  builder.js      scene: HDR edges, fresnel glass, façades, PCB ground
  controls.js     orbit + free flight + camera flights
  ui.js           side tree, search, path, stats, Settings, language selector
  main.js         hierarchical selection, raycast, render, visual settings
tools/
  capture-orbit.mjs             captures orbits via Chrome DevTools Protocol
  detect-black-rects.py         detects black rectangles in frames/screenshots
  compare-black-regressions.py  compares orbits against a visual baseline
vendor/           Three.js r160 + addons (offline)