Skip to content

feat(studio): index search and time series move into Query and Database, new Chart tab - #8788

Merged
lvca merged 1 commit into
mainfrom
feature/studio-search-in-query
Oct 1, 2026
Merged

lvca merged 1 commit into
mainfrom
feature/studio-search-in-query

Conversation

@lvca

@lvca lvca commented Oct 1, 2026

Copy link
Copy Markdown
Member

Summary

The Vector tab was a direct way to query indexes, and the TimeSeries tab was mostly schema management. This moves both to where they belong in Studio.

  • Query panel: Vector, Hybrid and Full-text are now languages in the language dropdown. Selecting one replaces the editor with the search form. The form is mirrored into the editor as JSON, so history, saved queries, bookmarks and replay work like for any language. The Vector tab is removed.
  • Chart tab in the Query panel: plots the rows of any result (SQL, Cypher, Gremlin, PromQL...). The x axis (time or category), measures and split-by are inferred from the values and can be overridden. Line, area and bar.
  • PromQL (Time Series) language in Query, with range and step controls. Points arrive as timestamp, metric, value rows and open in the Chart tab.
  • Database panel: the TimeSeries tab becomes a "Time Series" sub-tab (same Query, Schema and Quick Tour inside).

Test plan

  • npm test in studio/ (206 tests, new query-chart.test.js, extended vector-search-panel.test.js)
  • Manual check in Chrome against a seeded server: vector, hybrid and full-text searches, wrong-length vector refused client-side, history replay, SQL time series chart split by host, grouped SQL as categories, PromQL, Time Series sub-tab
  • e2e-studio specs vector-search.spec.ts (rewritten) and query-chart.spec.ts (new) were not run locally

Docs for the new behavior are in a separate commit in the arcadedb-docs repo.

…se, add Chart tab

- Vector, Hybrid and Full-text are languages of the Query panel: the editor is
  replaced by the search form, mirrored into the editor as JSON so history,
  saved queries and replay work. The Vector tab is removed.
- New Chart tab in Query plots the rows of any result (SQL, Cypher, PromQL...):
  time/category x axis, measures, split-by, line/area/bar.
- New PromQL (Time Series) language with range and step controls.
- The TimeSeries tab becomes a Time Series sub-tab of Database.
@lvca lvca self-assigned this Oct 1, 2026
@mergify

mergify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@lvca lvca added this to the 26.10.1 milestone Oct 1, 2026
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: fded0d71-3230-48f7-8660-db6263247de8

📥 Commits

Reviewing files that changed from the base of the PR and between c5fff21 and e37d627.

📒 Files selected for processing (15)
  • e2e-studio/tests/query-chart.spec.ts
  • e2e-studio/tests/vector-search.spec.ts
  • studio/src/main/resources/static/database.html
  • studio/src/main/resources/static/index.html
  • studio/src/main/resources/static/js/studio-chart.js
  • studio/src/main/resources/static/js/studio-database.js
  • studio/src/main/resources/static/js/studio-timeseries.js
  • studio/src/main/resources/static/js/studio-vector.js
  • studio/src/main/resources/static/query.html
  • studio/src/main/resources/static/timeseries.html
  • studio/src/main/resources/static/vector.html
  • studio/test/query-chart.test.js
  • studio/test/relogin-codemirror.test.js
  • studio/test/saved-query-load-without-running.test.js
  • studio/test/vector-search-panel.test.js
 __________________________________
< Bazinga! You missed a semicolon. >
 ----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lvca
lvca merged commit 1a14716 into main Oct 1, 2026
15 of 18 checks passed
@lvca
lvca deleted the feature/studio-search-in-query branch October 1, 2026 01:26
@codacy-production

codacy-production Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · -5.94% coverage variation

