File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -372,6 +372,18 @@ def add_candidate(value: str | None) -> None:
372372 add_candidate (f"{ normalized_project } /{ remainder } " )
373373 add_candidate (remainder )
374374
375+ if workspace_project_prefix and not include_project and not workspace_qualified :
376+ # Trigger: short lookup in a workspace where new canonical links omit project prefixes.
377+ # Why: older rows in that same workspace may still be stored as `project/path`.
378+ # Outcome: try the project-prefixed legacy form after the workspace-qualified form.
379+ add_candidate (
380+ build_canonical_permalink (
381+ normalized_project ,
382+ normalized_path ,
383+ include_project = True ,
384+ )
385+ )
386+
375387 if include_project and not workspace_qualified :
376388 add_candidate (
377389 build_canonical_permalink (
Original file line number Diff line number Diff line change @@ -47,6 +47,21 @@ def test_short_permalink_candidates_include_workspace_and_project_forms():
4747 ]
4848
4949
50+ def test_short_workspace_candidate_keeps_project_legacy_when_project_prefix_disabled ():
51+ candidates = build_permalink_resolution_candidates (
52+ "notes/example" ,
53+ "main" ,
54+ include_project = False ,
55+ workspace_permalink = "personal" ,
56+ )
57+
58+ assert candidates == [
59+ "notes/example" ,
60+ "personal/main/notes/example" ,
61+ "main/notes/example" ,
62+ ]
63+
64+
5065def test_qualified_permalink_reference_preserves_lookup_syntax ():
5166 assert (
5267 build_qualified_permalink_reference (
You can’t perform that action at this time.
0 commit comments