Repository navigation
fix: サイドパネルのFilesをGitHubのPRファイルツリーと同じ順に並べる - #234
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
実装、ナビゲーション、テスト、ドキュメントが一貫しており、未解決の問題は見つかりませんでした。
0 open findings
What changed in this PR
サイドパネルのファイル順をGitHub PR表示に合わせ、flat/tree間の一貫性を改善します。
Changes:
- tree表示を入力順ベースへ変更
- local modeをパスのバイト順でソート
- テストとドキュメントを更新
| File | Description |
|---|---|
lua/fude/ui/sidepanel/tree.lua |
子要素の入力順を維持 |
lua/fude/local/session.lua |
local変更ファイルをソート |
lua/fude/util.lua |
バイト順比較を追加 |
lua/fude/files.lua |
ナビゲーション説明を更新 |
tests/fude/sidepanel_tree_spec.lua |
tree順序を検証 |
tests/fude/sidepanel_integration_spec.lua |
折り畳み動作を追従 |
tests/fude/local_session_spec.lua |
localソートを検証 |
tests/fude/util_spec.lua |
パス比較を検証 |
tests/fude/files_spec.lua |
ナビゲーション順を検証 |
README.md |
表示順を文書化 |
doc/fude.txt |
ヘルプを更新 |
CLAUDE.md |
アーキテクチャ説明を更新 |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kyu08
commented
Oct 9, 2026
| local M = {} | ||
| local config = require("fude.config") | ||
| local store = require("fude.local.store") | ||
| local util = require("fude.util") |
Collaborator
Author
There was a problem hiding this comment.
test single line comment
kyu08
commented
Oct 9, 2026
Comment on lines
+101
to
+103
| --- git output. Untracked files are added as "added" with zero counts, and the | ||
| --- result is sorted by path in byte order, as the GitHub PR file list is, so | ||
| --- untracked files sit among the tracked ones instead of trailing them. |
Collaborator
Author
There was a problem hiding this comment.
test multiple line comment
kyu08
force-pushed
the
fix/sidepanel-file-order
branch
from
October 9, 2026 15:36
11025e9 to
b91063e
Compare
Comment on lines
+302
to
+305
| Files are ordered as in the GitHub PR file tree: by path in byte order | ||
| (`CLAUDE.md` before `lua/`, `ui.lua` before `ui/`). Tree mode places each | ||
| directory where its first file appears, so flat and tree modes list files in | ||
| the same order. |
Comment on lines
+762
to
+766
| Files are ordered as in the GitHub PR file tree: by path in byte | ||
| order (`CLAUDE.md` before `lua/`, `ui.lua` before `ui/`). Tree mode | ||
| places each directory where its first file appears, so flat and | ||
| tree modes list files in the same order. In local review, | ||
| untracked files are sorted in among the tracked ones. |
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.

概要
サイドパネルのFiles(flat/tree)を、GitHubのPRのファイルツリーと同じ順に並べる。これまでtree表示はディレクトリを優先して名前順に並べていたため、flat表示ともGitHubとも順序が違っていた。
Closes #214
変更内容
lua/fude/ui/sidepanel/tree.lua)CLAUDE.mdがlua/より前に、ui.luaがui/より前に並ぶchanged_filesをtreeにしてから平坦化すると元のflat順と同じになるので、tree modeでのnext/prev fileの移動順もflatと一致するchanged_filesをパスのバイト順でソートするようにした(lua/fude/local/session.lua)util.path_lessを追加した。PUC Luaの<はロケールに依存するstrcollで比較するため、バイト単位で比べる処理を明示的に書いたchanged_filesはソートせず、APIが返す順をそのまま使うpulls/{pr}/filesの順がweb表示の順と一致することをPR #231で確認した。renameされたファイルをソートし直すと、かえってGitHubと順序がずれるおそれがあるテスト計画
make all)tests/fude/sidepanel_tree_spec.lua,tests/fude/files_spec.lua,tests/fude/local_session_spec.lua,tests/fude/util_spec.lua備考
renameを含むPRで、GitHub上の並びと一致するかはまだ確認していない。
Generated with Claude Code