Repository navigation
Description
Description
Manage > Projects > Link checkout passes the typed folder to projects::link_checkout as PathBuf::from(folder) (crates/dashboard-app/src/manage/projects.rs:758). Config::add_repository (crates/dashboard-core/src/config.rs:160) treats it as already listed only when it is == to an existing entry, then writes it to config.toml as typed. Two consequences, reproduced on b6b5450 with synthetic temporary checkouts on Windows (git 2.55):
- Another spelling of a listed checkout adds a second row. With
repositories = ["…\src\hs-buddy"], linking…\src\sub\..\hs-buddyor…\src\HS-BUDDYreturnsOk, appends the path, andBoard::newbuilds 2 cards for one checkout. Both read identityhemsoft-dev/hs-buddy. Control: the exact path and the path with a trailing/leave the list unchanged with 1 card. - A relative folder depends on the process working directory. With the working directory set to
…\src, linkinghs-buddyreturnsOkand writesrepositories = ["hs-buddy"]. Once the working directory changes,checkout_identity("hs-buddy")returnsErr(Identity)and the row shows "Repository identity unavailable". Control: the absolute path still resolves from the other working directory.
The .. case also applies on Linux and macOS. The case-only spelling applies where the filesystem ignores case.
Why
A duplicate row fetches and shows the same project twice. A relative entry passes validation, is saved, then fails on a later start from a different directory (for example a shortcut or Explorer launch) with an identity error that hides the cause.
Goal
Link checkout saves one stable absolute path per checkout and recognizes a folder that is already listed under another spelling.
Acceptance Criteria
- Linking a relative folder either resolves it to an absolute path before it is checked and saved or is refused with a message asking for a full path.
config.tomlnever gets a relative entry from Link checkout. - Linking a folder that refers to an already listed checkout through
..or a case-only difference (on case-insensitive filesystems) writes nothing and adds no row. - Linking the exact listed path, or that path with a trailing separator, still writes nothing.
- A new absolute folder with the right origin is still appended once, with the file's comments kept (existing Add a Projects dialog to track, edit and re-prioritize pmd projects #34/Write config.toml atomically and cover view saves #73 behavior).
- Saved paths keep a normal form on Windows (no
\?\verbatim prefix inconfig.toml).
Definition of Done
- Fix in
dashboard-corewith tests named after the behavior, covering the relative,.., case-only (Windows) and exact or trailing-separator cases. - Failure paths covered: a relative or nonexistent folder writes nothing.
-
cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --lockedandcargo deny --locked check advisoriespass. - Clean current-head AI review.
Validation
-
cargo test -p dashboard-core --lockedruns the new tests. In a temporary folder with a.git/configorigin ofhttps://github.com/hemsoft-dev/hs-buddy.gitandconfig.tomllisting that checkout,link_checkout(dir, <root>/sub/../hs-buddy, "hemsoft-dev/hs-buddy")leavesConfig::load(dir).repositoriesat one entry. -
With the working directory set to the parent of that checkout, linking
hs-buddynever leaves"hs-buddy"inconfig.toml. -
The resulting PR's
## Validationembeds current-head screenshots, rendered offscreen by the headless capture test (captures::captureson Linux, synthetic temporary folders, no real profile), of Manage > Projects > Link checkout in three states: a relative folder refused with the full-path message; a missing folder; and a..spelling of a checkout already listed, reported under its listed path withconfig.tomlunchanged. Each state is one button press, so no recording is required.
Evidence from branch fix/issue-87-normalize-link-checkout-folder at c7d344790c6c96b223fe46f694055990c155ab64:



Activity
fix: refuse relative and re-listed folders in Link checkout (#89)