From 06d5211dcf8e3e54bcf673fccd92048eb87e4d24 Mon Sep 17 00:00:00 2001 From: Kev Date: Thu, 12 Nov 2026 15:47:37 -0500 Subject: [PATCH 1/2] fix(explore): Avoid exponent notation breaks heatmap zoom Small numbers were getting turned into e-7 which the filter has no clue what to do with. --- .../utils/setExploreAttributeBounds.spec.tsx | 6 ++++++ .../explore/utils/setExploreAttributeBounds.tsx | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/static/app/views/explore/utils/setExploreAttributeBounds.spec.tsx b/static/app/views/explore/utils/setExploreAttributeBounds.spec.tsx index 6169a1a69f37..1adb70d8a4de 100644 --- a/static/app/views/explore/utils/setExploreAttributeBounds.spec.tsx +++ b/static/app/views/explore/utils/setExploreAttributeBounds.spec.tsx @@ -30,4 +30,10 @@ describe('setExploreAttributeBounds', () => { 'duration:>=1.5 duration:<9' ); }); + + it('writes tiny and huge bounds without exponent notation', () => { + expect(setExploreAttributeBounds('', 'value', 1e-7, 1e21)).toBe( + 'value:>=0.0000001 value:<1000000000000000000000' + ); + }); }); diff --git a/static/app/views/explore/utils/setExploreAttributeBounds.tsx b/static/app/views/explore/utils/setExploreAttributeBounds.tsx index 72633c4e55bc..d823002731bf 100644 --- a/static/app/views/explore/utils/setExploreAttributeBounds.tsx +++ b/static/app/views/explore/utils/setExploreAttributeBounds.tsx @@ -12,6 +12,18 @@ export function setExploreAttributeBounds( ): string { const search = new MutableSearch(query); // `shouldEscape` is off so the comparison operators (`>=`, `<`) aren't quoted. - search.setFilterValues(attribute, [`>=${min}`, `<${max}`], false); + search.setFilterValues( + attribute, + [`>=${formatSearchNumber(min)}`, `<${formatSearchNumber(max)}`], + false + ); return search.formatString(); } + +/** + * The search grammar has no exponent syntax, so `1e-7` must be written out as + * `0.0000001`. + */ +function formatSearchNumber(value: number): string { + return value.toLocaleString('en-US', {useGrouping: false, maximumFractionDigits: 20}); +} From 6d430019b904386e7ff5dc71987b9784a33d332f Mon Sep 17 00:00:00 2001 From: Kev <6111995+k-fish@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:34:35 -0500 Subject: [PATCH 2/2] Update static/app/views/explore/utils/setExploreAttributeBounds.tsx Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com> --- static/app/views/explore/utils/setExploreAttributeBounds.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/views/explore/utils/setExploreAttributeBounds.tsx b/static/app/views/explore/utils/setExploreAttributeBounds.tsx index d823002731bf..1e938b9c452f 100644 --- a/static/app/views/explore/utils/setExploreAttributeBounds.tsx +++ b/static/app/views/explore/utils/setExploreAttributeBounds.tsx @@ -25,5 +25,5 @@ export function setExploreAttributeBounds( * `0.0000001`. */ function formatSearchNumber(value: number): string { - return value.toLocaleString('en-US', {useGrouping: false, maximumFractionDigits: 20}); + return value.toLocaleString(undefined, {useGrouping: false, maximumFractionDigits: 20}); }