[WIP] Improve system keyboard shortcut functionality#2
Closed
Conversation
Copilot stopped work on behalf of
datlechin due to an error
December 22, 2025 15:20
5 tasks
datlechin
added a commit
that referenced
this pull request
Apr 28, 2026
Implement the new Connection trait methods on each driver so the
Structure tab can load existing indexes and FK constraints when
opening a table for editing.
- Postgres: pg_index + pg_constraint joined with pg_class /
pg_attribute. array_agg(... ORDER BY ordinality) preserves the
column order on composite indexes / FKs. confdeltype /
confupdtype single-char codes map through pg_action_char_to_keyword
to canonical SQL action keywords ("RESTRICT", "CASCADE", etc.).
- MySQL: information_schema.statistics for indexes (grouped by
index_name in Rust since sqlx doesn't aggregate ordered column
arrays natively); key_column_usage JOIN referential_constraints
for FKs. "PRIMARY" maps to is_primary; non_unique inverts to unique.
- SQLite: PRAGMA index_list + per-index PRAGMA index_info. Implicit
PK indexes that use the rowid alias don't appear in index_list
so they're synthesised from PRAGMA table_info when no origin='pk'
row exists. PRAGMA foreign_key_list grouped by synthetic id since
SQLite doesn't store user-visible FK names — we render
"fk_{table}_{id}" stably.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
datlechin
added a commit
that referenced
this pull request
Apr 28, 2026
Two bugs surfaced from a screenshot of the Edit-mode Structure tab
on a freshly-loaded MySQL "users" table:
1. Double title bar — the embedded adw::HeaderBar inside structure_tab
inherited GTK4's default show_start_title_buttons / show_end_title
_buttons = true and rendered its own min / max / close trio under
the AdwApplicationWindow's real chrome. Fix: explicit
.show_start_title_buttons(false).show_end_title_buttons(false) on
the embedded header.
2. "19 pending changes" before any user input. Cause: GTK fires
`changed` and `toggled` synchronously during widget set-up — when
rebuild_columns_view tears down + recreates the row widgets, every
Entry::set_text / CheckButton::set_active for the loaded values
echoes back through the row's connect_* handlers, which treat them
as fresh user edits and stamp AlterColumn ops onto the tracker.
For 7 columns × ~3 fields each that's exactly the 19 phantom ops
the user saw.
Fix is two-pronged:
- rebuild_columns_view sets the existing suppress_emit flag to
true before the rebuild, schedules glib::idle_add_local_once to
reset it once the initial signal storm drains. Every signal
handler in build_column_row now checks suppress_emit and
returns early when it's true, so widget set-up stays silent.
- ColumnEdited handler now skips the tracker push entirely when
the post-edit DraftColumn matches the prev value (no actual
change). When the user reverts an existing column to its
original ColumnInfo, retain_ops strips any prior AlterColumn
ops on that column so the dirty-count goes back to zero.
Defence-in-depth — even if a suppress-flag race ever leaks an
event, a no-op edit can no longer pollute the tracker.
The third reported anomaly (id PK column showing Nullable=✓) was a
downstream consequence of bug #2: a phantom Nullable(true) op fired
during rebuild flipped the model's nullable=true for the id row.
With #2 fixed, the checkbox now reflects MySQL's actual NOT NULL
state.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
14 tasks
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.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.