Skip to content

fix(ui): resolve the remaining 7 items of #90 - #118

Merged
kwrkb merged 10 commits into
mainfrom
fix/issue-90-remaining
Oct 2, 2026
Merged

kwrkb merged 10 commits into
mainfrom
fix/issue-90-remaining

Conversation

@kwrkb

@kwrkb kwrkb commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Issue #90 の残り 7 件(項目 2, 5, 6, 9, 10, 11, 12)を 1 件 1 コミットで解消する。機能追加なし。これで #90 は全 12 件対応済み。

# 内容 修正 コミット
2 履歴ナビ中の実行でドラフト消失 履歴エントリ実行時はドラフトを保留し、次の Ctrl+P で上書きしない。Ctrl+N で戻したら破棄 3e6c3fb
5 エクスポートがソート順・フォーカス中ペインを無視 exportSource で表示中のペイン・ソート順を出力((no rows) センチネルは出さない) ebff342
6 AI 送信が実行中クエリを黙ってキャンセル AI に専用の cancel / seq。Ctrl+C と接続切替は両方、AI モードの Esc は AI だけ止める 6d1447f
9 全クエリ後に Tables() 再取得 + 補完キャッシュ破棄 readonly.Check が読み取り専用と判定した文では再取得しない(判定不能は再取得) 668ac7b
10 ソートの ParseFloat 多発と全セル幅の再計算 decorate-sort-undecorate(compareValues の意味論は維持)+ 列ごとのセル最大幅をキャッシュ。1 万行で 68.7ms → 30.3ms。整数キーは float パースを省略 cd365f6, 最終コミット
11 STATS の行が折り返して下端が欠ける 組み立て後の各行を contentWidth で切る(clampLines) 300b62b
12 DETAIL の scroll が捨てられる / 長い値で下端が欠ける scroll を updateDetail で確定。フィールドを実測高で並べ、1 フィールドがモーダルより高いときだけ値を切る b436f9e

判断の記録は LESSONS.md に 3 エントリ(ffd53aa)。

項目 9 の副作用: 別クライアントが作った/消したテーブルは、asql 側で DDL/DML を実行するか接続を切り替えるまでサイドバーと補完に反映されない(以前は次の SELECT で反映されていた)。サイドバーに再読込キーはないので、外部の変更は接続切替で反映する。

テスト

  • 各項目に回帰テストを追加。項目 2 / 9 / 11 / 12 は修正前のコードで FAIL することを確認済み(5 / 6 は新ヘルパ・新フィールドのため修正前はビルド不可)
  • go vet ./... / go test ./... / govulncheck ./...(0 件)/ bash e2e/run.sh(8/8 PASS)

🤖 Generated with Claude Code

kwrkb and others added 8 commits September 30, 2026 23:47
…the catalog

Issue #90 item 9. Every successful query, SELECT included, re-ran Tables()
and its arrival dropped the completion column cache. Gate the reload on
readonly.Check: whatever it cannot prove read-only still reloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue #90 item 6. Submitting an AI prompt reused queryCancel/querySeq, so
it cancelled a running query without a word. Ctrl+C and a connection
switch now cancel both; Esc in AI mode cancels only the AI request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue #90 item 2. Running an entry while navigating reset historyIdx, and
the next Ctrl+P saved the executed query over the unexecuted draft. The
draft now stays pending until Ctrl+N brings it back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue #90 item 5. Export always wrote m.lastResult in query order, ignoring
an `s` sort and a focused pinned pane in compare mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orts

Issue #90 item 10. sortedRows parsed both sides on every comparison, and a
sort re-measured every cell though only the header indicator changes.
Decorate-sort-undecorate with a sortKey that keeps compareValues'
pair-by-pair semantics, and cache the widest cell per column in
applyResult. 10k-row benchmark: 68.7ms -> 30.3ms, 819k -> 277k allocs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue #90 item 11. Rows built from fixed budgets reached 84 cells against a
72-cell wrap width; lipgloss wrapped them and the modal's bottom was cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… scroll

Issue #90 item 12. The render moved m.detail.scroll on a value receiver, so
the move was lost every frame; updateDetail now settles it. The layout
assumed one line per value, but long values wrap: fields ran past the modal
and the lower border fell off the screen. Fields are now measured, and a
single field taller than the modal shows as much of its value as fits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T15:22:54.832120Z 962abd1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

float64(i) equals ParseFloat's result for the same decimal string, so the
integer path no longer parses twice — computeColumnStats' min/max pays no
more than before the sortKey change. Note that smartCompare is now test-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffd53aa49c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/ui/insert.go Outdated
Comment on lines +77 to +79
if m.historyDraft == "" || value != m.queryHistory[len(m.queryHistory)-1] {
m.historyDraft = value
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Track an empty history draft separately

When the editor was empty before entering history, executing a history entry legitimately preserves historyDraft == ""; on the next Ctrl+P this condition treats that valid draft as absent and overwrites it with the executed query. Ctrl+N then returns the executed query instead of restoring the empty editor, so draft presence needs state separate from the draft string's contents.

Useful? React with 👍 / 👎.

An empty editor is a valid draft, but Ctrl+P took historyDraft == "" for
"none saved" and replaced it with the query just run from history, so
Ctrl+N returned that query instead of the empty editor. A draftPending
flag now records whether a draft is saved. (Codex review on #118)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kwrkb
kwrkb merged commit a3da2d5 into main Oct 2, 2026
3 checks passed
@kwrkb
kwrkb deleted the fix/issue-90-remaining branch October 2, 2026 15:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 962abd18dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/ui/model.go
Comment on lines +613 to +614
if readonly.Check(msg.query) == nil {
return m, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry catalog loading after an initial failure

When the startup Tables() request fails transiently, sidebar.tables remains empty and there is no successful catalog snapshot. After this change, every successful read-only query returns here without retrying, and the sidebar has no manual refresh action, so table navigation and table-name completion remain unavailable until the user switches connections or executes a write-classified statement. Preserve a failed/not-yet-loaded state and retry the catalog load after a later successful query.

Useful? React with 👍 / 👎.

kwrkb added a commit that referenced this pull request Oct 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kwrkb added a commit that referenced this pull request Oct 4, 2026
* fix(ui): retry the table list after a failed load

Since #118 a read-only query no longer reloads the table list. A load
that failed — a timeout on a large catalog at connect, a dropped
connection — was then never retried short of a write or a connection
switch, leaving the sidebar and table-name completion empty; before,
the next SELECT healed it. Record the failure and reload after any query
while it stands. (Codex review on #118, unaddressed before merge)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4

* perf(ui): pick the export pane without sorting it on `e`

`e` called exportSource only to see whether the pane had columns, which
sorted every row and then sorted again on export. exportPane picks the
pane alone. Also say plainly that the cell-width fallback in
applyResultWithSort only notices a change in column count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4

* docs(plan,history): record the unreleased #119 fix after v0.12.4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4

* fix(ui): drop a table-list load superseded by a newer one

With the retry after a failed load, two queries finishing while a retry
is out start two loads on one connection. connGen cannot tell them
apart, so an older failure landing after a newer success put back the
failure state and its error status, and a late success could put back a
stale list. Each load now carries sidebar.loadSeq and only the newest
one is applied. (Codex review on #119)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant