refactor(ui): split app.ts into 7 small files#13
Merged
Conversation
src/ui/app.ts went from 362 lines doing everything to a 30-line
entry that just bootstraps modules. No behavior change — same
selectors, same handlers, same render output. Verified by running
all 11 UI e2e specs against a docker image built from this branch.
types.ts shared TS types (Monitor, RunLite, MonType, ...)
helpers.ts $, $$, esc, fmtAge, statusClass (deduped from
inline switches in rowFor + detail executions)
api.ts typed fetch wrappers (getMonitors, runMonitor,
createMonitor, importJson, ...)
list.ts renderList + rowFor + tab/click handlers
detail.ts renderDetail + sparkline svg
dialogs.ts Add monitor + Import JSON wiring
app.ts router + setInterval + bootstrap
Also: gitignore the public/ build output (was untracked but not
ignored; the docker image regenerates it via `bun run build:ui`).
4 tasks
samir1498
added a commit
that referenced
this pull request
May 26, 2026
…onsistency (#88) Three small UX fixes batched together. 1. Settings → API keys: clicking "I've copied it" used to be a visual no-op. The reveal-panel host's innerHTML was populated when oneTimeKey was set but never cleared on the next render. Add an explicit `if (!oneTimeKey && host) host.innerHTML = '';` so the panel goes away when dismissed. 2. Import JSON dialog: drop the `www.` from the observeone.com/cli link. Aligns with README (which already uses bare apex) so every operator- facing URL in the repo points at the same canonical host. 3. Heartbeat detail page back-link reads "← back" instead of "← All monitors", matching the other 7 monitor types' detail pages. Test: tests/ui/api-key-dismiss.e2e.spec.ts creates a key, asserts the reveal panel is visible, clicks dismiss, asserts the cleartext element is hidden afterward. Closes friction #13, #31, #32. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/ui/app.tswent from 362 lines doing everything to a 30-line entry that just bootstraps modules.types.tshelpers.tsNo behavior change. Same selectors, same handlers, same render output. The only deduplication is `statusClass()` — the inline status→CSS-class switch that appeared in both `rowFor` and the detail executions row is now one helper.
Verification
What this PR does NOT do
Per agreement: client-side pagination, search, emoji-to-dot cleanup on detail Status card — all coming in the next PR.
Bundle size
11.34 KB (was ~10 KB single-file). The ~1 KB growth is module boilerplate / extra exports.
🤖 Generated with Claude Code