Repository navigation
Commit 3925003
committed
fix(web): #106 review — the layout switch never moves a file instead of the chat, fills the window in both layouts, and works where a workspace sets it
Review comment 4274117959 (the moves act on whatever is active): whenChatActive resolved on its
timeout as well, so the move commands ran whether or not the chat was the active editor and could move
the file beside it; and in split the second levelcode.ai.focus, after README.md was opened (and became
the editor on show), was followed by the move with no wait at all. Each command that acts on the active
editor (the two moves, and the join below) now goes through one guard: the tab model is read
immediately before it, after waiting up to 1.5 s for the reveal to land; one that cannot be confirmed
is skipped, as is every later one in that arrangement, and so is one overtaken by a newer layout
request while it waited. whenChatActive resolves true/false. The wait for the chat to come to the
front before the window is read at all stays: when the layout is changed by saving the setting from
a settings editor opened in front of the chat, that editor's group is in the tab model until the chat
is focused, and read at once the window looks like two groups already, so nothing is docked (found in
a browser run of this change before it was committed; pinned by a unit case). If that wait times out,
nothing is moved. Tests: chatFirst with the chat never
active does not move; split waits after the README until the chat is active again and does not move if
it never is (also on the reload path); a split waiting to move is dropped when chatFirst is chosen
meanwhile.
Review comment 4274118020 (chatFirst left file groups visible): only empty groups were closed, so a
group with files (a split file editor, files put on the right) kept part of the window. Such groups are
now joined into the chat's group with workbench.action.joinAllGroups, which merges into the active group
and moves the editors in inactive, so no document is closed and the chat stays on show. The remaining
group is then unlocked: a group the chat was docked in is auto-locked, and a lone locked group sends
the next file into a new split. The usual split -> chatFirst switch (the chat alone on the right) is
unchanged. Test: three arrangements with files outside the chat's group are joined and unlocked; no
join when the chat is not active.
Review comment 4274118061 (split in a folder without README.md): with the chat as the only tab nothing
kept the first group, so the move closed it and left one group, auto-locked. An empty untitled document
is opened in column one first (preserveFocus, not a preview) when there is no README and no other tab;
if even that cannot be opened the chat is not moved. The existing test that pinned the old sequence for
this case is changed to the new one.
Review comment 4274118118 (the switch wrote only the user setting): with
levelcode.web.layout in .vscode/settings.json the workspace value wins, so the status item and the
commands did nothing. writeLayout() inspects the setting and updates the workspace value when there is
one, the user's otherwise. A folder-level value is not a third target: the setting is window-scoped,
which VS Code does not read from a multi-root folder (FOLDER_SCOPES), and in a single-folder window
the folder's settings are the workspace's. Tests drive activate() and the registered commands.
The vscode stand-in now always has activeTabGroup: a file shown by showTextDocument is on show until
the chat's reveal lands (a test can hold the reveal back), otherwise the chat is; plus
openTextDocument, inspect() and a workspace layer of settings. On the previous extension.js the 8 new
or changed cases fail and the other 32 pass.1 parent 53c1039 commit 3925003
3 files changed
Lines changed: 280 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
| |||
0 commit comments