Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b69d25b
feat: add optional NEXT_PUBLIC_INSTANCE_LABEL suffix to brand name
arj22 Sep 30, 2026
a54727f
fix: scope instance label to tab title only, not brand copy
arj22 Sep 30, 2026
b5faf7b
Merge remote-tracking branch 'upstream/main' into feat/instance-label
arj22 Sep 30, 2026
9c76c83
feat: also show instance label in sidebar wordmark, cap at 9 chars
arj22 Sep 30, 2026
6a7e5bb
fix: address review findings on sidebar instance label
arj22 Sep 30, 2026
ebd4ada
fix: prevent runaway title-observer loop, slice label by code point
arj22 Sep 30, 2026
281ce4e
fix: address deep-review P2s - debug snapshot and test coverage
arj22 Sep 30, 2026
ab650fa
Merge branch 'main' into feat/instance-label
arj22 Sep 30, 2026
b6da722
docs: note the sidebar label only shows when expanded
arj22 Sep 30, 2026
320bb23
Merge remote-tracking branch 'origin/feat/instance-label' into feat/i…
arj22 Sep 30, 2026
e018165
fix: address Brandon's review comments on instance label
arj22 Oct 5, 2026
8a6959f
docs: fix stale 7-char claim in changeset, note UTC replacement
arj22 Oct 5, 2026
d9fbfc4
fix: address claude-code-review and deep-review findings
arj22 Oct 5, 2026
7343e1e
fix: title SSR regression from array children
arj22 Oct 5, 2026
02dd79d
refactor: remove title-suffix MutationObserver, set titles directly
arj22 Oct 6, 2026
223a717
Merge remote-tracking branch 'upstream/main' into feat/instance-label
arj22 Oct 6, 2026
f745794
fix: address review findings on the observer-removal commit
arj22 Oct 6, 2026
b31ecf9
Fold getTitleSuffix into a plain config constant, fix two regressions
arj22 Oct 6, 2026
261ccb8
Shrink InstanceLabel's maxWidth to guarantee it fits the sidebar header
arj22 Oct 6, 2026
70f0be1
Mock env() by key in instance-label tests
arj22 Oct 6, 2026
c0da581
Merge branch 'main' into feat/instance-label
brandon-pereira Oct 6, 2026
43dbb15
Fix stylelint: blank line before comment in AppNav.module.scss
arj22 Oct 6, 2026
e542aba
Add usePageTitle hook, consolidate page <title> composition
arj22 Oct 6, 2026
8caf5ba
Fix usePageTitle doc example, add unit test coverage
arj22 Oct 6, 2026
881cd36
Fix e2e dashboard-rename title assertion for new separator
arj22 Oct 6, 2026
d56d920
Merge branch 'main' into feat/instance-label
brandon-pereira Oct 6, 2026
01e667f
Merge branch 'main' into feat/instance-label
kodiakhq[bot] Oct 6, 2026
c0a220d
Merge branch 'main' into feat/instance-label
kodiakhq[bot] Oct 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/instance-label-brand-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@hyperdx/app': patch
---

feat: add optional `NEXT_PUBLIC_INSTANCE_LABEL` suffix to the tab title and sidebar

Operators running multiple HyperDX instances (e.g. one per region) can now set `NEXT_PUBLIC_INSTANCE_LABEL` to append a short label to the browser tab title and sidebar, e.g. "HyperDX UK". Empty by default, no behavior change if unset. The sidebar label only shows when the sidebar is expanded, and replaces the UTC badge there when both are set.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ services:
# NEXT_PUBLIC_ENABLE_PROMQL: 'true'
# Uncomment to enable the alert detail page (in development)
# NEXT_PUBLIC_ENABLE_ALERT_DETAILS: 'true'
# Uncomment and set to append a label to the browser tab title, e.g.
# for operators running multiple instances (produces "HyperDX UK")
# NEXT_PUBLIC_INSTANCE_LABEL: 'UK'
DEFAULT_CONNECTIONS:
'[{"name":"Local
ClickHouse","host":"http://ch-server:8123","username":"default","password":""}]'
Expand Down
10 changes: 7 additions & 3 deletions packages/app/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import {
} from '@/config/fonts';
import { ibmPlexMono, inter, roboto, robotoMono } from '@/fonts';
import { fetchServerVersion, installHdxDebug } from '@/hdxDebug';
import { AppThemeProvider, useAppTheme } from '@/theme/ThemeProvider';
import {
AppThemeProvider,
useAppTheme,
usePageTitle,
} from '@/theme/ThemeProvider';
import { ThemeWrapper } from '@/ThemeWrapper';
import { NextApiConfigResponseData } from '@/types';
import { ConfirmProvider } from '@/useConfirm';
Expand Down Expand Up @@ -70,11 +74,11 @@ type AppPropsWithLayout = AppProps & {
// Component that renders Head content requiring user preferences
// Must be rendered inside AppThemeProvider to avoid hydration mismatch
function AppHeadContent() {
const { theme } = useAppTheme();
const title = usePageTitle();

return (
<Head>
<title>{theme.displayName}</title>
<title>{title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="google" content="notranslate" />
<SystemColorSchemeScript />
Expand Down
10 changes: 5 additions & 5 deletions packages/app/src/AlertDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { TimePicker } from '@/components/TimePicker';
import { IS_ALERT_DETAILS_ENABLED } from '@/config';
import { getAlertSourceLabel, getAlertSourceUrl } from '@/utils/alerts';

import { useBrandDisplayName } from './theme/ThemeProvider';
import { usePageTitle } from './theme/ThemeProvider';
import api from './api';
import { withAppNavForSurface } from './layout';
import { useDefaultTimeRange, useNewTimeQuery } from './timeQuery';
Expand Down Expand Up @@ -223,7 +223,6 @@ function AlertDetailBody({ alert }: { alert: AlertsPageItem }) {
}

export default function AlertDetailPage() {
const brandName = useBrandDisplayName();
const router = useRouter();
const alertId =
typeof router.query.alertId === 'string' ? router.query.alertId : undefined;
Expand All @@ -238,6 +237,9 @@ export default function AlertDetailPage() {

const { data, isLoading, isError } = api.useAlert(alertId);
const alert = data?.data;
const title = usePageTitle(
alert ? `${alert.displayName} - Alerts` : 'Alerts',
);

if (!IS_ALERT_DETAILS_ENABLED) {
return null;
Expand All @@ -249,9 +251,7 @@ export default function AlertDetailPage() {
style={{ display: 'flex', flexDirection: 'column', height: '100%' }}
>
<Head>
<title>
{alert ? `${alert.displayName} - Alerts` : 'Alerts'} - {brandName}
</title>
<title>{title}</title>
</Head>
{isLoading && (
<Container size="xl" py="md" w="100%">
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/AlertsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import EmptyState from '@/components/EmptyState';
import { PageHeader } from '@/components/PageHeader';
import { ALERT_STATE_FILTER_OPTIONS } from '@/utils/alerts';

import { useBrandDisplayName } from './theme/ThemeProvider';
import { usePageTitle } from './theme/ThemeProvider';
import api from './api';
import { withAppNav } from './layout';

const SEARCH_DEBOUNCE_MS = 300;

export default function AlertsPage() {
const brandName = useBrandDisplayName();
const title = usePageTitle('Alerts');
const mounted = useMounted();

const [search, setSearch] = useQueryState('search');
Expand Down Expand Up @@ -114,7 +114,7 @@ export default function AlertsPage() {
style={{ display: 'flex', flexDirection: 'column', minHeight: '100%' }}
>
<Head>
<title>Alerts - {brandName}</title>
<title>{title}</title>
</Head>
<PageHeader title="Alerts" />
<div
Expand Down
5 changes: 2 additions & 3 deletions packages/app/src/AuthPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '@mantine/core';
import { IconAt, IconLock } from '@tabler/icons-react';

import { useBrandDisplayName } from './theme/ThemeProvider';
import { useBrandDisplayName, usePageTitle } from './theme/ThemeProvider';
import api from './api';
import * as config from './config';
import LandingHeader from './LandingHeader';
Expand Down Expand Up @@ -56,8 +56,7 @@ export default function AuthPage({ action }: { action: 'register' | 'login' }) {
const registerPassword = api.useRegisterPassword();

const verificationSent = msg === 'verify';

const title = `${brandName} - ${isRegister ? 'Sign up' : 'Login'}`;
const title = usePageTitle(isRegister ? 'Sign up' : 'Login');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — Login/Sign up tab title order flips from 'HyperDX - Login' to 'Login - HyperDX'

The changeset describes the change as appending a suffix with no other effect when unset, but it also reorders the auth titles and switches several pages' – separator to - (e2e DashboardPage.ts had to be updated for this). Either mention this in the changeset or keep these out of this PR. Nothing else checks the auth title (grep for toHaveTitle finds only DashboardPage.ts), so this is a documentation gap, not a test break.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond


useEffect(() => {
// If an OSS user accidentally lands on /register after already creating a team
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/CareersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '@mantine/core';
import { useQuery } from '@tanstack/react-query';

import { INSTANCE_TITLE_SUFFIX } from '@/config';
interface GreenhouseJob {
id: number;
title: string;
Expand Down Expand Up @@ -91,7 +92,7 @@ export default function CareersPage() {
return (
<Container size="md" py="xl">
<Head>
<title>Careers | HyperDX</title>
<title>{`Careers | HyperDX${INSTANCE_TITLE_SUFFIX}`}</title>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — CareersPage builds its title by hand with INSTANCE_TITLE_SUFFIX instead of the new usePageTitle hook

Use const title = usePageTitle('Careers'). That keeps one way of composing titles and drops the hardcoded 'HyperDX'. Once that's done, INSTANCE_TITLE_SUFFIX is only used in ThemeProvider.tsx, so it can become a local there.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional — Careers is about jobs at HyperDX the company, so it should keep saying "HyperDX" even on a white-labeled instance, not switch to the active theme's brand name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — CareersPage builds the brand+suffix title by hand instead of using the new usePageTitle hook

Use const title = usePageTitle('Careers') and <title>{title}</title>. That way this page follows the same brand name, separator and suffix as every other page, and INSTANCE_TITLE_SUFFIX stays internal to ThemeProvider.usePageTitle (no other caller would need it exported).

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional — Careers is about jobs at HyperDX the company, so it should keep saying "HyperDX" even on a white-labeled instance, not switch to the active theme's brand name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — CareersPage hardcodes 'HyperDX' and the suffix instead of using usePageTitle

Either leave this title alone (it is a HyperDX-company careers page, so a deployment's instance label doesn't belong in it) or use usePageTitle('Careers') like every other page. Hand-gluing HyperDX${INSTANCE_TITLE_SUFFIX} with a different | separator leaves a second title-building path that ignores the ClickStack theme name. Also add the missing blank line between the import and interface GreenhouseJob.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

</Head>
<Stack gap="lg">
<Title order={1}>
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/ClickhousePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { DBSqlRowTable } from './components/DBRowTable';
import DBTableChart from './components/DBTableChart';
import OnboardingModal from './components/OnboardingModal';
import { useDashboardRefresh } from './hooks/useDashboardRefresh';
import { useBrandDisplayName } from './theme/ThemeProvider';
import { usePageTitle } from './theme/ThemeProvider';
import { clickhouseSql } from './utils/codeMirror';
import { useConnections } from './connection';
import { useDefaultTimeRange, useNewTimeQuery } from './timeQuery';
Expand Down Expand Up @@ -491,7 +491,7 @@ const DEFAULT_INTERVAL = 'Past 1h';

function ClickhousePage() {
const defaultTimeRange = useDefaultTimeRange(DEFAULT_INTERVAL);
const brandName = useBrandDisplayName();
const title = usePageTitle('ClickHouse Dashboard');
const { colorScheme } = useMantineColorScheme();
const { data: connections } = useConnections();
const [_connection, setConnection] = useQueryState('connection');
Expand Down Expand Up @@ -644,7 +644,7 @@ function ClickhousePage() {
content={
<>
<Head>
<title>ClickHouse Dashboard – {brandName}</title>
<title>{title}</title>
</Head>
<OnboardingModal requireSource={false} />
<Tabs
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/DBChartPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { useAlertSeededChartConfig } from '@/hooks/useAlertSeededChartConfig';
import { useResolvedSourceParam } from '@/hooks/useResolvedSourceParam';
import { withAppNavForSurface } from '@/layout';
import { useSources } from '@/source';
import { useBrandDisplayName } from '@/theme/ThemeProvider';
import { useBrandDisplayName, usePageTitle } from '@/theme/ThemeProvider';
import { useDefaultTimeRange, useNewTimeQuery } from '@/timeQuery';
import { useLocalStorage } from '@/utils';
import { buildInlineAlertPayload } from '@/utils/alerts';
Expand Down Expand Up @@ -211,7 +211,7 @@ const DEFAULT_INTERVAL = 'Past 1h';

function DBChartExplorerPage() {
const defaultTimeRange = useDefaultTimeRange(DEFAULT_INTERVAL);
const brandName = useBrandDisplayName();
const title = usePageTitle('Chart Explorer');
const {
searchedTimeRange,
displayedTimeInputValue,
Expand Down Expand Up @@ -316,7 +316,7 @@ function DBChartExplorerPage() {
return (
<Box data-testid="chart-explorer-page" p="sm">
<Head>
<title>Chart Explorer - {brandName}</title>
<title>{title}</title>
</Head>
<OnboardingModal />
<AIAssistant
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/DBDashboardImportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import {

import SelectControlled from './components/SelectControlled';
import { SourceMultiSelectControlled } from './components/SourceMultiSelect';
import { useBrandDisplayName } from './theme/ThemeProvider';
import { usePageTitle } from './theme/ThemeProvider';
import api from './api';
import { useConnections } from './connection';
import {
Expand Down Expand Up @@ -1189,7 +1189,7 @@ export function Mapping({ input }: { input: DashboardTemplate }) {
}

function DBDashboardImportPage() {
const brandName = useBrandDisplayName();
const title = usePageTitle('Import Dashboard');
const router = useRouter();

// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
Expand All @@ -1209,7 +1209,7 @@ function DBDashboardImportPage() {
return (
<div>
<Head>
<title>Import Dashboard - {brandName}</title>
<title>{title}</title>
</Head>
<Breadcrumbs my="lg" ms="xs" fz="sm">
<Anchor component={Link} href="/dashboards/list" fz="sm" c="dimmed">
Expand Down
8 changes: 3 additions & 5 deletions packages/app/src/DBDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ import { Tags } from './components/Tags';
import useDashboardFilters from './hooks/useDashboardFilters';
import { useDashboardRefresh } from './hooks/useDashboardRefresh';
import useTileSelection from './hooks/useTileSelection';
import { useBrandDisplayName } from './theme/ThemeProvider';
import { usePageTitle } from './theme/ThemeProvider';
import { parseAsJsonEncoded, parseAsStringEncoded } from './utils/queryParsers';
import {
buildDashboardReplaySearchUrl,
Expand Down Expand Up @@ -1890,7 +1890,7 @@ function DBDashboardPage({
isFetching: isFetchingDashboard,
isSetting: isSavingDashboard,
} = dashboardProps;
const brandName = useBrandDisplayName();
const title = usePageTitle(dashboard?.name ? dashboard.name : 'Dashboard');
const confirm = useConfirm();
const {
userPreferences: { isUTC },
Expand Down Expand Up @@ -3226,9 +3226,7 @@ function DBDashboardPage({
const dashboardBody = (
<>
<Head>
<title>
{dashboard?.name ? `${dashboard.name}` : 'Dashboard'} – {brandName}
</title>
<title>{title}</title>
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
</Head>
{!isKioskMode && <OnboardingModal />}
{!isKioskMode && (
Expand Down
10 changes: 5 additions & 5 deletions packages/app/src/DBSearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import {
} from '@/savedSearch';
import { useSearchPageFilterState } from '@/searchFilters';
import { getEventBody, useSource, useSources } from '@/source';
import { useAppTheme, useBrandDisplayName } from '@/theme/ThemeProvider';
import { useAppTheme, usePageTitle } from '@/theme/ThemeProvider';
import {
parseRelativeTimeQuery,
useDefaultTimeRange,
Expand Down Expand Up @@ -1038,7 +1038,6 @@ function DBSearchPageContent() {
// Read again here, not passed down: this component re-renders from its own
// query-state hooks without the wrapper, and must see the current path.
const savedSearchId = getSavedSearchIdFromPath();
const brandName = useBrandDisplayName();
const defaultTimeRange = useDefaultTimeRange('Past 15m');

const [rawSearchedConfig, setSearchedConfig] = useQueryStates(queryStateMap);
Expand Down Expand Up @@ -1067,6 +1066,9 @@ function DBSearchPageContent() {
enabled: savedSearchId != null,
},
);
const title = usePageTitle(
savedSearch ? `${savedSearch.name} Search` : 'Search',
);

const { data: sources } = useSources();
const [lastSelectedSourceId, setLastSelectedSourceId] = useLocalStorage(
Expand Down Expand Up @@ -2215,9 +2217,7 @@ function DBSearchPageContent() {
data-testid="search-page"
>
<Head>
<title>
{savedSearch ? `${savedSearch.name} Search` : 'Search'} - {brandName}
</title>
<title>{title}</title>
</Head>
{!IS_LOCAL_MODE && isAlertModalOpen && (
<DBSearchPageAlertModal
Expand Down
8 changes: 4 additions & 4 deletions packages/app/src/DBServiceMapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import SourceSchemaPreview, {
} from './components/SourceSchemaPreview';
import { SourceSelectControlled } from './components/SourceSelect';
import { TimePicker } from './components/TimePicker';
import { useBrandDisplayName } from './theme/ThemeProvider';
import { usePageTitle } from './theme/ThemeProvider';
import { useSources } from './source';
import { useDefaultTimeRange, useNewTimeQuery } from './timeQuery';

Expand Down Expand Up @@ -86,7 +86,7 @@ const searchQueryStateMap = {

function DBServiceMapPage() {
const defaultTimeRange = useDefaultTimeRange(DEFAULT_INTERVAL);
const brandName = useBrandDisplayName();
const title = usePageTitle('Service Map');

const { data: sources } = useSources();
// `?source=` accepts a source name as well as a source ID.
Expand Down Expand Up @@ -224,12 +224,12 @@ function DBServiceMapPage() {
() => (
<>
<Head>
<title>Service Map - {brandName}</title>
<title>{title}</title>
</Head>
<OnboardingModal />
</>
),
[brandName],
[title],
);

const sourceSelect = source ? (
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/JoinTeamPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
TextInput,
} from '@mantine/core';

import { useBrandDisplayName } from './theme/ThemeProvider';
import { usePageTitle } from './theme/ThemeProvider';
import { PasswordCheck } from './PasswordCheck';

export default function JoinTeam() {
const router = useRouter();
const brandName = useBrandDisplayName();
const title = usePageTitle('Join Team');
const { err, reason, token } = router.query;
const [password, setPassword] = useState('');

Expand All @@ -31,7 +31,7 @@ export default function JoinTeam() {

return (
<div className="AuthPage">
<NextSeo title={`Join Team - ${brandName}`} />
<NextSeo title={title} />
<div className="d-flex align-items-center justify-content-center vh-100 p-2">
<div style={{ width: '26rem', maxWidth: '100%' }}>
<div className="text-center mb-4">
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/KubernetesDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { SourceSelectControlled } from './components/SourceSelect';
import { useQueriedChartConfig } from './hooks/useChartConfig';
import { useDashboardRefresh } from './hooks/useDashboardRefresh';
import { useJsonColumns } from './hooks/useMetadata';
import { useBrandDisplayName } from './theme/ThemeProvider';
import { usePageTitle } from './theme/ThemeProvider';
import {
convertV1ChartConfigToV2,
K8S_CPU_PERCENTAGE_NUMBER_FORMAT,
Expand Down Expand Up @@ -1049,7 +1049,7 @@ const DEFAULT_INTERVAL = 'Past 1h';

function KubernetesDashboardPage() {
const defaultTimeRange = useDefaultTimeRange(DEFAULT_INTERVAL);
const brandName = useBrandDisplayName();
const title = usePageTitle('Kubernetes Dashboard');
const { data: sources } = useSources();

const [_logSourceId, setLogSourceId] = useQueryState('logSource');
Expand Down Expand Up @@ -1378,7 +1378,7 @@ function KubernetesDashboardPage() {
const dashboardBody = (
<>
<Head>
<title>Kubernetes Dashboard – {brandName}</title>
<title>{title}</title>
</Head>
<OnboardingModal requireSource={false} />
{metricSource && logSource && (
Expand Down
Loading
Loading