Metric Results
Coverage variation ✅ -5.94% coverage variation
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (869b8b1) 204110 172401 84.46%
Head commit (e37d627) 236697 (+32587) 185862 (+13461) 78.52% (-5.94%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#8788) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@claude

claude Bot commented Oct 1, 2026

Copy link
Copy Markdown

Review

Overall this is a clean piece of work. The pure-function split in studio-chart.js and studio-vector.js, the OpenAPI-driven bounds, and mirroring the form into the editor so history, saved queries and replay keep working are all good choices. Tests follow the studio/CLAUDE.md pattern. I read the changed JS (not every line of the HTML moves), and I did not run the tests or the app. The findings below are mostly edge cases.

Potential bugs

  1. Large integer measures are classified as time and cannot be charted as measures. chartCellKind (studio-chart.js:56) treats any number in [1e11, 1e13] as a time cell. A bytes, sum(amount) or counter column in that range (100 GB to 10 TB in bytes, for example) becomes "time". chartFillControls only lists kind === "number" columns as measures, so the user cannot override it, even though the header says every choice can be overridden. Some options:
    • require integer values for the epoch heuristic (Number.isInteger);
    • treat a column as time only if most of its cells are in range;
    • let time columns also be offered as measures.
  2. Non-finite PromQL values. parseFloat("NaN") and parseFloat("+Inf") give NaN (Inf without a sign also gives NaN), and chartBuildSeries accepts them because typeof NaN === "number". Prometheus returns these strings for things like 0/0. Mapping non-finite values to null (a gap) in chartRecordsFromPromQL or chartBuildSeries would be safer. Also, val.toFixed(4) in the y-axis formatter will throw on a non-number.
  3. PromQL range and step are not part of the saved query or history entry. Replaying a history or saved PromQL entry uses whatever the range and step controls say at that moment, so the same entry can return different data. That may be acceptable, but it is a departure from "replay works like for any language". Persisting them, or noting it in the docs, would help.
  4. History is recorded even when a search is refused client-side. In executeCommand, the history entry is saved after executeSearchCommand() regardless of whether vecBuildRequest returned an error. A wrong-length vector therefore lands in history. This is minor, but it will clutter history.
  5. Date parsing is inconsistent between formats. chartToMillis turns "2024-01-01 10:00:00" into T-form with no zone, which Date.parse reads as local time. Date-only "2024-01-01" and strings with Z are read as UTC. A column mixing them, or a day-only column next to timestamps, will not line up. The x labels use datetimeUTC: false, so there is also a visible shift against UTC data. Consider documenting the assumption, or normalizing.
  6. __proto__ as a column name or split value. kinds, groupIndex and seen are plain {} objects. Assigning groupIndex["__proto__"] = n is silently ignored, so a split value of __proto__ creates one group per row. Very unlikely, but Object.create(null) or a Map would remove the class of problem, and Map also avoids the hasOwnProperty boilerplate.

Performance

  • chartBuildSeries and ApexCharts render everything in globalResultset with no cap. Auto Limit helps for SQL, but a Gremlin/Cypher result or a PromQL query with many series (range / step times the series count) could produce tens of thousands of points and freeze the tab. A soft cap with a notice such as "showing first N points" would be a cheap guard.
  • chartColumns samples only 200 rows, while chartBuildSeries reads all rows. That is fine because non-number cells become gaps, but it means a column that turns text after row 200 will chart as numeric with gaps and no warning.
  • chartDefaultSpec and the change handler call chartColumns again on each control change. It is cheap (200 rows), so no action needed.

Design and maintainability

  • vecLanguageChanged and chartLanguageChanged both toggle #inputLimit's label. The first shows it for non-search languages, and the second hides it again for PromQL, so the result depends on call order in setEditorLanguage and in the #inputLanguage change handler. A single owner of that visibility (for example, one function deciding from the language) would be less fragile.
  • vecLoadFormFromEditor is called from vecLanguageChanged, vecApplyBounds, vecFillIndexSelects and the editor change handler, so it runs several times per language switch. It is idempotent and the vecSyncing guard prevents loops, but it makes the data flow harder to follow.
  • Global names (chartInstance, chartType, chartSpec, chartSignature) are generic for the shared global scope. I checked the other studio JS files and found no collision today. A queryChart* prefix would protect against one later.

Security

No new concerns. User-controlled strings (column names, series labels, option values) go through escapeHtml in chartFillControls, the PromQL expression is passed through encodeURIComponent, and the database name through encodeDatabaseName. Please double check that globalNotify renders its message as HTML only after the escape; the PromQL error path pre-escapes it with escapeHtml(...) while globalNotifyError does not, so one of the two is probably double-escaping or under-escaping.

Test coverage

  • Good: query-chart.test.js covers inference, series assembly and PromQL conversion, and vector-search-panel.test.js covers the new mode helpers.
  • Missing cases worth adding for the findings above: a number column in the 1e11-1e13 range (finding 1), NaN/Inf PromQL values (finding 2), and mixed date formats (finding 5).
  • The two e2e specs (vector-search.spec.ts, query-chart.spec.ts) were not run, as the test plan says. Please run them before merge since they are the only coverage for the DOM wiring (language switch, editor mirroring, Chart tab), and none of them exercises PromQL or the Time Series sub-tab beyond checking that the old tab is gone.
  • The executePromQLCommand DOM path has no test at all. The URL construction (start/end/step in seconds) is easy to break and could be extracted as a pure function like the others.

Nits

  • executePromQLCommand ignores data.status === "error" for non-2xx responses via .fail, which handles it, so that is fine. A NaN from an empty #promqlRange/#promqlStep would still produce start=NaN, but the controls are selects, so that is not reachable today.
  • Per CLAUDE.md, final and const/let are preferred where possible. The new files use var throughout; that matches studio-vector.js history, so I am not asking for a change, just noting it.

None of these are blockers except possibly finding 1, which makes some legitimate numeric columns un-chartable. Nice feature overall.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.20%. Comparing base (869b8b1) to head (e37d627).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8788      +/-   ##
============================================
- Coverage     76.21%   76.20%   -0.02%     
+ Complexity     3703     3700       -3     
============================================
  Files          2098     2098              
  Lines        204110   204120      +10     
  Branches      42967    42967              
============================================
- Hits         155556   155541      -15     
- Misses        31751    31769      +18     
- Partials      16803    16810       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant