Skip to content

Web API, compilation and new improved web interface. - #1

Open
boludoz wants to merge 2 commits into
encounter:mainfrom
boludoz:main
Open

Web API, compilation and new improved web interface.#1
boludoz wants to merge 2 commits into
encounter:mainfrom
boludoz:main

Conversation

@boludoz

Copy link
Copy Markdown
{8D1579E9-67F6-4E34-85DB-D40F21A823B7}

CopilotAI review requested due to automatic review settings August 1, 2026 07:16
@boludoz

Copy link
Copy Markdown
Author
image

@boludoz

Copy link
Copy Markdown
Author

Automated compilation has been added; search has been fixed and improved.

CopilotAI 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.

Pull request overview

This PR significantly expands objdiff-web from a webview-focused UI into a standalone web experience by adding an HTTP API server, shared rendering utilities, and a revamped UI workflow (search, symbol navigation, sidebar) to support faster iteration and better discoverability.

Changes:

  • Added a standalone ESM HTTP API server (server/) with OpenAPI + agent instructions, symbol search, diff renderers (text/html/json), and optional build/watch capabilities.
  • Introduced a unified search UX (SearchBar, percent badges, symbol palette, project-wide symbol search results) and integrated it into Units/Symbols/Diff views.
  • Refactored instruction/data row rendering into framework-agnostic shared modules (shared/render/*) used by both web UI and server renderers.

Reviewed changes

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

Show a summary per file
FileDescription
webview/views/UnitsView.tsxAdds file filtering UI + project-wide symbol search results section under unit list
webview/views/UnitsView.module.cssMakes units list shrinkable and adds empty-state styling
webview/views/SymbolsView.tsxImplements TS-side symbol filtering + match highlighting + empty-state + count reporting
webview/views/SymbolsView.module.cssAdds styles for search highlighting, section row layout, and empty-state
webview/views/FunctionView.tsxSwitches instruction rendering to shared span renderer + adds data-flow color support
webview/views/FunctionView.module.cssAdds CSS for data-flow spans
webview/views/DiffView.tsxAdds sidebar symbol list when a symbol is open, header SearchBar, percent badge, symbol palette
webview/views/DiffView.module.cssAdds sidebar layout styles
webview/views/DataView.tsxSwitches data rendering to shared span renderer
webview/util/symbolSearch.tsNew shared symbol filtering + range-splitting helpers for highlighting
webview/state.tsAdds persistent search options/state; refactors diff-config application; improves state serialization
webview/mock.tsEnhances dev mock to fetch config safely and optionally POST /api/build for browser builds
webview/common/SymbolSearchResults.tsxNew debounced project-wide symbol search results via /api/symbols
webview/common/SymbolSearchResults.module.cssStyles for symbol search results list
webview/common/SymbolPalette.tsxNew Ctrl+P / Ctrl+Shift+O command-palette style “go to symbol” overlay
webview/common/SymbolPalette.module.cssStyles for symbol palette overlay
webview/common/Sidebar.tsxNew resizable/collapsible sidebar component with Ctrl+B toggle
webview/common/Sidebar.module.cssStyles for sidebar layout + resizer
webview/common/SearchBar.tsxNew debounced search bar with mode/case/% toggles and result/error display
webview/common/SearchBar.module.cssStyles for SearchBar, toggles, status row
webview/common/PercentBadge.tsxNew percent badge component with optional progress bar
webview/common/PercentBadge.module.cssStyles for percent badge + bar
webview/App.tsxDisplays configuration-load errors in the UI (dev server)
webview/App.cssAdds shared CSS variables and styles for pre/code blocks + percent track
shared/render/data.tsNew shared data-row span renderer used by UI/server
shared/render/asm.tsNew shared instruction-row span renderer + helpers
shared/package.jsonMarks shared as ESM for server-side direct imports
shared/messages.tsAdds configError field to state message
shared/fuzzy.tsAdds fuzzy matching utilities (including symbol-aware matching)
shared/diff-config.tsNew shared helper to apply config properties to WASM DiffConfig
server/index.tsNew HTTP API server with endpoints for health, units, symbols, diffs, build, file serving, etc.
server/wasm.tsNode loader/bridge for objdiff-wasm (file: fetch support + init)
server/project.tsProject root/config/unit resolution with path-escape protection + object reading
server/symbols.tsSymbol search implementation (used by /api/symbols)
server/openapi.tsServes OpenAPI 3.1 schema at /api/openapi.json
server/instructions.tsServes agent-facing instructions (markdown/json)
server/instructions.mdFull agent usage guide content
server/render/rows.tsServer-side diff row building using shared render spans
server/render/text.tsPlain-text two-column diff renderer
server/render/html.tsSelf-contained HTML diff renderer
server/errors.tsApiError helper for clean HTTP error responses
server/build.tsBuild execution support with serialization + timeout + structured step output
server/watch.tsOptional filesystem watching and rebuild-on-change support
server/desktop-config.tsReads last-used project root from objdiff desktop app settings
server/package.jsonMarks server as ESM so objdiff-wasm (TLA) can load
scripts/dev.mjsRuns API server + web dev server together with /api proxy
rsbuild.config.tsAdds optional /api proxy mode + improves dev file-serving path safety + project-root resolution
package.jsonAdds dev/api scripts for server + combined dev
AGENTS.mdRepository guidance for AI/agent workflows and key architecture notes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadserver/index.ts
Comment on lines +421 to +433
const handle = async (req: IncomingMessage, res: ServerResponse) => {
// Allow agents and the dev server to call this from another origin.
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin');
if (req.method === 'OPTIONS') {
res.writeHead(204).end();
return;
}
const url = new URL(
req.url ?? '/',
`http://${req.headers.host ?? 'localhost'}`,
);
Comment on lines +210 to +215
<span>
No file matches <code>{search}</code>
</span>
<button type="button" onClick={() => setUnitsSearch(null)}>
Clear filter
</button>
@boludoz

Copy link
Copy Markdown
Author
{198FB077-766D-48A4-A0A1-4DED360D7C81}

@boludoz
boludoz marked this pull request as draft August 1, 2026 07:26
@boludoz

boludoz commented Aug 1, 2026

Copy link
Copy Markdown
Author
image

CTRL+P

@boludoz

boludoz commented Aug 1, 2026

Copy link
Copy Markdown
Author

The productivity boost is massive; however, there are two issues: there is no separator for the ASM code, and symbol search (on main screen) isn't working. Bugs in the search function have been fixed.

@boludoz

Copy link
Copy Markdown
Author
image

@boludoz
boludoz marked this pull request as ready for review August 2, 2026 01:15
Sign up for freeto 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

@boludoz