Skip to content

feat: origin-based namespaces + 10s bucket grid view#5

Merged
muke1908 merged 1 commit intomainfrom
copilot/create-namespace-based-on-origin
Mar 26, 2026
Merged

feat: origin-based namespaces + 10s bucket grid view#5
muke1908 merged 1 commit intomainfrom
copilot/create-namespace-based-on-origin

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

Namespaces were UUID-only and the log viewer had no way to see all log levels side-by-side. This PR ties namespace identity to the connecting origin's hostname and adds a time-bucketed multi-column view.

Origin-based namespaces

Server (server/index.js)

  • Logger connections now derive their namespace from the Origin header hostname (e.g. https://www.domain1.com → namespace www.domain1.com). Falls back to UUID when Origin is absent or unparseable (Node.js clients).
  • activeLoggers: SetactiveLoggerCounts: Map<namespace, number> to support concurrent loggers from the same origin sharing one namespace.
  • UUID_PATH_RENAMESPACE_PATH_RE — accepts both UUID slugs and domain-name slugs, with strict start/end alphanumeric validation to reject degenerate hostnames.

Frontend (App.tsx)

  • getNamespaceFromPath() updated to use the same permissive pattern, enabling viewer routes like /www.domain1.com.

4-column bucket view

New BucketViewer.tsx

  • Groups logs into 10-second windows and renders a sticky-header table: Time Bucket | ERROR | DEBUG | INFO | WARN. Empty cells show n/a. Search filter from FilterBar applies. Auto-scrolls to the latest bucket.

Header.tsx / App.tsx

  • Added a ⊞ Bucket / ☰ List toggle in the header that switches between the new BucketViewer and the existing LogViewer.
10:00:00–10  │ err1, err2  │ debug1       │ n/a   │ n/a
10:00:10–20  │ err3        │ debug2       │ n/a   │ warn1

@muke1908 muke1908 marked this pull request as ready for review March 26, 2026 09:51
@muke1908 muke1908 merged commit cf5113a into main Mar 26, 2026
Sign up for free to 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