UOM Assistant Frontend: UI Component Specifications
This document outlines the design specifications, styling variables, parsing algorithms, and deep-linking integrations of the frontend components in the UOM Assistant.1. Onboarding & Settings Panel (ConfigModal)
- File Path:
frontend/uom-translator-ui/components/config-modal.tsx - Component:
ConfigModal
1.1 Default Configuration Object
When no user configuration is present in the environment variables (server side, so not readable by the client), the application falls back to defaults tuned for local deployment:1.2 Mount & Saving Lifecycle
- On Mount: Checks for the existence of
localStorage.getItem("uom_translator_config"). If found, it parses the JSON and merges it over the default state object:setConfig({ ...appContext.defaultUomGraphContext, ...JSON.parse(saved) }). - On Save: Encodes variables into the storage keys and sets the onboarding flag to prevent automatic popups on subsequent visits:
2. Daytona Remote IDE Connection Gateway (IdeLink)
- File Path:
frontend/uom-translator-ui/components/ide-link.tsx - Component:
IdeLink
2.1 API Data Acquisition Flow
Connecting an IDE to an active Daytona sandbox involves the following steps:- Metadata Inspection: Fetches container state for the active framework by sending a GET request to
/sandboxes/framework/${activeFramework}. - Credential Provisioning: Dispatches a POST request to
/sandbox/${id}/ssh-tokento provision temporary connection credentials. The API returns the connection command and token: - Context Switching: Triggers platform updates to sync target framework details (.NET vs Java compiler environments).
2.2 SSH Connection Command Parser
The component uses a regular expression to parse the raw SSH command and extract the connection details:2.3 Deep-Linking Protocols
The extracted credentials are mapped to deep-link protocols:- VS Code:
vscode://vscode-remote/ssh-remote+${user}@${host}:${port}/sandbox - Cursor:
cursor://vscode-remote/ssh-remote+${user}@${host}:${port}/sandbox
3. Auto-Scroll JSON Tree Visualizer (AutoScrollJsonViewer)
- File Path:
frontend/uom-translator-ui/components/json-viewer.tsx - Component:
AutoScrollJsonViewer
@uiw/react-json-view.
3.1 Pinned Scrolling & MutationObserver
To keep the viewport aligned with streaming content, the component uses aMutationObserver combined with a pinning reference to prevent closures from losing scroll state during updates:
3.2 Value Change Hook
If new data is received while pinned, the component scrolls the viewport to the bottom:3.3 Scroll Threshold Check
If the user scrolls up past a 15px threshold, auto-scrolling is disabled to allow manual inspection:4. Markdown & Partial JSON Parsers (StreamdownText & MarkdownText)
- File Paths:
streamdown, react-markdown, and react-shiki syntax highlighter.
4.1 Partial JSON Parsing Algorithm
To display streaming JSON code blocks before they are fully generated, the syntax highlighter uses a partial JSON decoder (partial-json package) to close open braces and quotes on-the-fly, rendering the result as an interactive tree:4.2 Shiki Syntax Highlighter
Non-JSON blocks are styled usingreact-shiki with dual theme support (github-light and github-dark presets), matching the user’s active theme.
5. Reasoning drawers (Reasoning)
- File Path:
frontend/uom-translator-ui/components/assistant-ui/reasoning.tsx - Component:
Reasoning
5.1 Scroll Lock During Streaming
To prevent page jumpiness while reasoning text is streaming in, the component locks the scroll position to the bottom of the viewport using theuseScrollLock hook:
- Operation: Locks the viewport scroll while the drawer expands, keeping the text readable during generation.