Skip to content

feat: add hex editor popover for BLOB columns#431

Merged
datlechin merged 5 commits intomainfrom
feat/hex-editor-popover
Mar 22, 2026
Merged

feat: add hex editor popover for BLOB columns#431
datlechin merged 5 commits intomainfrom
feat/hex-editor-popover

Conversation

@datlechin
Copy link
Collaborator

@datlechin datlechin commented Mar 22, 2026

Summary

  • Add hex editor popover that opens on double-click of BLOB/binary column cells in the data grid
  • Popover shows read-only hex dump (address | hex bytes | ASCII) and editable hex input with live validation
  • Follows the same pattern as the existing JSON editor popover (PopoverPresenter, commitPopoverEdit)

Changes

  • New: HexEditorContentView.swift — SwiftUI popover with HexDumpDisplayView (read-only NSTextView) and HexInputTextView (editable NSTextView with coordinator)
  • Modified: DataGridView+Click.swift — added BLOB type check in handleDoubleClick() before multiline fallthrough
  • Modified: DataGridView+Popovers.swift — added showBlobEditorPopover() method
  • New: HexEditorTests.swift — 31 tests covering formatting, parsing, validation, round-trips, and edge cases

Test plan

  • All 31 unit tests pass (HexEditorTests)
  • Connect to MariaDB/MySQL with BLOB columns → double-click BLOB cell → hex editor appears
  • Edit hex → Save → cell updates with new value
  • Double-click NULL BLOB cell → empty editor → type hex → Save
  • Cancel discards changes
  • Invalid hex shows "Invalid hex" in red, Save button disabled
  • Large BLOB (>10KB) shows truncated hex dump

Summary by CodeRabbit

  • New Features

    • Hex editor popover for BLOB/binary cells now opens on double-click; BLOBs are excluded from inline editing.
    • Popover shows a read-only hex dump plus editable hex input with live validation, byte-count, truncation/read-only states, and Cancel/Save (keyboard shortcuts). Edits commit only when content changes and multiple hex input formats are accepted.
  • Documentation

    • Added Hex Editor docs and clarified grid BLOB display/size rules.
  • Tests

    • Added comprehensive hex formatting/parsing and truncation tests.
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant