• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase / 29268830121
74%

Build:
DEFAULT BRANCH: master
Ran 13 Jul 2026 05:07PM UTC
Jobs 1
Files 112
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Jul 2026 05:02PM UTC coverage: 73.966% (-0.05%) from 74.016%
29268830121

push

github

web-flow
refactor(sql-editor): own shared editor refs in SQLEditorContext (decompose 3/N) (#47837)

## Summary

PR **3** in the SQLEditor decomposition stack. The keystone structural
step: introduce a context provider that owns the shared, mutable Monaco
state, so later PRs can extract logic hooks and presentational panes
without threading the same three refs through every signature.

Behavior-preserving — the characterization suite (merged in PR 1) stays
green with identical assertions.

## What changed

New `SQLEditorContext.tsx`:
- `SQLEditorProvider` owns the shared refs (`editorRef`, `monacoRef`,
`diffEditorRef`, `scrollTopRef`), the run-refocus flag, and the
error-highlight decorations.
- `useSQLEditorContext()` guard hook (React 19 `use()`), mirroring the
canonical `PoliciesDataContext` pattern.
- Stable helpers: `refocusEditor`, `clearPendingRunRefocus`,
`markRefocusAfterRun`, `refocusEditorAfterRunIfNeeded`, `getEditorSql`,
`clearHighlights`, `applyErrorHighlight`.

`SQLEditor.tsx`:
- Split into
`<SQLEditorProvider><SQLEditorContent/></SQLEditorProvider>`.
- `SQLEditorContent` reads refs/helpers from context instead of local
`useRef`/`useCallback`.
- `lineHighlights` moves from React state to a ref inside the provider
(decorations are purely imperative; nothing renders off them). This also
removes the stale-closure hazard the old `executeQuery` dep-array
omission worked around.

The context value holds only stable identities (refs + `useCallback`s,
memoized once), so the provider never re-renders its consumers — it's a
dependency-injection channel, not reactive state.

## Verification

- `vitest` — 156 pass (characterization + utils), assertions unchanged
- `pnpm --filter studio typecheck` — clean for all SQL editor files (the
two `@sentry/tanstackstart-react` errors are a pre-existing
local-install gap on master, unrelated)
- `eslint` — 0 errors
- Equivalence: single `useEffectEvent`, `drainDiffRequest`
driving-effect deps `[diffRequest.pending, edit... (continued)

1198 of 1655 branches covered (72.39%)

Branch coverage included in aggregate %.

1771 of 2359 relevant lines covered (75.07%)

246.33 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
87.5
-12.5% apps/studio/lib/telemetry/use-track-funnel-error.ts
Subprojects
ID Flag name Job ID Ran Files Coverage
1 studio-tests 29268830121.1 13 Jul 2026 05:07PM UTC 112
73.97
GitHub Action Run
Source Files on build 29268830121
  • Tree
  • List 112
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #29268830121
  • 9726940d on github
  • Prev Build on master (#29260463301)
  • Next Build on master (#29269330786)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc