Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
0ebfbfc
Updates recharts to 2.15.2
samejr Apr 11, 2025
0f2954e
Updated Chart.tsx with latest from shadcn install guide
samejr Apr 11, 2025
19171e5
Initial setup for new charts in storybook
samejr Apr 11, 2025
fdef069
Adds a basic Card component
samejr Apr 11, 2025
bcbac73
Adds big number chart
samejr Apr 11, 2025
1ecbb3b
Adds mock data for line chart
samejr Apr 11, 2025
8b5a8ae
Adds loading spinners
samejr Apr 11, 2025
5efe10d
Tooltip invalid style fixes
samejr Apr 11, 2025
3114ccd
Adds stacked chart
samejr Apr 11, 2025
1de951a
Typo
samejr Apr 14, 2025
6ffb7e1
Adding more chart types
samejr Apr 14, 2025
bfc6b0f
Adds a custom legend that displays the chart values
samejr Apr 14, 2025
ea1e1bf
Adds a tooltip to display x axis data
samejr Apr 15, 2025
09ae94a
Moves some hard coded data out of the chart component
samejr Apr 15, 2025
9842430
Update legend values when you hover on the chart
samejr Apr 15, 2025
8b9dd7f
Uses the AnimatedNumber to animate between the values in the legend
samejr Apr 15, 2025
fb77c83
Updates the axis font size
samejr Apr 15, 2025
eec68b0
Figure out which bar in the stack you’re hovering over
samejr Apr 15, 2025
cbda3dc
Much better solution to figuring out what bar in a stack your mouse i…
samejr Apr 15, 2025
8ed11b8
Brighten the legend text when it’s highlighted
samejr Apr 15, 2025
47ab8e3
Better chart spacing
samejr Apr 15, 2025
e917013
Small style improvements
samejr Apr 15, 2025
ae9e36c
Improves resetting the state of the chart values on mouse leave
samejr Apr 15, 2025
0b0557a
Small style improvements
samejr Apr 15, 2025
dd52123
Adds a big dataset bar chart
samejr Apr 16, 2025
f41d5f8
Caps the number of items in the legend to 5
samejr Apr 16, 2025
6a5c34f
Fix random generated chart data console error
samejr Apr 16, 2025
df80383
adds a key
samejr Apr 16, 2025
8216dbb
Show the item being hovered over as the last item in the legend
samejr Apr 16, 2025
c0e5067
Bar chart can have an optional reference line
samejr Apr 16, 2025
311c199
Adds a zoomable bar chart
samejr Apr 16, 2025
9e904b1
Don’t select text when you drag on the chart
samejr Apr 17, 2025
911d33a
fixes legend numbers updating
samejr Apr 17, 2025
9887553
Moves different charts to their own files
samejr Apr 17, 2025
41504fe
Turn off chart animations
samejr Apr 17, 2025
c63396a
Todo update
samejr Apr 17, 2025
774efde
storybook chart page updates
samejr Apr 23, 2025
c43bedf
Sets the chart data when zooming to only get the new start and end dates
samejr Apr 23, 2025
bf11bf0
Hovering over a single bar in a stack highlights only that bar
samejr Apr 23, 2025
90f7cd9
When dragging to select a zoom range, show the dates that will be sel…
samejr Apr 23, 2025
5b11978
Remove the mouse scroll wheel to zoom
samejr Apr 23, 2025
6ca4746
Removes the animation transition when you hover over the bars
samejr Apr 23, 2025
972a1ea
Removes old example charts
samejr Apr 24, 2025
5c4b609
Tidy imports
samejr Apr 24, 2025
3ead545
Fix import for bigNumber
samejr Apr 24, 2025
20f52ad
Improves the ReferenceLine look and behviour
samejr Apr 24, 2025
96a8505
Don’t dim the chart bars when dragging to zoom
samejr Apr 24, 2025
178334a
Clean up the mouseMove function + add crosshair mouse pointer
samejr Apr 24, 2025
6d13015
Speed up the animating numbers
samejr Apr 24, 2025
a8adce6
Todo updates
samejr Apr 24, 2025
c314b7d
Show a message if the zoom range is too small
samejr Apr 24, 2025
7a30d0d
todos update
samejr Apr 24, 2025
f1fc99e
Bar stack is more visible
samejr Apr 24, 2025
9eb9604
Move the date data up to the route so all charts can update when zooming
samejr Apr 24, 2025
69eb264
Alphabetize the storybook side menu
samejr Apr 24, 2025
989b067
Toggle to switch the chart states in storybook
samejr Apr 24, 2025
e915d99
Adds different chart states like loading, no data, invalid
samejr Apr 24, 2025
96b3d66
todo update
samejr Apr 24, 2025
9da5cea
Small improvement to the tooltip style
samejr Apr 24, 2025
d9cf6f8
Improved chart loading states
samejr Apr 25, 2025
1e1b1b9
Improves layout of the loading states + animation tweak
samejr Apr 25, 2025
1d429a8
Todos update
samejr Apr 25, 2025
10c7035
Add min-height to the charts
samejr Apr 25, 2025
9637bf8
Small card component update
samejr Apr 25, 2025
2ddb6b9
2 new svg icons
samejr Apr 25, 2025
a9a087b
Show more x axis values but hide them on hover
samejr Apr 25, 2025
ac3c7f1
Surface stackId prop
samejr Apr 25, 2025
ce8aedf
Moves the chartState to the main Chart component
samejr Apr 25, 2025
10dd6a5
Added some more types
samejr Apr 25, 2025
5916d0e
Small improvements
samejr Apr 28, 2025
476dc1e
Removes NamedIcon page from storybook
samejr Apr 28, 2025
290d9fc
Updates the semented control to have better variants controls
samejr Apr 28, 2025
af9117a
Update line chart style and data
samejr May 15, 2025
a6dde44
Adds a loading state for the line chart
samejr May 15, 2025
d298232
Adds loading states for line charts
samejr May 16, 2025
95ca34b
Fix for bad import
matt-aitken Jan 13, 2026
4242599
Trying to integrate the chart into the app
matt-aitken Jan 13, 2026
121479e
Started refactor
matt-aitken Jan 14, 2026
f75e624
Lines/bars actually appear again
matt-aitken Jan 14, 2026
e0810b4
Some fixes. Legend displaying
matt-aitken Jan 14, 2026
eab3895
Smaller legend font
matt-aitken Jan 14, 2026
e71e563
Zooming displays properly but just logs and doesn't zoom yet
matt-aitken Jan 14, 2026
62c2cea
Removed duplicate storybook nav items
matt-aitken Jan 14, 2026
d48844a
Zooming working
matt-aitken Jan 14, 2026
c38fb60
Storybook route data updated
matt-aitken Jan 14, 2026
3f0b667
Show total in legend
matt-aitken Jan 14, 2026
599dae1
Added label when hovering for total
matt-aitken Jan 14, 2026
011c8ee
Nicer title label formatting
matt-aitken Jan 14, 2026
3eecac6
Chart is showing, but needs styling
matt-aitken Jan 14, 2026
1ab011a
WIP with layout changes to query
matt-aitken Jan 15, 2026
864cf88
Added PopoverArrowTrigger variants
matt-aitken Jan 15, 2026
73646d2
Improved the layout with the stats and buttons
matt-aitken Jan 15, 2026
b88d471
Fix for type errors
matt-aitken Jan 15, 2026
9357b44
Improved the graph layout
matt-aitken Jan 15, 2026
1f42d81
Separated the Query stuff into more files as it was… long
matt-aitken Jan 15, 2026
602bd51
The graph now renders in a <Card>
matt-aitken Jan 15, 2026
1da8368
Switching to using ReactTable WIP
matt-aitken Jan 15, 2026
86bd4db
It now renders reasonably well
matt-aitken Jan 15, 2026
36bbe94
Fix for copy button not being on the right
matt-aitken Jan 15, 2026
a0974e2
Resizable columns
matt-aitken Jan 15, 2026
4dd19ac
Clipping columns
matt-aitken Jan 15, 2026
c2c0f80
Added column filtering
matt-aitken Jan 15, 2026
c16fcbf
Filter against formatted values too
matt-aitken Jan 15, 2026
a2211ed
Nicer filtering styles
matt-aitken Jan 15, 2026
d7dd089
Sorting
matt-aitken Jan 16, 2026
757de45
Overscan increased to 20
matt-aitken Jan 16, 2026
cef63be
Working on fixing the Table scrolling
matt-aitken Jan 16, 2026
a13d30e
Fixed table scrolling
matt-aitken Jan 16, 2026
bb5018c
Make Query scope clearer
matt-aitken Jan 16, 2026
511dc88
When narrow fixed tabs/stats layout
matt-aitken Jan 16, 2026
00a8a2d
Better filtering behaviour
matt-aitken Jan 16, 2026
bbde1cb
Legend hover improved
matt-aitken Jan 16, 2026
c8e6ebe
Environment col shows slug. Improved table header styles
matt-aitken Jan 16, 2026
76f6c7b
Don't have a size on the environment slug component
matt-aitken Jan 16, 2026
1259353
whereClauseFallback added to TSQL
matt-aitken Jan 16, 2026
eeb476c
Query date picker works
matt-aitken Jan 17, 2026
3caf161
Improved date filter display
matt-aitken Jan 17, 2026
bffbf37
Fixed loading state
matt-aitken Jan 17, 2026
4d72ade
Remove console.log
matt-aitken Jan 17, 2026
c172447
UI updates if triggered is set in the query
matt-aitken Jan 17, 2026
3ea6bc2
Support multiple series
matt-aitken Jan 17, 2026
357a4d9
Usage graph
matt-aitken Jan 17, 2026
7292440
No data check should only care about null/undefined
matt-aitken Jan 17, 2026
d0ede77
Multiple series
matt-aitken Jan 17, 2026
520fa6a
Only hide bar labels when zoom is enabled
matt-aitken Jan 17, 2026
e7ed8ff
Usage label $ not ($)
matt-aitken Jan 17, 2026
d3a2bd1
Don't save repeated queries to the history
matt-aitken Jan 17, 2026
fcd2ce5
Always start the y-axis at 0
matt-aitken Jan 17, 2026
19e41fa
Indigo resize handles
matt-aitken Jan 17, 2026
4e6ebd7
Fix for bar widths being wrong in small datasets
matt-aitken Jan 17, 2026
dfd1075
When editing the time period it does the query again
matt-aitken Jan 17, 2026
45a616a
Fix for line/area chart hovering
matt-aitken Jan 17, 2026
90e8002
The AI updates the time filter
matt-aitken Jan 18, 2026
d10ed35
useLocalString instead of toLocaleDateString
matt-aitken Jan 18, 2026
85cda5d
Legend values should be numbers
matt-aitken Jan 18, 2026
34daf54
Removed legacy/deprecated charts
matt-aitken Jan 18, 2026
6807a8f
Need to use ClientOnly around random elements
matt-aitken Jan 18, 2026
21483f6
Shared the `AITimeFilter` type
matt-aitken Jan 19, 2026
95ae603
formatBytes protection from divide by zero
matt-aitken Jan 19, 2026
df3521c
Force TypeScript to 5.5.4
matt-aitken Jan 19, 2026
0ed6b51
Make sure the column is wide enough for the header cell
matt-aitken Jan 19, 2026
e1a4ebd
Tooltip on the time picker when it's disabled
matt-aitken Jan 19, 2026
1f5b0f4
Fixed header alignment
matt-aitken Jan 20, 2026
ed0fd70
Fixed time filtering and page reloading
matt-aitken Jan 20, 2026
e21b778
Save the query date range
matt-aitken Jan 20, 2026
fc696c4
Fix for hydration errors and option to hide date
matt-aitken Jan 20, 2026
8806ee8
Nicer AI streaming
matt-aitken Jan 20, 2026
89007b9
Don't repeat the date when showing a range
matt-aitken Jan 20, 2026
81c4ba6
Time filtering fixes
matt-aitken Jan 20, 2026
0bc9820
Fixed old import
matt-aitken Jan 20, 2026
d347d72
Don't show "Triggered" on the filter
matt-aitken Jan 20, 2026
58d0d8e
Don't show the normal recharts legend
matt-aitken Jan 20, 2026
8b71097
Chart fullscreen
matt-aitken Jan 20, 2026
560e634
Fullscreen from the legend
matt-aitken Jan 20, 2026
1fa5947
Fit the chart in the container (inc legend)
matt-aitken Jan 20, 2026
4c09958
Make includeDate optional
matt-aitken Jan 20, 2026
c528e0b
Removed unused code
matt-aitken Jan 20, 2026
c6a07ef
Removed stray comment
matt-aitken Jan 20, 2026
b03c7f7
Share time filter tool code
matt-aitken Jan 20, 2026
191327f
isSameDay fixed
matt-aitken Jan 20, 2026
84b05d6
Better AppliedFilter label hiding
matt-aitken Jan 20, 2026
8eb423a
Chart axis for negative vals fix
matt-aitken Jan 20, 2026
9d46312
Fixed totalling of chart series
matt-aitken Jan 20, 2026
ed8e1a8
Fix for Rendered more hooks than during the previous render.
matt-aitken Jan 20, 2026
146077e
Fix for inconsistent date handling for graphs
matt-aitken Jan 20, 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
71 changes: 71 additions & 0 deletions apps/webapp/app/assets/icons/AbacusIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
export function AbacusIcon({ className }: { className?: string }) {
return (
<svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clipPath="url(#clip0_16909_120578)">
<path
d="M4 3V21"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M20 21V3"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8 5L8 6"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M14 5L14 6"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M15 10L15 11"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M9 10L9 11"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M12 15L12 16"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8 15L8 16"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M3 21H21"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
</svg>
);
}
22 changes: 22 additions & 0 deletions apps/webapp/app/assets/icons/ArrowTopRightBottomLeftIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export function ArrowTopRightBottomLeftIcon({ className }: { className?: string }) {
return (
<svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M14.8258 10.5L20.125 5.20083V8.5625C20.125 9.08027 20.5447 9.5 21.0625 9.5C21.5803 9.5 22 9.08027 22 8.5625V2.9375C22 2.41973 21.5803 2 21.0625 2H15.4375C14.9197 2 14.5 2.41973 14.5 2.9375C14.5 3.45527 14.9197 3.875 15.4375 3.875H18.7992L13.5 9.17417C13.1339 9.54029 13.1339 10.1339 13.5 10.5C13.8661 10.8661 14.4597 10.8661 14.8258 10.5Z"
fill="currentColor"
/>
<path
d="M2 21.0625V15.4375C2 14.9197 2.41973 14.5 2.9375 14.5C3.45527 14.5 3.875 14.9197 3.875 15.4375V18.7992L9.17417 13.5C9.54029 13.1339 10.1339 13.1339 10.5 13.5C10.8661 13.8661 10.8661 14.4597 10.5 14.8258L5.20083 20.125H8.5625C9.08027 20.125 9.5 20.5447 9.5 21.0625C9.5 21.5803 9.08027 22 8.5625 22H2.9375C2.69757 22 2.45765 21.9085 2.27459 21.7254C2.1847 21.6355 2.11689 21.5319 2.07114 21.4214C2.0253 21.3108 2 21.1896 2 21.0625Z"
fill="currentColor"
/>
<path
d="M14.8258 10.5L20.125 5.20083V10C20.125 10.5178 20.5447 10.9375 21.0625 10.9375C21.5803 10.9375 22 10.5178 22 10V2.9375C22 2.41973 21.5803 2 21.0625 2H14C13.4822 2 13.0625 2.41973 13.0625 2.9375C13.0625 3.45527 13.4822 3.875 14 3.875H18.7992L13.5 9.17417C13.1339 9.54029 13.1339 10.1339 13.5 10.5C13.8661 10.8661 14.4597 10.8661 14.8258 10.5Z"
fill="currentColor"
/>
<path
d="M2 21.0625V13.9375C2 13.4197 2.41973 13 2.9375 13C3.45527 13 3.875 13.4197 3.875 13.9375V18.7992L9.17417 13.5C9.54029 13.1339 10.1339 13.1339 10.5 13.5C10.8661 13.8661 10.8661 14.4597 10.5 14.8258L5.20083 20.125H10.0625C10.5803 20.125 11 20.5447 11 21.0625C11 21.5803 10.5803 22 10.0625 22H2.9375C2.69757 22 2.45765 21.9085 2.27459 21.7254C2.1847 21.6355 2.11689 21.5319 2.07114 21.4214C2.0253 21.3108 2 21.1896 2 21.0625Z"
fill="currentColor"
/>
</svg>
);
}
41 changes: 34 additions & 7 deletions apps/webapp/app/components/code/AIQueryInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ import { Spinner } from "~/components/primitives/Spinner";
import { useEnvironment } from "~/hooks/useEnvironment";
import { useOrganization } from "~/hooks/useOrganizations";
import { useProject } from "~/hooks/useProject";
import type { AITimeFilter } from "~/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/types";
import { cn } from "~/utils/cn";

type StreamEventType =
| { type: "thinking"; content: string }
| { type: "tool_call"; tool: string; args: unknown }
| { type: "result"; success: true; query: string }
| { type: "time_filter"; filter: AITimeFilter }
| { type: "result"; success: true; query: string; timeFilter?: AITimeFilter }
| { type: "result"; success: false; error: string };

export type AIQueryMode = "new" | "edit";

interface AIQueryInputProps {
onQueryGenerated: (query: string) => void;
/** Called when the AI sets a time filter - updates URL search params */
onTimeFilterChange?: (filter: AITimeFilter) => void;
/** Set this to a prompt to auto-populate and immediately submit */
autoSubmitPrompt?: string;
/** Change this to force re-submission even if prompt is the same */
Expand All @@ -40,6 +44,7 @@ interface AIQueryInputProps {

export function AIQueryInput({
onQueryGenerated,
onTimeFilterChange,
autoSubmitPrompt,
autoSubmitKey,
getCurrentQuery,
Expand Down Expand Up @@ -174,10 +179,32 @@ export function AIQueryInput({
setThinking((prev) => prev + event.content);
break;
case "tool_call":
setThinking((prev) => prev + `\nValidating query...\n`);
if (event.tool === "setTimeFilter") {
setThinking((prev) => {
if (prev.trimEnd().endsWith("Setting time filter...")) {
return prev;
}
return prev + `\nSetting time filter...\n`;
});
} else {
setThinking((prev) => {
if (prev.trimEnd().endsWith("Validating query...")) {
return prev;
}
return prev + `\nValidating query...\n`;
});
}
break;
case "time_filter":
// Apply time filter immediately when the AI sets it
onTimeFilterChange?.(event.filter);
break;
case "result":
if (event.success) {
// Apply time filter if included in result (backup in case time_filter event was missed)
if (event.timeFilter) {
onTimeFilterChange?.(event.timeFilter);
}
onQueryGenerated(event.query);
setPrompt("");
setLastResult("success");
Expand All @@ -189,7 +216,7 @@ export function AIQueryInput({
break;
}
},
[onQueryGenerated]
[onQueryGenerated, onTimeFilterChange]
);

const handleSubmit = useCallback(
Expand Down Expand Up @@ -359,10 +386,10 @@ export function AIQueryInput({
{isLoading
? "AI is thinking..."
: lastResult === "success"
? "Query generated"
: lastResult === "error"
? "Generation failed"
: "AI response"}
? "Query generated"
: lastResult === "error"
? "Generation failed"
: "AI response"}
</span>
</div>
{isLoading ? (
Expand Down
Loading