-
Notifications
You must be signed in to change notification settings - Fork 162
Data Explorer UI #8348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Explorer UI #8348
Conversation
|
lmk when its ready for another round of reviews |
royendo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great!
A few nit items
- missing the comment section in the top of the source YAML generated on import
# Model YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/models
-
- New XXX Connector in left panel (does the same as Back)
web-common/src/features/sources/modal/DataExplorerDialog.svelte
Outdated
Show resolved
Hide resolved
web-common/src/features/sources/modal/DataExplorerDialog.svelte
Outdated
Show resolved
Hide resolved
Can you rephrase this? Thank you! |
As the design has in the left panel, theres a ui button to create new connector |
|
Component Complexity: AddDataForm.svelte needs refactoring before merge The new explorer state tracking (lines 142-152) highlights a concerning architectural issue with The ProblemThis PR adds 5+ new state variables and a 30-line model creation function to an already complex component: // Lines 142-152: New state for explorer step
let selectedConnectorForModel = "";
let selectedDatabaseForModel = "";
let selectedSchemaForModel = "";
let selectedTableForModel = "";
let creatingModel = false;
$: modelingSupportQuery = useIsModelingSupportedForConnector(...)
$: isModelingSupportedForSelected = $modelingSupportQuery.data || false;
// Lines 325-352: New handleCreateModel function (~30 lines)Before this PR: 513 lines Why This Matters
The explorer step has fundamentally different concerns than form submission:
These shouldn't share the same state container. Required ChangesOption 1: Extract to Separate Component ⭐ (Recommended) Create <!-- AddDataExplorerStep.svelte -->
<script lang="ts">
export let connector: V1ConnectorDriver;
export let onModelCreated: (path: string) => void;
export let onBack: () => void;
// All explorer state lives here
let selectedConnector = "";
let selectedDatabase = "";
let selectedSchema = "";
let selectedTable = "";
let creatingModel = false;
$: modelingSupportQuery = useIsModelingSupportedForConnector(
instanceId,
selectedConnector
);
async function handleCreateModel() {
// Model creation logic (moved from AddDataForm)
const [path] = await createModelFromTable(...);
onModelCreated(path);
}
</script>
<DataExplorerDialog
connectorDriver={connector}
onSelect={(detail) => {
selectedConnector = detail.connector;
selectedDatabase = detail.database;
selectedSchema = detail.schema;
selectedTable = detail.table;
}}
/>
<Button
disabled={!selectedTable || creatingModel}
loading={creatingModel}
onClick={handleCreateModel}
>
Create model
</Button>Then simplify {#if stepState.step === "explorer"}
<AddDataExplorerStep
{connector}
onModelCreated={async (path) => {
await goto(`/files${path}`);
onClose();
}}
onBack={formManager.handleBack}
/>
{:else}
<!-- Existing form steps - connector and source -->
{/if}Benefits:
Option 2: Extract to Utility Function (Minimum acceptable) If you prefer not to create a new component, at minimum extract // web-common/src/features/sources/modal/model-creation-utils.ts
export async function createModelFromExplorerSelection(
queryClient: QueryClient,
options: {
connector: string;
database: string;
schema: string;
table: string;
isModelingSupported: boolean;
}
): Promise<[string, string]> {
return options.isModelingSupported
? await createSqlModelFromTable(
queryClient,
options.connector,
options.database,
options.schema,
options.table
)
: await createYamlModelFromTable(
queryClient,
options.connector,
options.database,
options.schema,
options.table
);
}This reduces duplication and makes the logic testable, but doesn't address the state management concern. RecommendationPlease implement Option 1 (extract to separate component) before merging. This will:
The refactoring shouldn't take long since the logic is already written—it just needs to be moved into the right component boundary. Developed in collaboration with Claude Code |
ericpgreen2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add e2e tests to cover this new functionality?
Di7design
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Table items listed in the data explorer modal are too small( use design component, do not reuse left nav table list as it's served for limited space).
- missing add connector action on the left side of the modal
- missing source name and search functions.
Functionally it's a good start, please implement based on design for follow up implementation.
|
Closing this as we focus on the schema-driven refactor. |


This PR adds a Data Explorer UI for Data Warehouse and Databases. Closes https://linear.app/rilldata/issue/APP-516/data-explorer-ui-for-data-warehouse-and-databases
Checklist: