Conversation
QSSベースのライト/ダークテーマ切替、SQLエディタへのモノスペースフォント適用、 Ctrl+Enter/F5/Ctrl+R のキーボードショートカットを追加。 テーマ設定はQSettingsで永続化され、起動時に自動復元される。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! このプルリクエストは、SQLiteViewerのUI/UXを大幅に改善することを目的としています。ダークモードとライトモードのテーマ切り替え、SQLエディタとスキーマビューへの固定幅フォントの適用、および頻繁に使用される操作のためのキーボードショートカットの追加により、開発者ツールとしての使い勝手と視覚的な魅力を向上させます。 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
このプルリクエストは、ダークモード対応、モノスペースフォントの適用、キーボードショートカットの追加といった、多くの重要なUI/UX改善を導入するもので、素晴らしいです。QSSを利用したテーマ管理やQSettingsによる設定の永続化など、実装は全体的に堅牢でよく考えられています。
いくつか軽微な改善提案をコメントとして追加しました。ショートカットの動作スコープをより明確にすることと、設定キーの一元管理に関する提案です。これらにより、アプリケーションの使いやすさと将来の保守性がさらに向上するかと思います。
| def _install_shortcuts(self) -> None: | ||
| for shortcut_key in ("Ctrl+Return", "Ctrl+Enter", "F5"): | ||
| shortcut = QShortcut(QKeySequence(shortcut_key), self.query_editor) | ||
| shortcut.activated.connect(self._run_query) |
There was a problem hiding this comment.
QShortcutのデフォルトのコンテキストはQt.ShortcutContext.WindowShortcutです。これは、親ウィジェットを含むウィンドウがアクティブである限りショートカットがトリガーされることを意味します。現在の実装では、query_editorにフォーカスがない状態(例えば、テーブルリストを選択している状態)でF5やCtrl+Enterを押してもクエリが実行されてしまい、意図しない操作につながる可能性があります。
ショートカットのコンテキストをQt.ShortcutContext.WidgetShortcutに設定することで、query_editorがフォーカスを持っている場合にのみショートカットが有効になります。これにより、より予測可能で安全な動作になります。
| def _install_shortcuts(self) -> None: | |
| for shortcut_key in ("Ctrl+Return", "Ctrl+Enter", "F5"): | |
| shortcut = QShortcut(QKeySequence(shortcut_key), self.query_editor) | |
| shortcut.activated.connect(self._run_query) | |
| def _install_shortcuts(self) -> None: | |
| for shortcut_key in ("Ctrl+Return", "Ctrl+Enter", "F5"): | |
| shortcut = QShortcut(QKeySequence(shortcut_key), self.query_editor) | |
| shortcut.setContext(Qt.ShortcutContext.WidgetShortcut) | |
| shortcut.activated.connect(self._run_query) |
src/sqliteviewer/theme.py
Outdated
| _SETTINGS_GROUP = ("SQLiteViewer", "App") | ||
| _THEME_KEY = "theme" |
There was a problem hiding this comment.
QSettingsのグループ設定 ("SQLiteViewer", "App") が、mainwindow.pyの__init__内でも直接ハードコードされています(self.settings = QSettings("SQLiteViewer", "App"))。
設定キーを複数の場所でハードコードすると、将来の変更が困難になり、バグの原因にもなります。この定数をパブリック(例: SETTINGS_GROUP)にしてmainwindow.pyからインポートして再利用することを検討してください。これにより、設定の一元管理が可能になり、保守性が向上します。
| _SETTINGS_GROUP = ("SQLiteViewer", "App") | |
| _THEME_KEY = "theme" | |
| SETTINGS_GROUP = ("SQLiteViewer", "App") | |
| THEME_KEY = "theme" |
- QSettings グループ定数を公開化(SETTINGS_GROUP)し、theme.py と mainwindow.py で共有 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
新規ファイル
src/sqliteviewer/theme.py— Theme enum, QSS読み込み/適用/永続化src/sqliteviewer/resources/light.qss— GitHub風ライトテーマsrc/sqliteviewer/resources/dark.qss— VS Code風ダークテーマ設計判断
str, Enum:StrEnum(3.11+)ではなくstr, Enumを使用(requires-python >= 3.10互換)QFontDatabase.systemFont: フォント名ハードコードよりクロスプラットフォーム対応Test plan
uv run python -m pytest tests/ -vで回帰テスト(16件パス確認済み)🤖 Generated with Claude Code