Commit e746fcd
feat(properties): underscore relationship keys + Has Many row (TS parity)
Context: completes the underscore-canonical relationship rework on the
frontend. The Rust index now reads _belongs_to/_related_to/_has_many and
exposes a first-class has_many field; the TS layer mirrors that.
Solution:
- vault-v2.types.ts: add `hasMany: string[]` to NoteEntryV2 (mirrors the
Rust `has_many` field); doc the underscore frontmatter keys; mention
has_many in RelationshipBacklinkV2.
- PropertiesView.svelte: FIXED_RELATIONSHIPS keys become the canonical
underscore form (_belongs_to/_related_to/_has_many); rename the `has`
row to `_has_many` labelled "Has Many". The bare label keeps the row
human-readable; the property key matches the on-disk frontmatter key.
- backlinks.service.ts: doc comment lists the underscore keys + has_many.
Behavior: the Properties panel renders Belongs To / Related To / Has Many
rows keyed on the underscore frontmatter fields. Collection/portent
filters key on _belongs_to/_related_to/_has_many (verified: the query
expression parser accepts the leading underscore).
Files:
- src/lib/types/vault-v2.types.ts: hasMany field + docs (L125-131, L144).
- src/lib/features/properties/PropertiesView.svelte: FIXED_RELATIONSHIPS
(L49-53).
- src/lib/features/backlinks/backlinks.service.ts: doc (L142-143).
- src/tests/.../portent-filters.test.ts: _belongs_to/_related_to filters
+ new _has_many.contains case (L71-100).
- src/tests/.../properties.logic.test.ts: formatRelationshipLabel
has_many; drop relationship space-alias, add no-alias case (L577-595,
L711-722).
- src/tests/.../properties.service.test.ts: upsert _belongs_to (L74-80).
- src/tests/.../vault-v2.types.test.ts: pin hasMany key (L111-131).
- six NoteEntryV2 fixtures: add `hasMany: []`.
- tasks/todo/relationship-aliases-has-many.md: Task 3 done.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 4df6fc8 commit e746fcd
13 files changed
Lines changed: 52 additions & 21 deletions
File tree
- src
- lib
- features
- backlinks
- properties
- types
- tests
- fixtures
- lib
- core/filesystem
- features
- backlinks
- collection
- file-icons
- properties
- types
- tasks/todo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | | - | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
| |||
Lines changed: 17 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
582 | 593 | | |
583 | 594 | | |
584 | 595 | | |
| |||
711 | 722 | | |
712 | 723 | | |
713 | 724 | | |
| 725 | + | |
714 | 726 | | |
715 | 727 | | |
716 | 728 | | |
717 | | - | |
| 729 | + | |
718 | 730 | | |
719 | 731 | | |
720 | 732 | | |
| |||
0 commit comments