Skip to content

Auth Stability, UI Refinements, and Metrics Tab#197

Merged
chvvkumar merged 16 commits intomainfrom
dev
Apr 19, 2026
Merged

Auth Stability, UI Refinements, and Metrics Tab#197
chvvkumar merged 16 commits intomainfrom
dev

Conversation

@chvvkumar
Copy link
Copy Markdown
Owner

@chvvkumar chvvkumar commented Apr 19, 2026

Summary
This PR resolves several authentication and startup loading issues, refines various user interface elements, and introduces a new Metrics tab for admin users.

Changes

  • Fix stale cache and gate settings fetch on authentication.
  • Simplify onServerReady to reuse initAuth and add a 15-second failsafe.
  • Replace hard window.location redirects with an auth:expired event.
  • Fix startup loading hang by bypassing fetchJson for initial authentication.
  • Right-justify rig selector pills in the session metrics chart.
  • Fix startup loading hang after the server-ready transition.
  • Right-justify rig selector pills in the target metrics chart.
  • Fix Stellarium focus by checking the response body and attempting catalog name first.
  • Fix NINA instances help text.
  • Inline action buttons on the headline stats row.
  • Move action buttons to a right-justified row above thumbnails.
  • Drop NINA/Stellarium prefix from coordinate send buttons.
  • Add NINA and Stellarium coordinate forwarding from session cards.
  • Add a Metrics tab to the Settings page for admins, providing a Prometheus health overview.

Impact

  • Authentication System: Core authentication logic, API client, and server readiness checks are updated.
  • Settings Page: The Settings page structure is modified to include a new Metrics tab, along with updates to settings schemas and providers.
  • Session and Target Detail Pages: UI adjustments for action buttons, rig selector pills, and new coordinate forwarding functionality are implemented.
  • Backend API: New API endpoints are added for integrations and metrics data.
  • Frontend Utilities: New utilities for Prometheus parsing and metrics aggregation are introduced.
  • Nginx Configuration: Nginx configuration is updated, likely for new API routes or metrics proxying.

Add Metrics Tab to Settings Page for Admins
Configurable instances managed from Settings (AstroBin & NINA tab).
Backend proxies requests to NINA framing API and Stellarium remote
control. Stellarium uses name-first lookup with RA/Dec fallback.
Stellarium returns 200 with body "false" when name lookup fails.
Now checks the response text instead of just HTTP status. Also
extracts the catalog designation (e.g. NGC 1499) from compound
names like "NGC 1499 - California Nebula" and tries that first.
onServerReady() called refreshUser() without a timeout, so if the
backend was slow to respond after the health check passed the app
stayed on "Loading..." forever. Added a 5-second timeout matching
initAuth(). Also suppress the hard window.location redirect during
auth initialization to avoid racing with the SolidJS router.
Replace refreshUser()/fetchJson in initAuth and onServerReady with a
direct probeAuth() that uses raw fetch calls. This avoids the shared
refreshPromise, the window.location hard redirect, and any interaction
with the parallel settings/custom-columns resource fetches that also
go through fetchJson's 401 handler. Reverts the suppressAuthRedirect
flag from client.ts since it is no longer needed.
fetchJson's 401 handler was firing window.location.href = "/login"
which caused a full page reload that disrupted the SolidJS app during
initialization. Replace with a CustomEvent that AuthProvider listens
to, clearing the user signal so ProtectedRoute handles the redirect
via client-side navigation instead.
onServerReady now just calls initAuth() instead of duplicating the
probeAuth logic. If the server isn't actually ready yet, initAuth
will cycle back to the startup screen. Added a 15-second failsafe
timer that forces loading=false if auth never completes, preventing
the app from staying stuck on "Loading..." indefinitely.
Add Cache-Control: no-store to index.html so the browser always
fetches a fresh copy after rebuilds, preventing stale JS bundles.

Gate the settings and custom-columns resources on auth state so they
only fire after the user is authenticated. Previously the module-level
createResource in settings.ts fired at import time before auth
resolved, hitting 502 during startup and throwing unhandled errors
that could break the SolidJS reactive system.
Auth Flow Refinements, Startup Fixes, and Integrations
@github-actions github-actions bot changed the title Dev Auth Stability, UI Refinements, and Metrics Tab Apr 19, 2026
@chvvkumar chvvkumar merged commit 21da44d into main Apr 19, 2026
4 checks passed
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.

1 participant