feat: new logs terminal - #3302
Open
ppatel9703 wants to merge 7 commits into
Open
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
# Conflicts: # packages/client/src/pages/app/app-detail.constants.ts
This was referenced Aug 4, 2026
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.
Description
Two consumer surfaces for app-owner log visibility, replacing the old single polling-based "Logs" tab entirely: a live-tail Console panel docked in the code workspace next to Terminal, and a searchable Logs page under the app detail nav for historical search. Console talks directly to Monolith's websocket (Monolith#398); Logs talks to a new Semoss reactor (Semoss#2616) via
runQuery. The oldAppLogsPage/GetAppLogs-polling implementation is deleted — the delivery mechanism changed from client-side polling to server-pushed websocket, so that code no longer has anything to call.Changes Made
packages/client/src/components/workspace/panels/workspace-console.tsx(new)Live tail, docked in
code-workspace.tsx's bottom border next to Terminal (component id"console").useInsight()(the same app-scoped insight the whole code workspace shares viaSetContext) to get aninsightId, then opens anInsightWebSocket(@semoss/sdk) directly — not theuseWebSockethook, since that hook only exposes a singlelastMessageslot and a burst of history lines arriving faster than React flushes between them can silently overwrite each other.{"action":"watch","type":"app_logs","projectId":appId}once connected, guarded by a per-effect-invocation closure variable rather than a ref — a ref shared across React 18 dev-mode's mount→cleanup→mount cycle let a stale socket's status callback race the real one and silently suppress thewatch()call.AppLogManager's pattern (timestamp/level/logger/message) for structured, per-field-colored rendering; falls back to the raw string when a line doesn't match.ToggleGroup, both over the already-buffered lines.bg-muted/70 dark:bg-background,text-destructive, Tailwinddark:pairs for level colors) so it follows the app's actual light/dark setting, matching the existingterminal-console.tsxprecedent — not a fixed-dark look.packages/client/src/pages/app/app-logs-page.tsx(rewritten)Searchable historical view under the app detail nav (
Files/Logs/SMSS, owner-restricted). Search box + levelToggleGroup+ paginated table (Time/Level/Source/Message), callingSearchAppLogs(...)viamonolithStore.runQuery— same call pattern the audit log dashboard already uses. No live polling, nooffset/nextOffsetclient-side bookkeeping — the reactor owns pagination viaoffset/limit/hasMore/totalMatches.packages/client/src/utility/parse-app-log-line.ts(new)Shared line-parsing + level-color logic, used by both Console and the Logs page so they render lines identically instead of duplicating the regex/color-mapping twice.
packages/client/src/components/code-workspace/code-workspace.tsxAdds the
"console"tab to the bottom border next to"terminal", plus a cached-layout injection effect (mirrors the existinginsight-explorerone) so the tab appears for users whose FlexLayout state predates it, not just fresh layouts.packages/client/src/components/workspace/panels/index.tsxRe-exports
WorkspaceConsole.How to Test
Liveindicator), shows recent history immediately, and new activity streams in within ~2s.Notes
/insightSocket(live push). Logs page → Semoss'sSearchAppLogsReactor(on-disk search, no DB). Both ultimately read the same file Semoss'sAppLogManagerwrites.app.log's own rotation).Review Updates
Addressed the following from review:
workspace-console.tsx: fixed a level-filter bug — lines that don't match the structured log pattern (parsed aslevel: "OTHER", e.g. multi-line stack traces) or areTRACE-level had no corresponding toggle button, so they were silently and permanently hidden with no way to display them. Non-toggleable levels (OTHER/TRACE) now always render regardless of the active level filter.data-testidto the level-filterToggleGroupItems in bothworkspace-console.tsxandapp-logs-page.tsx, and to the Previous/Next pagination buttons inapp-logs-page.tsx, for consistency with the rest of the file.