Conversation
✅ Code Review CompleteSummaryThis PR successfully refactors "Save Anyway" to "Save" with improved visibility and adds the HighlightsArchitecture & Code Quality
Test Coverage
UX Improvements
Files Reviewed
LGTM! Ready to merge once CI passes. 🚀 🤖 Generated with Claude Code |
|
@lovincyrus, can you please do the first code review? Once you think it's good-to-go, please tag me and I'll do a final review. |
lovincyrus
left a comment
There was a problem hiding this comment.
AddDataForm.svelte:89-98 — shouldShowSkipLink references stepState before it's declared
// line 89
$: shouldShowSkipLink = checkShouldShowSkipLink(
stepState.step, // used here
connector?.name,
connectorInstanceName,
connector?.implementsOlap,
);
// line 98
$: stepState = $connectorStepStore; // declared hereSvelte's reactive system resolves this at runtime, but it reads as a use-before-declare and is fragile if someone refactors these into non-reactive code. Can you move $: stepState = $connectorStepStore above the shouldShowSkipLink block?
ConnectorAddModelButton.spec.ts — tests JavaScript operators, not the component
This file duplicates the component's logic inline and asserts on it:
const isDisabled = hasUnsavedChanges || hasReconcileError || !driverName;
expect(isDisabled).toBe(true);This verifies that true || false || false === true — if the component's disabled condition changes, these tests still pass. The tooltip tests have the same issue. The imported functions (getSchemaNameFromDriver, OLAP_ENGINES) are already covered by connector-schemas.spec.ts.
I'd suggest removing this file. It adds maintenance cost without catching real regressions.
royendo
left a comment
There was a problem hiding this comment.
PR #8769 Review: feat: Save Anyways -> Save
CI Status
PENDING - e2e tests still running. Build and analysis checks are passing.
Summary
This PR refactors the "Save Anyway" button to a simpler "Save" button for connector forms, addressing an issue where the previous flow caused multiple keys in .env files. Key changes:
- Renamed "Save Anyway" to "Save" - Always visible on connector step (when not using public auth)
- New "Import Data" button -
ConnectorAddModelButton.sveltefor importing data from workspace header - Enhanced
addSourceModal.open()- Now acceptsconnectorNameandconnectorInstanceNameparameters - New utility functions -
getSchemaNameFromDriver()andshouldShowSkipLink()inconnector-schemas.ts - Comprehensive test coverage - Unit tests for all new functionality
Key Findings
Strengths:
- Excellent test coverage (379 lines of new tests across 3 test files)
- E2E tests properly updated for new button labels
- Good JSDoc comments on all new functions
- Follows existing component patterns (
ConnectorAddModelButtonmirrorsConnectorRefreshButton) - Clean refactoring from
saveAnyway/showSaveAnywayto simplersavingstate - No security concerns identified
Minor Suggestions (non-blocking):
ConnectorAddModelButton.svelte: Consider renamingopenAddModeltoopenImportDataModalfor clarityConnectorAddModelButton.svelte: Reorder imports -lucide-svelte(third-party) should come before@rilldata/*importsAddDataForm.svelte: The import aliasshouldShowSkipLink as checkShouldShowSkipLinkis slightly awkwardAddDataModal.svelte: The popstate handler (lines 65-88) has grown complex - consider extracting connector resolution into a named function
Decision: COMMENT
Well-implemented PR with good test coverage and proper patterns. Cannot APPROVE until CI completes. Once e2e tests pass, this PR is ready to merge.
🤖 Generated with Claude Code
* clickhouse play template * increase width/height of modal * dropdown with all 4 connectors * prettier * colosr! * code qual * e2e and error handling * fix button for Rill Managed * as req and update e2e * removing see description The core logic is already tested by unit tests in code-utils.spec.ts - specifically replaceOlapConnectorInYAML. The e2e test is just testing the UI flow that triggers this logic. Since the unit tests already cover the YAML manipulation, and the integration point is simply the OLAP_ENGINES.includes() check in submitAddDataForm.ts:389, we can safely remove the flaky e2e test. * fix save anyawys but will be changed with #8769 * Update save-anyway.spec.ts * feedback from review, testing 1080p playwright to see button due to increased height consolidate the JSONSchemaRender, decrease the form height, Salesforce doesnt need TALL * prettier * bug fix * local Claude PR review fixes * as req default port wasnt showing with changes only to clickhouse.ts, added extra logic that required clearErrorOnInput for error message * code qual; * since we're here, quick change to support duck too/ * hide rill-managed * prettier * remove e2e from as rill-managed is commented out * prettier * code qual * fix * as req * e2e fix, Root cause of the e2e failure: saveConnectorAnyway() internally calls goto('/files/connectors/clickhouse.yaml') to navigate. Then handleSaveAnyway called onClose() → resetModal(), which fired window.history.pushState + dispatchEvent(new PopStateEvent(...)). The synthetic popstate raced with SvelteKit's router (especially with invalidate("init") from the rill.yaml write), causing the navigation to revert to root. The fix uses resetModalQuietly() which just resets the UI state variables directly, without touching the history API.
|
@ericokuma what do you think about putting Save on the model step? or should we implement |
https://www.loom.com/share/cb6134ba1b484d4ab4b483edbe2b15da
Follow up to: #8636 (comment)

as Save Anyways caused mulitple keys to be created in .env.
Save is a step forward for "Edit connector" feature as it doesnt require a test connect to fail for the button to appear.
Checklist: