Repository navigation
fix(terminal): セッションの並びをエンジンに持たせ、どの画面からも同じ順にする - #832
Merged
Merged
Conversation
ワークスペースの中のセッションの並べ替えは、画面のメモリにしか無かった。そのため、
ブラウザやマシンごとに順が違い、読み込み直すと開いた順に戻っていた。
PUT /api/v1/terminal/sessions/{id}/workspace に beforeId を足し、エンジンの
Registry の一覧の順を並びにする。画面は答えを待たずに移したあとの順で描き、
断られたら一覧を読み直す。一覧に残す終了済みのセッションは、位置ではなく
終わった時刻で選ぶ。
v0.67.0 までのエンジンは知らない欄の beforeId を断るので、remoteengine.Compatibility
を 3 に上げる。リモートセッションに使うマシンの sshc も更新が要る。
Claude-Session: https://claude.ai/code/session_014WPnWupTc6HnamGudjkE9L
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.
何をするか
ワークスペースの中のセッションの並びを、sshcエンジンに持たせます。どのブラウザやマシンから開いても同じ順になります。リモートセッションを別のマシンから開いた場合も同じです。
これまでの並べ替えは画面のメモリ(
useTerminalWorkspaceControllerのuseState)にしかありませんでした。そのため、ブラウザごとに順が違い、同じブラウザでも読み込み直すと開いた順に戻っていました。ワークスペースの並びは前からエンジンのworkspaces.jsonにあります。変えたこと
PUT /api/v1/terminal/sessions/{id}/workspaceにbeforeIdを足しました。セッションをworkspaceIdのワークスペースへ移し、beforeIdのセッションの前に置きます。beforeIdが無ければ、そのワークスペースの最後に置きます。同じワークスペースの中での並べ替えも、この要求で行いますterminal.Registryの一覧の順そのものです。新しい保存先は作っていませんbeforeIdのセッションが無いか、別のワークスペースにあるときは404 terminal_session_not_foundで断り、何も変えません。どちらも別の画面が先に閉じたり移したりしたときに起きますterminal-sessions.json)は一覧の順で5秒ごとに書いているので、エンジンを再起動して開き直したあとも同じ順に並びますsessionOrder)を消し、エンジンの一覧の順でそのまま描きますorderWithGroupReorderedとorderWithSessionMovedIntoを消しましたdocs/design.mdとdocs/manual-acceptance.mdに、並びをエンジンが持つことと、その確かめ方を書きましたリモートセッションの互換の番号を上げる
remoteengine.Compatibilityを2から3へ上げました。v0.67.0までのエンジンは知らない欄のある要求を断るので、beforeIdの付いた要求には400を返します。docs/releasing.mdは、取り次ぐAPIの要求の形を古いsshcと通じない形に変えたら、同じ変更で番号を上げると定めています。このため、次のリリースでは、リモートセッションに使うマシンのsshcも更新が必要です(接続先で
sshc update)。リリースノートの「更新後に必要な操作」に書いてください。確かめたこと
make test(Goのテスト、go vet、deadcode、Web の lint・単体テスト・型検査)とmake verify-generatednpx playwright test。533件が通り、7件はスキップ)https://claude.ai/code/session_014WPnWupTc6HnamGudjkE9L