Commit 3ce8bcc
feat(genie): add automatic chart visualization for query results (#146)
* docs: regenerate API docs for genie plugin export
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* docs(appkit): add @internal to genie export and document plugin in plugins.md
Add @internal JSDoc to genie const to exclude it from generated API
docs. Add Genie plugin section to plugins.md covering configuration,
endpoints, SSE events, and programmatic usage.
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* docs: remove Variable.genie from generated API docs sidebar and index
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* refactor(genie): extract pollWaiter to simplify _handleSendMessage
Replace manual concurrency code (statusQueue, notifyGenerator,
waiterDone, waiterError, IIFE promise chain) with a reusable
pollWaiter async generator that bridges callback-based
waiter.wait({ onProgress }) into a for-await-of loop.
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* feat(genie): add automatic chart visualization for query results
- Infer chart type (bar, line, pie, scatter, table) from query column metadata
- Transform Genie query data with column categorization and date parsing
- Render charts inline in chat messages via GenieQueryVisualization component
- Add chart-inference dev playground page and unit tests
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* Refactor Genie into Genie connector (#145)
* feat(appkit-ui): add Genie chat React components and dev-playground demo
Add plug-and-play React components for Genie AI/BI chat:
- useGenieChat hook: manages SSE streaming, conversation persistence
via URL params, and history replay on page refresh
- GenieChat: all-in-one component wiring hook + UI
- GenieChatMessage: renders messages with markdown (via marked),
avatars, and collapsible SQL query attachments
- GenieChatMessageList: scrollable message list with auto-scroll,
loading skeletons, and streaming status indicator
- GenieChatInput: textarea with Enter-to-send and auto-resize
Also adds Genie demo page to dev-playground at /genie and fixes
conversation history ordering in the backend (reverse to chronological).
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* fix(appkit-ui): address Genie chat UI review feedback
- Rename GENIE_SPACE_ID to DATABRICKS_GENIE_SPACE_ID in env and code
- Hide textarea scrollbar; only show overflow-y when content exceeds max height
- Skip rendering empty assistant bubbles during loading, show only the spinner
- Remove shadow from nested SQL query cards to fix corner shadow artifacts
- Move "New conversation" button to top-right of chat widget
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* docs: add Genie component documentation with examples
Extend the doc generator to scan genie, multi-genie, and chat component
directories. Add JSDoc descriptions to all Genie components and props,
create usage examples for GenieChat and MultiGenieChat, and generate
8 new doc pages under a "Genie components" sidebar category.
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* feat(genie): send requestId query param from frontend for SSE reconnection
Generate a UUID per request in useGenieChat and pass it as ?requestId
to the sendMessage and loadHistory SSE endpoints. This allows the server
to use a stable streamId for reconnection and missed-event replay.
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* chore: genie connector
* refactor(genie): replace sendMessage with streaming implementation
The old non-streaming sendMessage (returning Promise<GenieMessageResponse>)
is replaced by the streaming version (returning AsyncGenerator<GenieStreamEvent>).
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
---------
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
Co-authored-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
* chore: remove crypto/index.ts
* fix(appkit-ui): sort numeric x-data and fix axis labels for scatter/timeseries charts
Scatter and timeseries charts had two issues: x-axis data arrived in
arbitrary row order from query results, and axis labels were hidden
due to axisLabel being set to undefined. Sort numeric x-data in the
normalization layer and explicitly enable axis labels in the renderer.
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* fix(appkit-ui): skip pie chart for negative values and clean up base chart
Add negative value check to chart inference so pie is not chosen when
data contains negative numbers (falls through to bar). Simplify xField
destructuring in BaseChart.
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* fix(appkit-ui): add GenieStatementResponse type and preserve y-value types in sortNumericAscending
- Add GenieStatementResponse interface in shared package to replace unknown types
- Update transformGenieData, GenieQueryVisualization, and GenieMessageItem to use typed data
- Fix sortNumericAscending to preserve original y-value types instead of coercing to Number
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
* docs: add GenieQueryVisualization API reference
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
---------
Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
Co-authored-by: MarioCadenas <MarioCadenas@users.noreply.github.com>1 parent c4dfc35 commit 3ce8bcc
19 files changed
Lines changed: 1342 additions & 46 deletions
File tree
- apps/dev-playground/client/src
- routes
- docs/docs/api/appkit-ui/genie
- packages
- appkit-ui/src/react
- charts
- genie
- __tests__
- appkit/src/connectors/genie
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
| |||
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
| 97 | + | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| |||
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| 111 | + | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
| |||
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| 126 | + | |
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
| |||
126 | 136 | | |
127 | 137 | | |
128 | 138 | | |
| 139 | + | |
129 | 140 | | |
130 | 141 | | |
131 | 142 | | |
| |||
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
| 152 | + | |
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
| |||
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
| 166 | + | |
154 | 167 | | |
155 | 168 | | |
156 | 169 | | |
| |||
211 | 224 | | |
212 | 225 | | |
213 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
214 | 234 | | |
215 | 235 | | |
216 | 236 | | |
| |||
239 | 259 | | |
240 | 260 | | |
241 | 261 | | |
| 262 | + | |
242 | 263 | | |
243 | 264 | | |
244 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| |||
Lines changed: 280 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
0 commit comments