Repository navigation
Commit b88ca5c
committed
fix(app): keep nested project sessions in the opened directory
Opening a folder that is a subdirectory of a git repository and starting a
session there registered the session at the repository root, so everything
scoped to the opened folder — most visibly `.opencode/skills/` — was never
discovered.
Both fallbacks that map a directory onto "its project" went through the
server's project metadata, whose `worktree` is always the git repository root
(`Project.resolve` returns `git rev-parse --show-toplevel`). A nested
subdirectory resolves to the same project as the repository root but, unlike a
linked worktree, is not listed in `sandboxes`, so it was silently rewritten to
the root. `projectRoot()` then navigated to `/<repo-root>/session`, and the
sidebar's new-session button used the project's worktree, which is what
`POST /api/session` receives as `location.directory`.
Only the worktree itself and the project's sandboxes now collapse onto the
worktree; a nested directory stays its own root, and a new session starts in
the directory the route is actually in.
Refs anomalyco#511911 parent 7a8d46e commit b88ca5c
3 files changed
Lines changed: 37 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
1127 | 1128 | | |
1128 | 1129 | | |
1129 | 1130 | | |
1130 | | - | |
| 1131 | + | |
1131 | 1132 | | |
1132 | 1133 | | |
1133 | 1134 | | |
| |||
1932 | 1933 | | |
1933 | 1934 | | |
1934 | 1935 | | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
1935 | 1944 | | |
1936 | 1945 | | |
1937 | 1946 | | |
| |||
2106 | 2115 | | |
2107 | 2116 | | |
2108 | 2117 | | |
2109 | | - | |
| 2118 | + | |
2110 | 2119 | | |
2111 | 2120 | | |
2112 | 2121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
347 | 358 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
0 commit comments