Skip to content

Local#2

Merged
feigeCode merged 8 commits intofeigeCode:devfrom
htmambo:local
Mar 20, 2026
Merged

Local#2
feigeCode merged 8 commits intofeigeCode:devfrom
htmambo:local

Conversation

@htmambo
Copy link
Copy Markdown

@htmambo htmambo commented Mar 17, 2026

Closes #[issue number]

Description

Describe in English for the changes made in this pull request and the problem it solves.
Please keep 1 PR to solve 1 problem, and keep Small improvements should be small modifications to make PR easier to review and to merge.

Screenshot

Before After
[Put Before Screenshot here] [Put After Screenshot here]

Break Changes

Describe any breaking changes introduced by this pull request. If none, remove this section.

  • Change 1
- Old code snippet
+ New code snippet

How to Test

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

Copilot AI review requested due to automatic review settings March 17, 2026 08:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR bundles multiple improvements: table data navigation and sorting, horizontal scroll fixes, window auto-quit behavior, macOS icon generation from SVG, and widespread rustfmt reformatting.

Changes:

  • Adds keyboard navigation (Tab, Shift-Tab, arrow keys, Home/End, PageUp/PageDown) to EditTable, implements column sort with ORDER BY integration and deferred updates to avoid GPUI reentrant panics, and fixes horizontal scroll synchronization during cell navigation.
  • Adds cx.on_release to the main application entity so closing the main window triggers cx.quit() and proper cleanup.
  • Adds a new generate-macos-icon.sh script that regenerates .icns from logo.svg before bundling, plus extensive rustfmt reformatting across many files.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
script/generate-macos-icon.sh New script to generate macOS .icns from logo.svg using sips/iconutil
script/bundle-macos.sh Calls icon generation before bundling
main/src/onetcli_app.rs Adds on_release handler to quit app when main window closes
main/src/home_tab.rs Formatting changes (import reordering, line wrapping)
main/src/home/home_tabs.rs Formatting changes
main/src/home/home_connection_quick_open.rs Formatting changes
main/src/setting_tab.rs Minor closure formatting
crates/one_ui/src/edit_table/mod.rs Adds keyboard bindings for navigation actions
crates/one_ui/src/edit_table/state.rs Implements cell-level navigation, horizontal scroll sync, page up/down, and editing Tab/Shift-Tab support
crates/db_view/src/table_data/results_delegate.rs Implements perform_sort with window.defer, adds ORDER BY parsing/normalization, changes text editor to single-line
crates/db_view/src/table_data/data_grid.rs Adds apply_column_sort and build_header_order_by_clause for sort-to-query integration
crates/db_view/src/table_data/filter_editor.rs Adds set_order_by_clause for programmatic ORDER BY updates
crates/db_view/src/table_designer_tab.rs Formatting changes
crates/db_view/src/db_tree_view.rs Formatting changes
crates/terminal_view/src/view.rs Formatting changes
crates/terminal_view/src/lib.rs Formatting changes
crates/terminal_view/src/sidebar/* Formatting changes
crates/terminal_view/src/serial_form_window.rs Formatting changes
crates/terminal/src/terminal.rs Formatting changes
crates/terminal/src/serial_backend.rs Formatting changes
crates/redis_view/src/redis_tree_view.rs Formatting changes
crates/core/src/agent/dispatcher.rs Formatting changes
.claude/* AI workflow documentation (context summaries, operation logs, verification reports)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mkdir -p "$(dirname "$OUTPUT_ICNS")"

echo "Rendering macOS icon from ${SOURCE_SVG}..."
sips -s format png "$SOURCE_SVG" --out "$MASTER_PNG" >/dev/null
htmambo added 6 commits March 19, 2026 16:13
详细说明:
- 新增 ensure_col_visible 方法,根据当前视口精确计算滚动偏移
- 新增 queue_cell_scroll 方法,统一处理行列同步滚动
- scroll_to_col 改为调用 ensure_col_visible,支持固定列偏移感知
- select_cell 改为调用 queue_cell_scroll,解决选中单元格后列不可见的问题

技术细节:
- 通过 fixed_head_cols_bounds 或逐列累加计算固定列宽度
- 考虑右侧滚动条宽度 SCROLLBAR_WIDTH 修正视口右边界
- 边界情况处理:列宽为零时降级使用 scroll_to_item

文件变更:
- 修改:crates/one_ui/src/edit_table/state.rs
- 修改:.claude/operations-log.md
- 修改:.claude/verification-report.md
- 新增:.claude/context-summary-table-data-horizontal-scroll.md

测试状态:
- [x] 功能测试通过
详细说明:
- 新增 QuitApp action,绑定 cmd-q (macOS) / alt-f4 (其他平台)
- 在设置页面的窗口快捷键列表中显示退出应用快捷键
- 新增 quit_app 本地化字符串支持中英文和繁体中文

文件变更:
- 修改:main/src/onetcli_app.rs
- 修改:main/src/setting_tab.rs
- 修改:main/locales/main.yml

测试状态:
- [x] 功能测试通过
详细说明:
- MySQL: 修复 conn_ttl 被误用为连接超时的问题,改用 tokio::timeout 包装连接操作
- ClickHouse: 添加 tokio::timeout 包装连接测试操作
- Oracle: 为 spawn_blocking 连接操作添加 tokio::timeout 保护
- SSH 隧道: 为 SSH 隧道建立过程添加超时保护,支持 ssh_timeout 参数

技术细节:
- MySQL 的 conn_ttl 是连接生命周期 TTL,不是连接建立超时
- 所有数据库连接默认超时设置为 30 秒
- SSH 隧道默认超时也设置为 30 秒
- 通过 tokio::time::timeout 实现异步超时控制

文件变更:
- 修改:crates/db/src/mysql/connection.rs
- 修改:crates/db/src/clickhouse/connection.rs
- 修改:crates/db/src/oracle/connection.rs
- 修改:crates/db/src/ssh_tunnel.rs

测试状态:
- [x] 编译通过
htmambo and others added 2 commits March 19, 2026 17:05
详细说明:
- 删除 connection_sync.rs 中未使用的 resolve_conflicts_with_strategies 方法
- 删除 sql_editor_view.rs 中未使用的 compress_sql import
- 删除 home_tab.rs 中未使用的 resolve_all_conflicts 方法

文件变更:
- 修改:crates/core/src/cloud_sync/connection_sync.rs
- 修改:crates/db_view/src/sql_editor_view.rs
- 修改:main/src/home_tab.rs
@feigeCode feigeCode merged commit 7098032 into feigeCode:dev Mar 20, 2026
@feigeCode
Copy link
Copy Markdown
Owner

感谢贡献

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.

3 participants