Skip to content

feat: Allow customizing empty-period fill value#1617

Merged
kodiakhq[bot] merged 2 commits intomainfrom
drew/chart-display-settings
Jan 21, 2026
Merged

feat: Allow customizing empty-period fill value#1617
kodiakhq[bot] merged 2 commits intomainfrom
drew/chart-display-settings

Conversation

@pulpdrew
Copy link
Contributor

@pulpdrew pulpdrew commented Jan 16, 2026

Closes HDX-3220
Closes HDX-1718
Closes HDX-3205

Summary

This PR adds an option that allows users to customize the 0-fill behavior on time charts. The default behavior remains to fill all empty intervals with 0. The user can now disable the filling behavior. When fill is disabled, series will appear to be interpolated.

This PR also consolidates various display settings into a drawer, replacing the existing Number Format drawer. In the process, various form-related bugs were fixed in the drawer, and micro/nano second input factors were added.

New Chart Display Settings Drawer

Screenshot 2026-01-20 at 9 10 59 AM

Zero-fill behavior

Enabled (default):

Screenshot 2026-01-20 at 9 12 45 AM

Disabled:

Screenshot 2026-01-20 at 9 12 37 AM

@changeset-bot
Copy link

changeset-bot bot commented Jan 16, 2026

🦋 Changeset detected

Latest commit: 5621c37

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview, Comment Jan 21, 2026 10:13pm

Request Review

@claude
Copy link

claude bot commented Jan 16, 2026

PR Review: Custom Empty-Period Fill Value

Critical Issues

Missing validation for custom fill values → The UI hardcodes fillNulls to 0 or false, but the type allows number | false. Add UI support for custom numeric values or restrict the type.

⚠️ Inconsistent logic in shouldFillNullsWithZero → Function name suggests zero-fill but actually checks if filling is enabled (ChartUtils.tsx:1162-1167). Rename to shouldFillNulls or change implementation.

⚠️ Missing data re-fetch on settings change → Removed useEffect hooks that triggered searches when alignDateRangeToGranularity and compareToPreviousPeriod changed (DBEditTimeChartForm.tsx:512-538). Settings changes now require manual re-submit. Either restore the effects or document the behavior change.

Code Quality

⚠️ Incomplete test coverage for fillNulls → Tests only cover true/false for generateEmptyBuckets, but the actual type is number | false. Add test for custom numeric fill values if supported.

⚠️ Dead code in test → Factor multiplication test was changed but test name wasn't updated (utils.test.ts:174-182). Either remove the test or fix the assertion to match the intended behavior.

Minor

✅ Good: Consolidated settings into a single drawer improves UX
✅ Good: Added connectNulls to chart for better line continuity
✅ Good: Comprehensive test coverage for new generateEmptyBuckets behavior

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

E2E Test Results

All tests passed • 60 passed • 4 skipped • 752s

Status Count
✅ Passed 60
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 4

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew pulpdrew force-pushed the drew/chart-display-settings branch from b83a111 to 766f981 Compare January 20, 2026 14:09
@pulpdrew pulpdrew marked this pull request as ready for review January 20, 2026 14:17
@pulpdrew pulpdrew requested review from a team and wrn14897 and removed request for a team January 20, 2026 14:20
};

// Factor is only currently available for the time output
const factor = options.output === 'time' ? (options.factor ?? 1) : 1;
Copy link
Member

Choose a reason for hiding this comment

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

style: its better to create an enum for the output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The existing NumberFormat type already ensures that the value of output is one of 5 values, based on a zod schema:

z.enum(['currency', 'percent', 'byte', 'time', 'number'])

Copy link
Member

Choose a reason for hiding this comment

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

saw that. I meant we can create a ts enum and use z.nativeEnum there so we don't need to hardcode a fixed string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I understand. Thanks - I will update that if I come across it again in the future.

Copy link
Member

@wrn14897 wrn14897 left a comment

Choose a reason for hiding this comment

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

Great feature!

@kodiakhq kodiakhq bot merged commit ddc54e4 into main Jan 21, 2026
11 of 12 checks passed
@kodiakhq kodiakhq bot deleted the drew/chart-display-settings branch January 21, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants