fix: Compare - degrade-routines on MariaDB 1558 + dark-mode dropdowns (#218, #219) - #231
Merged
Conversation
…#218, #219) Two related Compare-feature bugs, fixed together: #218 (dark-mode contrast): - src/styles/globals.css: add 'color-scheme: dark' / 'color-scheme: light' to the two theme blocks. Without this, Chromium uses the OS color scheme for native form controls (selects, scrollbars), so dropdown triggers and option popups render light even when the page is dark. - Bump dark --color-text-muted from #5a5a6e to #8b8ba0. Was failing WCAG AA against the dark panel background; 'Source' / 'Target' labels were nearly invisible. - SchemaCompare.tsx EndpointSelector: replace the label's text-[var(--color-text-muted)] with text-[var(--color-text-secondary)] - extra readability margin independent of the global token bump. - SchemaCompare.tsx EndpointSelector: replace disabled:opacity-40 on the database selects with disabled:text-[var(--color-text-muted)] disabled:opacity-70. opacity-40 on top of an already-low-contrast placeholder made 'Select database...' nearly invisible until a connection was picked. #219 (Compare fails on MariaDB stale mysql.proc): - Split getRoutines out of the main fetchSnapshot Promise.all into its own try/catch. Per-side routine failures no longer cascade into a total comparison failure. The whole point of diffing schemas (tables, views, triggers) stays intact. - New discriminated union RoutineIssue { kind: 'routines-mariadb-upgrade' | 'routines-failed', side, raw }. classifyRoutinesError() detects 1558 / mysql.proc / mariadb-upgrade in the error string and tags it for the structured UI. - New RoutineIssueBanner component renders the issue in a yellow alert with an action path - the MariaDB-upgrade case shows the exact 'mariadb-upgrade -u root -p' command, the generic case shows the truncated raw error. Each banner has a dismiss X. - 'Include routines' checkbox (default on) added to the setup row. Unchecking it skips the getRoutines call entirely. Off by default if your server's mysql.proc is broken and you just want to diff schemas; you can also uncheck and rely on the warning banner. - handleCompare accumulates per-side routine errors, sets them on a dedicated routineIssues state, and renders them below the setup row alongside the existing 'Comparison failed' red banner (which remains for non-routine failures). Tests added (compare.test.tsx 19 -> 24): - defaults 'Include routines' to checked - completes comparison and shows MariaDB-upgrade warning when getRoutines throws 1558 - red 'Comparison failed' banner still renders for non-routine failures (backward compat) - routine warning dismisses via its X - 'Include routines' unchecked skips getRoutines call entirely Resolves #218, #219.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related Compare-feature bugs landed together:
color-schemeon theme blocks; dark muted text contrast bump; disabled-state opacity rebalancemysql.proc(error 1558), even though tables/views/triggers would have diffed fineWhy together
Both bugs surface in the Compare UI in the same place. Knocked out back-to-back while context was fresh.
#218 details
src/styles/globals.css:color-scheme: darkto dark theme block. Addcolor-scheme: lightto light theme block. Without these, Chromium uses the OS color scheme for native form controls (selects, scrollbars), so dropdown triggers + option popups + scrollbars render light even on a dark-themed page.--color-text-muteddark from#5a5a6eto#8b8ba0. Was failing WCAG AA against the dark panel background; "Source" / "Target" labels were effectively invisible.src/components/compare/SchemaCompare.tsxEndpointSelector:text-[var(--color-text-muted)]->text-[var(--color-text-secondary)]. Extra readability margin independent of the global token bump.disabled:opacity-40->disabled:text-[var(--color-text-muted)] disabled:opacity-70. With pure opacity-40 on top of an already-low-contrast placeholder, "Select database..." was nearly invisible until a connection was picked.#219 details
src/components/compare/SchemaCompare.tsx:Split
getRoutinesout of the mainPromise.allinto its own try/catch. Per-side routine failures no longer cascade into a total failure. Schema diff (tables, views, triggers) now completes.New
RoutineIssuediscriminated union ({ kind: 'routines-mariadb-upgrade' | 'routines-failed', side, raw }).classifyRoutinesError()matches the substring1558 | mysql.proc | mariadb-upgradeand tags the issue for the structured UI.New
RoutineIssueBannercomponent renders the issue in a yellow alert with an action path. The MariaDB-upgrade case shows the exactmariadb-upgrade -u root -pcommand. The generic case shows the truncated raw error. Each banner has a dismiss X."Include routines" checkbox (default on) added to the setup row. Unchecking it skips the
getRoutinescall entirely. Useful as an opt-out when the server'smysql.procis broken and the user only wants to diff tables/views/triggers.handleCompareaccumulates per-side routine errors onto a dedicatedroutineIssuesstate and renders them below the setup row. The existing "Comparison failed" red banner remains for non-routine failures (backward-compatible).Tests added (compare 19 -> 24)
Include routinesto checkedInclude routinesunchecked skipsgetRoutinescall entirelyVerification
npx vitest run src/components/compare/__tests__npx vitest run(full)npm run type-checknpx eslint(touched files)npx dprint checkNotes
routineIssues) rather than a singlestring | null. Two issues (source + target) can coexist. Dismiss is per-issue via array index filter.src-tauri/crates/mas-core/src/schema/inspector.rs:get_routines) is unchanged - this is purely a frontend UX fix.CoreError::Schemato carry structured sqlx error codes through IPC. Crosses the IPC contract; filing as a separate issue if pursued.Resolves #218, #219.