## Problem
The Realtime pages, publications, the Realtime toggle in the table
editor and the Realtime status on the project home are hidden for High
Availability projects outside staging and local. That was a temporary
gate while Realtime on High Availability projects was validated, and the
platform now registers those projects as Realtime tenants.
## Solution
Remove the gate instead of flipping a default. It always resolved to
available once enabled, so keeping `resolveRealtimeUnavailable` and its
second argument would only leave dead code:
- `useHighAvailability.ts`: drop `resolveRealtimeUnavailable` and
`useIsRealtimeUnavailable`.
- `RealtimeLayout`, the two publications pages and `ServiceStatus`: drop
the "unavailable on High Availability projects" states.
`PublicationsAvailability` and `resolveRealtimeServiceStatus` are
deleted.
- `TableEditor`: `TableRealtimeToggle` no longer takes the unavailable
and pending props, and the toggle is never forced off.
- Tests for the removed code are deleted, and the toggle test now covers
the toggle itself.
Whether a project is actually registered as a Realtime tenant is still
decided by the platform, so this should land after the platform change.
## Review instructions
1. On a High Availability project, open Realtime in the sidebar: the
inspector, policies and settings pages load instead of the "unavailable"
empty state.
2. Open Database > Publications: the list loads.
3. Open the table editor's new-table panel: the "Enable Realtime"
checkbox is enabled.
4. On the project home, the Realtime service reports its health check
status instead of "Disabled".
5. A standard (non-High Availability) project looks the same as before.
`pnpm vitest run` on the affected folders passes (28 files, 184 tests).
## What kind of change does this PR introduce?
Feature, limited to staging and local.
## What is the current behavior?
On High Availability projects, Studio always disables Realtime: the
Realtime pages and the Publications pages show an "unavailable" message,
the table editor's "Enable Realtime" checkbox is disabled, and the
project home shows Realtime as disabled.
## What is the new behavior?
A new `useIsRealtimeUnavailable()` hook treats Realtime as unavailable
only on High Availability projects outside staging and local (via
`IS_STAGING_OR_LOCAL`). Those four places use it instead of checking
`high_availability` directly.
- **Production:** unchanged.
- **Staging and local:** Realtime behaves as on standard projects.
## Additional context
Whether a High Availability project is actually registered as a Realtime
tenant is gated separately on the platform side. Until then, the pages
render but Realtime connections for that project fail.
Tests: a new `resolveRealtimeUnavailable` test, and the
`TableRealtimeToggle` and `resolveRealtimeServiceStatus` tests updated
for the renamed parameter.
## Summary
More gating to support upcoming High Availability projects.
- Keep the Recent Branch stat visible on the project home page for HA
projects, but disable its interaction, reduce its opacity, and skip the
branches query.
- Treat Realtime as disabled for HA projects in the service-status
dropdown so it does not make the project appear unhealthy or trigger
unhealthy polling.
- Show the shared unsupported-feature empty state for Custom Domains and
skip its query on HA projects.
- Disable the Enable Realtime checkbox in the table creation sheet for
HA projects.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added High Availability–aware behavior across activity stats, service
status, custom domains, and table realtime controls.
- Introduced reusable Branch value UI that shows an “Unavailable” state
in High Availability mode.
- Added a dedicated realtime toggle UI that disables interaction and
updates helper text when unavailable.
- **Bug Fixes**
- Ensured realtime is treated as disabled (not unhealthy) in High
Availability and prevented realtime enabling/saving.
- Reduced unnecessary data fetching by gating addon/custom-domain
requests and disabling branch queries.
- **Tests**
- Added coverage for realtime status resolution, BranchStatValue
“Unavailable” rendering, and TableRealtimeToggle behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->