Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
df2ed73
Updates recharts to 2.15.2
samejr Apr 11, 2025
68f252b
Updated Chart.tsx with latest from shadcn install guide
samejr Apr 11, 2025
fb75b05
Initial setup for new charts in storybook
samejr Apr 11, 2025
1fa473c
Adds a basic Card component
samejr Apr 11, 2025
7234e05
Adds big number chart
samejr Apr 11, 2025
561802e
Adds mock data for line chart
samejr Apr 11, 2025
89006a7
Adds loading spinners
samejr Apr 11, 2025
881c174
Tooltip invalid style fixes
samejr Apr 11, 2025
b8c1bb5
Adds stacked chart
samejr Apr 11, 2025
337912a
Typo
samejr Apr 14, 2025
a62bf90
Adding more chart types
samejr Apr 14, 2025
921c151
Adds a custom legend that displays the chart values
samejr Apr 14, 2025
f466270
Adds a tooltip to display x axis data
samejr Apr 15, 2025
81ede63
Moves some hard coded data out of the chart component
samejr Apr 15, 2025
3107276
Update legend values when you hover on the chart
samejr Apr 15, 2025
01415ed
Uses the AnimatedNumber to animate between the values in the legend
samejr Apr 15, 2025
62b49c9
Updates the axis font size
samejr Apr 15, 2025
bf68ab4
Figure out which bar in the stack you’re hovering over
samejr Apr 15, 2025
4b3a6d8
Much better solution to figuring out what bar in a stack your mouse i…
samejr Apr 15, 2025
5cabace
Brighten the legend text when it’s highlighted
samejr Apr 15, 2025
f9faa98
Better chart spacing
samejr Apr 15, 2025
f0027d0
Small style improvements
samejr Apr 15, 2025
17e5a41
Improves resetting the state of the chart values on mouse leave
samejr Apr 15, 2025
4708440
Small style improvements
samejr Apr 15, 2025
56c8186
Adds a big dataset bar chart
samejr Apr 16, 2025
1774333
Caps the number of items in the legend to 5
samejr Apr 16, 2025
9d26934
Fix random generated chart data console error
samejr Apr 16, 2025
5317d27
adds a key
samejr Apr 16, 2025
79f5f70
Show the item being hovered over as the last item in the legend
samejr Apr 16, 2025
8a730cb
Bar chart can have an optional reference line
samejr Apr 16, 2025
05c5e37
Adds a zoomable bar chart
samejr Apr 16, 2025
e4210ac
Don’t select text when you drag on the chart
samejr Apr 17, 2025
2683b24
fixes legend numbers updating
samejr Apr 17, 2025
45d723b
Moves different charts to their own files
samejr Apr 17, 2025
0177404
Turn off chart animations
samejr Apr 17, 2025
d662350
Todo update
samejr Apr 17, 2025
13e4163
storybook chart page updates
samejr Apr 23, 2025
14fc44e
Sets the chart data when zooming to only get the new start and end dates
samejr Apr 23, 2025
f703ee9
Hovering over a single bar in a stack highlights only that bar
samejr Apr 23, 2025
27ca5fb
When dragging to select a zoom range, show the dates that will be sel…
samejr Apr 23, 2025
2129422
Remove the mouse scroll wheel to zoom
samejr Apr 23, 2025
0556d8b
Removes the animation transition when you hover over the bars
samejr Apr 23, 2025
a03a3f1
Removes old example charts
samejr Apr 24, 2025
d6135a4
Tidy imports
samejr Apr 24, 2025
0c86cea
Fix import for bigNumber
samejr Apr 24, 2025
62b96d4
Improves the ReferenceLine look and behviour
samejr Apr 24, 2025
c38929d
Don’t dim the chart bars when dragging to zoom
samejr Apr 24, 2025
3ac937b
Clean up the mouseMove function + add crosshair mouse pointer
samejr Apr 24, 2025
411b1e5
Speed up the animating numbers
samejr Apr 24, 2025
b018937
Todo updates
samejr Apr 24, 2025
3dc1a93
Show a message if the zoom range is too small
samejr Apr 24, 2025
f90e601
todos update
samejr Apr 24, 2025
9479a7b
Bar stack is more visible
samejr Apr 24, 2025
cfa2fb8
Move the date data up to the route so all charts can update when zooming
samejr Apr 24, 2025
29b6446
Alphabetize the storybook side menu
samejr Apr 24, 2025
85361ec
Toggle to switch the chart states in storybook
samejr Apr 24, 2025
0a41e84
Adds different chart states like loading, no data, invalid
samejr Apr 24, 2025
663a8b5
todo update
samejr Apr 24, 2025
9707cd9
Small improvement to the tooltip style
samejr Apr 24, 2025
2a3d4bb
Improved chart loading states
samejr Apr 25, 2025
634e612
Improves layout of the loading states + animation tweak
samejr Apr 25, 2025
d91a634
Todos update
samejr Apr 25, 2025
107bd9e
Add min-height to the charts
samejr Apr 25, 2025
f94fe1a
Small card component update
samejr Apr 25, 2025
e0c44cc
2 new svg icons
samejr Apr 25, 2025
f1c0bd5
Show more x axis values but hide them on hover
samejr Apr 25, 2025
901e457
Surface stackId prop
samejr Apr 25, 2025
42b9130
Moves the chartState to the main Chart component
samejr Apr 25, 2025
3383724
Added some more types
samejr Apr 25, 2025
feb629e
Small improvements
samejr Apr 28, 2025
134cac9
Removes NamedIcon page from storybook
samejr Apr 28, 2025
8afb58e
Updates the semented control to have better variants controls
samejr Apr 28, 2025
33715d9
Update line chart style and data
samejr May 15, 2025
7c47efe
Adds a loading state for the line chart
samejr May 15, 2025
bd12f24
Adds loading states for line charts
samejr May 16, 2025
05ce4ab
Fix for bad import
matt-aitken Jan 13, 2026
7657817
Trying to integrate the chart into the app
matt-aitken Jan 13, 2026
bcb604f
Started refactor
matt-aitken Jan 14, 2026
739a947
Lines/bars actually appear again
matt-aitken Jan 14, 2026
4266faf
Some fixes. Legend displaying
matt-aitken Jan 14, 2026
93ecf48
Smaller legend font
matt-aitken Jan 14, 2026
2658294
Zooming displays properly but just logs and doesn't zoom yet
matt-aitken Jan 14, 2026
fb99c74
Removed duplicate storybook nav items
matt-aitken Jan 14, 2026
71c3d1b
Zooming working
matt-aitken Jan 14, 2026
590968a
Storybook route data updated
matt-aitken Jan 14, 2026
0ff26ef
Show total in legend
matt-aitken Jan 14, 2026
d07aae6
Added label when hovering for total
matt-aitken Jan 14, 2026
307335d
Nicer title label formatting
matt-aitken Jan 14, 2026
02866a6
Chart is showing, but needs styling
matt-aitken Jan 14, 2026
b4b7029
WIP with layout changes to query
matt-aitken Jan 15, 2026
f57bc6a
Added PopoverArrowTrigger variants
matt-aitken Jan 15, 2026
beccf75
Improved the layout with the stats and buttons
matt-aitken Jan 15, 2026
40d42a6
Fix for type errors
matt-aitken Jan 15, 2026
9d10769
Improved the graph layout
matt-aitken Jan 15, 2026
e4fb4d0
Separated the Query stuff into more files as it was… long
matt-aitken Jan 15, 2026
1ed7141
The graph now renders in a <Card>
matt-aitken Jan 15, 2026
5e550a9
Switching to using ReactTable WIP
matt-aitken Jan 15, 2026
87e2537
It now renders reasonably well
matt-aitken Jan 15, 2026
32c91f2
Fix for copy button not being on the right
matt-aitken Jan 15, 2026
547ac8e
Resizable columns
matt-aitken Jan 15, 2026
fa3080c
Clipping columns
matt-aitken Jan 15, 2026
b4ac6f1
Added column filtering
matt-aitken Jan 15, 2026
5611959
Filter against formatted values too
matt-aitken Jan 15, 2026
a3a7b4b
Nicer filtering styles
matt-aitken Jan 15, 2026
3852a0e
Sorting
matt-aitken Jan 16, 2026
b40f998
Overscan increased to 20
matt-aitken Jan 16, 2026
40ebad0
Working on fixing the Table scrolling
matt-aitken Jan 16, 2026
cf37444
Fixed table scrolling
matt-aitken Jan 16, 2026
9c5341e
Make Query scope clearer
matt-aitken Jan 16, 2026
f3d459a
When narrow fixed tabs/stats layout
matt-aitken Jan 16, 2026
cfb7f02
Better filtering behaviour
matt-aitken Jan 16, 2026
c9ae2cb
Legend hover improved
matt-aitken Jan 16, 2026
8ba820f
Environment col shows slug. Improved table header styles
matt-aitken Jan 16, 2026
37ccc0a
Don't have a size on the environment slug component
matt-aitken Jan 16, 2026
9e3c5fd
whereClauseFallback added to TSQL
matt-aitken Jan 16, 2026
86898f2
Query date picker works
matt-aitken Jan 17, 2026
49e8f10
Improved date filter display
matt-aitken Jan 17, 2026
6599f0c
Fixed loading state
matt-aitken Jan 17, 2026
b8c901b
Remove console.log
matt-aitken Jan 17, 2026
6d137b5
UI updates if triggered is set in the query
matt-aitken Jan 17, 2026
597dfd4
Support multiple series
matt-aitken Jan 17, 2026
1afa801
Usage graph
matt-aitken Jan 17, 2026
ee9f1c8
No data check should only care about null/undefined
matt-aitken Jan 17, 2026
e9d0b6e
Multiple series
matt-aitken Jan 17, 2026
c7d2b4a
Only hide bar labels when zoom is enabled
matt-aitken Jan 17, 2026
528905b
Usage label $ not ($)
matt-aitken Jan 17, 2026
b79a23c
Don't save repeated queries to the history
matt-aitken Jan 17, 2026
140a0aa
Always start the y-axis at 0
matt-aitken Jan 17, 2026
077b461
Indigo resize handles
matt-aitken Jan 17, 2026
c64d32d
Fix for bar widths being wrong in small datasets
matt-aitken Jan 17, 2026
0ea3c5c
When editing the time period it does the query again
matt-aitken Jan 17, 2026
748bc6a
Fix for line/area chart hovering
matt-aitken Jan 17, 2026
07988a0
The AI updates the time filter
matt-aitken Jan 18, 2026
9e6c52f
useLocalString instead of toLocaleDateString
matt-aitken Jan 18, 2026
9b3f369
Legend values should be numbers
matt-aitken Jan 18, 2026
49d0320
Removed legacy/deprecated charts
matt-aitken Jan 18, 2026
ffe7697
Need to use ClientOnly around random elements
matt-aitken Jan 18, 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>
);
}
28 changes: 25 additions & 3 deletions apps/webapp/app/components/code/AIQueryInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,25 @@ import { useOrganization } from "~/hooks/useOrganizations";
import { useProject } from "~/hooks/useProject";
import { cn } from "~/utils/cn";

interface AITimeFilter {
period?: string;
from?: string;
to?: string;
}

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 +49,7 @@ interface AIQueryInputProps {

export function AIQueryInput({
onQueryGenerated,
onTimeFilterChange,
autoSubmitPrompt,
autoSubmitKey,
getCurrentQuery,
Expand Down Expand Up @@ -174,10 +184,22 @@ export function AIQueryInput({
setThinking((prev) => prev + event.content);
break;
case "tool_call":
setThinking((prev) => prev + `\nValidating query...\n`);
if (event.tool === "setTimeFilter") {
setThinking((prev) => prev + `\nSetting time filter...\n`);
} else {
setThinking((prev) => 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 +211,7 @@ export function AIQueryInput({
break;
}
},
[onQueryGenerated]
[onQueryGenerated, onTimeFilterChange]
);

const handleSubmit = useCallback(
Expand Down
Loading