From 149591cf5aa1793512ac215f2e68d709ad8526d7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 21 Sep 2026 01:56:25 +0000 Subject: [PATCH 1/4] feat(app): make content font size configurable Log/trace table text was fixed at 12px, so the only way to make it bigger was browser zoom, which scales the chrome too. Add a contentFontSize user preference (sm/md/lg, defaulting to the current sizes) that writes --hdx-content-font-size and --hdx-content-font-size-compact on , and read those vars from the content surfaces: search results table, data tables, expanded row JSON, and chart axes, legends and tooltips. Co-authored-by: Mike Shi --- .changeset/configurable-content-font-size.md | 11 ++++ packages/app/pages/_app.tsx | 18 +++++ .../src/HDXMultiSeriesTableChart.module.scss | 4 ++ packages/app/src/HDXMultiSeriesTableChart.tsx | 5 +- packages/app/src/HDXMultiSeriesTimeChart.tsx | 13 +++- packages/app/src/UserPreferencesModal.tsx | 31 ++++++++- .../src/__tests__/useContentFontSize.test.tsx | 66 +++++++++++++++++++ packages/app/src/components/DBBarChart.tsx | 12 +++- .../app/src/components/DBHistogramChart.tsx | 12 +++- .../src/components/DBTable/TableHeader.tsx | 4 +- .../app/src/components/HyperJson.module.scss | 6 +- packages/app/src/components/Table.module.scss | 4 +- packages/app/src/config/fonts.ts | 25 +++++++ packages/app/src/useUserPreferences.tsx | 26 ++++++++ packages/app/styles/HDXLineChart.module.scss | 4 +- packages/app/styles/LogTable.module.scss | 2 +- packages/app/styles/app.scss | 8 ++- 17 files changed, 231 insertions(+), 20 deletions(-) create mode 100644 .changeset/configurable-content-font-size.md create mode 100644 packages/app/src/__tests__/useContentFontSize.test.tsx diff --git a/.changeset/configurable-content-font-size.md b/.changeset/configurable-content-font-size.md new file mode 100644 index 0000000000..6e12a975bb --- /dev/null +++ b/.changeset/configurable-content-font-size.md @@ -0,0 +1,11 @@ +--- +'@hyperdx/app': minor +--- + +feat: add a content font size preference + +Small text in the log/trace table was not adjustable without browser zoom, which +also shrinks the surrounding chrome. User preferences now carry a **Content font +size** setting (small / medium / large) that scales the search results table, +data tables, expanded row JSON, and chart axes, legends, and tooltips. Small is +the default and matches the previous sizes, so nothing changes until you opt in. diff --git a/packages/app/pages/_app.tsx b/packages/app/pages/_app.tsx index 5102c68acc..cf9233481c 100644 --- a/packages/app/pages/_app.tsx +++ b/packages/app/pages/_app.tsx @@ -29,6 +29,7 @@ import { NextApiConfigResponseData } from '@/types'; import { ConfirmProvider } from '@/useConfirm'; import { SystemColorSchemeScript, + useContentFontSize, useResolvedColorScheme, useUserPreferences, } from '@/useUserPreferences'; @@ -94,6 +95,8 @@ function AppContent({ const { userPreferences } = useUserPreferences(); const resolvedColorScheme = useResolvedColorScheme(); const { themeName } = useAppTheme(); + const { base: contentFontSize, compact: compactContentFontSize } = + useContentFontSize(); // ClickStack theme always uses Inter font - user preference is ignored // HyperDX theme allows user to select font preference @@ -111,6 +114,21 @@ function AppContent({ } }, [effectiveFont]); + useEffect(() => { + // Single write point for the content font size preference; tables and + // chart CSS read these vars (see styles/app.scss for the defaults). + if (typeof document !== 'undefined') { + document.documentElement.style.setProperty( + '--hdx-content-font-size', + `${contentFontSize}px`, + ); + document.documentElement.style.setProperty( + '--hdx-content-font-size-compact', + `${compactContentFontSize}px`, + ); + } + }, [contentFontSize, compactContentFontSize]); + const getLayout = Component.getLayout ?? (page => page); return ( diff --git a/packages/app/src/HDXMultiSeriesTableChart.module.scss b/packages/app/src/HDXMultiSeriesTableChart.module.scss index bd8559a884..f5e3eecc6f 100644 --- a/packages/app/src/HDXMultiSeriesTableChart.module.scss +++ b/packages/app/src/HDXMultiSeriesTableChart.module.scss @@ -4,6 +4,10 @@ // .rowButtons pattern from LogTable.module.scss (lines 156-172), // scoped down to a single icon. See HDX-4405. +.tableWrapper { + font-size: var(--hdx-content-font-size); +} + .tableHeader { // Always-on 1px separator between the sticky header and the rows. An // inset box-shadow rather than a border because the table sets diff --git a/packages/app/src/HDXMultiSeriesTableChart.tsx b/packages/app/src/HDXMultiSeriesTableChart.tsx index 9a48664d92..395dda686e 100644 --- a/packages/app/src/HDXMultiSeriesTableChart.tsx +++ b/packages/app/src/HDXMultiSeriesTableChart.tsx @@ -403,7 +403,10 @@ export const Table = ({ ); return ( -
+
{ @@ -1662,13 +1665,19 @@ export const MemoChart = memo(function MemoChart({ type="number" tickFormatter={xTickFormatter} minTickGap={100} - tick={{ fontSize: 11, fontFamily: 'IBM Plex Mono, monospace' }} + tick={{ + fontSize: axisTickFontSize, + fontFamily: 'IBM Plex Mono, monospace', + }} /> {lines} diff --git a/packages/app/src/UserPreferencesModal.tsx b/packages/app/src/UserPreferencesModal.tsx index 578e784bbb..5b411f621e 100644 --- a/packages/app/src/UserPreferencesModal.tsx +++ b/packages/app/src/UserPreferencesModal.tsx @@ -13,10 +13,18 @@ import { } from '@mantine/core'; import { IconFlask } from '@tabler/icons-react'; -import { OPTIONS_FONTS } from './config/fonts'; +import { + type ContentFontSize, + OPTIONS_CONTENT_FONT_SIZE, + OPTIONS_FONTS, +} from './config/fonts'; import { useAppTheme } from './theme/ThemeProvider'; import { isValidThemeName, themes } from './theme'; -import { UserPreferences, useUserPreferences } from './useUserPreferences'; +import { + useContentFontSize, + UserPreferences, + useUserPreferences, +} from './useUserPreferences'; const OPTIONS_COLOR_MODE = [ { label: 'System', value: 'system' }, @@ -62,6 +70,7 @@ export const UserPreferencesModal = ({ onClose: () => void; }) => { const { userPreferences, setUserPreference } = useUserPreferences(); + const { contentFontSize } = useContentFontSize(); const { themeName, setTheme, isDev } = useAppTheme(); return ( @@ -137,6 +146,24 @@ export const UserPreferencesModal = ({ /> + +