Skip to content

feat(local-explorer-ui): Add data studio component contexts#12570

Merged
NuroDev merged 26 commits intomainfrom
NuroDev/local-explorer-studio-queries
Feb 17, 2026
Merged

feat(local-explorer-ui): Add data studio component contexts#12570
NuroDev merged 26 commits intomainfrom
NuroDev/local-explorer-studio-queries

Conversation

@NuroDev
Copy link
Member

@NuroDev NuroDev commented Feb 16, 2026

Fixes DEVX-2415.

Changes

  • Adds the initial UI component plumbing for the data studio
    • A number of TODOs have been added intentionally as markers for later PRs
    • I have split up the WindowTab and WindowTabPane components into dedicated files to they're easier to manage while skimming
    • Replaced some useMemo that were purely for class name generation with inlined usage of cn()
    • Tried to add documentation to functions, callbacks, properties, etc, when possible to better document this complex component
    • Replaced a few style props with Tailwind CSS classes
    • The refreshSchema logic has refactored from callback hell to a try / catch. This SHOULD work like before, but should it need to be restored it can.
  • Updates the D1 database selector dropdown to add a table icon
  • Added a fixed height to the sidebar items
Screenshot 2026-02-16 at 4 02 21 pm
  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows: The WIP local explorer does not contain a test suite yet. UI tests are planned to be added in future.
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: WIP feature

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@NuroDev NuroDev self-assigned this Feb 16, 2026
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Feb 16, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 16, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12570

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12570

miniflare

npm i https://pkg.pr.new/miniflare@12570

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12570

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12570

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12570

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12570

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12570

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12570

wrangler

npm i https://pkg.pr.new/wrangler@12570

commit: 7c569e3

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 7c569e3

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@NuroDev NuroDev changed the title feat(local-explorer-ui): Add initial query studio feat(local-explorer-ui): Add data studio component contexts Feb 16, 2026
Comment on lines +44 to +50
const resource = useMemo<StudioResource>(
() => ({
databaseId: params.databaseId,
type: "d1",
}),
[params.databaseId]
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably remove this at a later date

return (
<Collapsible.Root defaultOpen>
<Collapsible.Trigger className="group flex items-center gap-2 w-full py-3 px-4 border-0 border-b border-border bg-transparent font-semibold text-[11px] uppercase tracking-wide text-text-secondary cursor-pointer transition-colors hover:bg-border">
<Collapsible.Trigger className="group flex items-center gap-2 w-full h-10 py-3 px-4 border-0 border-b border-border bg-transparent font-semibold text-[11px] uppercase tracking-wide text-text-secondary cursor-pointer transition-colors hover:bg-border">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just so there is a consistent height between the sidebar items & the studio tab bar

@NuroDev NuroDev marked this pull request as ready for review February 16, 2026 16:35
@NuroDev NuroDev requested a review from a team as a code owner February 16, 2026 16:35
devin-ai-integration[bot]

This comment was marked as resolved.

@claude
Copy link
Contributor

claude bot commented Feb 16, 2026

Claude finished @NuroDev's task —— View job


Changeset Review

  • Read changeset guidelines
  • Review changeset file
  • Check for cute animal picture
  • Post findings

⚠️ Issues found

The changeset .changeset/pink-rockets-wish.md needs improvement:

Issue: Missing experimental feature opt-in note

According to the guidelines (line 23 of .changeset/README.md): "When adding or changing experimental features, call this out explicitly in the changeset description."

The changeset currently states "This is a WIP experimental feature" but doesn't explain how users can opt in to use this feature. Since this is experimental functionality for the local explorer, the changeset should include information about how users can enable or access this feature.

Suggested fix:

Add a note explaining how users can opt in to or use this experimental feature. For example:

---
"@cloudflare/local-explorer-ui": minor
---

Add the initial plumbing for data studio components.

This serves as another stepping stone for adding the complete data studio to the local explorer.

This is an experimental feature. To use the local explorer, run `wrangler dev` with the appropriate configuration [or whatever the actual opt-in mechanism is].

Copy link
Member Author

@NuroDev NuroDev Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file will likely be replaced in future with the new standard Kumo dialog system.

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Feb 17, 2026
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 11 additional findings in Devin Review.

Open in Devin Review

Comment on lines +133 to +134
const Icon =
searchParams.table === table.value ? CheckIcon : TableIcon;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Table select icon state derived from URL params instead of Select component's internal state

The TableSelect component replaced Select.ItemIndicator (which automatically renders based on the Select component's internal selected state) with a manual check against searchParams.table. This causes the check/table icon to be out of sync with the Select component's actual selection state.

Detailed Explanation

The original code used Base UI's Select.ItemIndicator, which only renders its children when the parent Select.Item is the currently selected item — based on the Select component's own internal state:

<Select.ItemIndicator className="flex items-center w-4">
    <CheckIcon className="w-3.5 h-3.5" />
</Select.ItemIndicator>

The new code at $databaseId.tsx:133-134 manually determines the icon:

const Icon = searchParams.table === table.value ? CheckIcon : TableIcon;

This derives the selected state from searchParams.table (the URL), not from the Select component's value prop. When a user selects a new table, onValueChange fires and triggers navigate(), but the URL (and thus searchParams.table) only updates after the navigation completes. During this brief window, the Select dropdown may show the wrong icon — the previously selected item still shows CheckIcon while the newly selected item shows TableIcon.

Additionally, when no table is selected (searchParams.table is undefined), all items will show TableIcon, which is correct. But if the Select component's internal state somehow differs from the URL (e.g., during controlled value transitions), the icons won't reflect the actual selection.

Prompt for agents
In packages/local-explorer-ui/src/routes/d1/$databaseId.tsx, the TableSelect component at lines 132-148 should use Base UI's Select.ItemIndicator to determine which icon to show, rather than manually comparing against searchParams.table. This ensures the icon state stays in sync with the Select component's internal state. Consider restoring Select.ItemIndicator for the CheckIcon and always showing TableIcon as a fallback. For example, each Select.Item could contain both a Select.ItemIndicator (with CheckIcon) and a non-indicator fallback (with TableIcon), or use the Select component's render props if available to determine the selected state.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@NuroDev NuroDev merged commit 01ded52 into main Feb 17, 2026
35 checks passed
@NuroDev NuroDev deleted the NuroDev/local-explorer-studio-queries branch February 17, 2026 13:16
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants

Comments