SequelPG

v0.3.0 made the autocomplete smarter — it learned which clause you were in and ranked suggestions accordingly. v0.3.4 rebuilds the part you actually look at: the popup itself. The native macOS completion list is gone, replaced by a purpose-built, JetBrains-style panel that bolds the characters you’ve typed, color-codes each suggestion by kind, and — finally — can be switched off. Two long-standing UI papercuts go with it.

The completion popup, rebuilt

The native NSTextView popup had been a steady source of friction: a plain list with no type information, an inline preview that overwrote your next keystroke, finicky acceptance, and no way to turn it off. v0.3.4 drops that path entirely for a custom panel modelled on the way JetBrains IDEs present completions.

The hard part of a custom completion popup on macOS is keeping the editor in focus. The new popup is a non-activating NSPanel attached as a child window: it can never become the key window, so the editor’s text view stays first responder the entire time the list is open. You keep typing normally and the popup simply re-queries on each keystroke — no global event monitors, no intercepting and re-injecting characters (which is exactly what corrupted input in an earlier custom-panel attempt).

On screen, each row is themed to match the app: a kind chip (keyword, table, column, schema, function), the suggestion with the characters you’ve already typed bolded in the accent color, and a type detail on the right. The selected row is highlighted, ↑/↓ moves through the list and wraps, and you can click a row to accept it. Ranking still runs through the same clause-aware completion provider from v0.3.0 — unchanged and still unit-tested — so the panel is purely a better way to show and pick from results that were already good.

Acceptance behaves the way a code editor should: inserting a suggestion leaves the caret at the end of the inserted text with nothing selected (so your next keystroke doesn’t overwrite what you just chose), and the whole insertion is registered as a single undo step. The panel dismisses itself when it stops making sense — on scroll, on window resize, when the window deactivates.

An off switch — and on-demand invoke

Not everyone wants suggestions appearing as they type. Settings → SQL Editor now has a “Suggest completions while typing” toggle (on by default). Turn it off and the popup never auto-fires — but completion isn’t gone: Escape or ⌃Space still invokes it on demand, exactly when you want it and never when you don’t. (Closes #4.)

Schema and table names outrank keywords in DDL targets

Autocomplete used to embarrass itself on DDL. Type DROP SCHEMA validate_… and it would happily rank VACUUM and VALUES above the schema you were obviously about to name. v0.3.4 adds dedicated schemaTarget and objectTarget contexts: when the grammar says the next token is the object a statement acts on, the matching object type is ranked first. Keywords stay in the list — they’re just deprioritised where they make no sense. The DDL-ranking change ships with seven new tests on top of the existing completion-provider suite. (Closes #5.)

Two UI fixes

A “Running query…” state in the results pane. When you ran a statement with no previous result on screen, the entire results area went blank while it executed — every render branch was gated behind “not executing,” so there was nothing to show in between. There’s now a centered running state — a spinner and the target connection — so a slow query reads as working, not frozen.

Navigator sidebar label colors. In the sidebar list, the database / category / object name labels were inheriting the default semantic text color, which renders all but invisibly on the app’s custom dark canvas — so the navigator could show row counts next to names you couldn’t read. Those labels now carry explicit Theme colors (along with the Loading, No-schemas, and New-… rows), so the tree is legible in both light and dark.

Concretely, v0.3.4 means

  • A new JetBrains-style completion popup — a non-activating child NSPanel that keeps the editor focused, with kind chips, matched characters bolded in the accent color, type detail, ↑/↓ navigation with wrap, and click-to-accept
  • Accepting a suggestion leaves the caret at the end with no selection, registered as a single undo step
  • A “Suggest completions while typing” toggle in Settings → SQL Editor (default on); Escape / ⌃Space invoke completion on demand even when it’s off (#4)
  • New schemaTarget / objectTarget ranking so schema and table names outrank keywords in DDL targets — DROP SCHEMA … no longer prefers VACUUM (#5)
  • A centered “Running query…” state in the results pane instead of a blank area while a statement executes
  • Explicit Theme colors on the navigator sidebar labels so database, category, and object names stay legible on the dark canvas
  • New SQLCompletionPopup.swift (panel, list view, model, controller) with completion ranking, insertion, the editor preference, and controller navigation all unit-tested; full suite green and a clean release build

Grab v0.3.4 from the latest release or build from source with Xcode. Open the query editor, start typing a table name, and you’ll see the new popup straight away — or, if you’d rather it stayed quiet, switch it off in Settings and call it up with ⌃Space when you need it.