Commit 20d8d97
committed
fix: route lint-view + sources-view deletes through the unified ref-cleanup helper
Three delete paths existed in the codebase, with three different
cleanup behaviours, and only the newest one cleaned everything:
Knowledge tree right-click (new) body + index + related: ✓
Sources view source delete cascade body + index, NOT related: ✗
Lint view orphan delete nothing ✗
The user-visible symptom was the FrontmatterPanel rendering an
AlertTriangle next to a `related:` slug that pointed at a page
deleted via Sources view or Lint view — the page was gone, so the
slug couldn't resolve, but no cleanup pass had filtered it out of
its referrer's frontmatter array. After deletion the right thing to
do is remove the dangling reference, not show the user a broken-link
warning that they then have to fix by hand.
Both call sites now go through `cascadeDeleteWikiPagesWithRefs`
which already handles the full sweep (body wikilinks via
stripDeletedWikilinks, index.md listing via cleanIndexListing, and
`related:` filtering via parseFrontmatterArray + writeFrontmatterArray
on every surviving wiki .md). Sources view's previous inline cleanup
loop and the now-orphaned `flattenMdFiles` local helper are removed
along with the unused wiki-cleanup imports.
Tests: 7 cases on the helper itself were added in the previous
commit and cover both the body-wikilink and related-frontmatter
paths plus the substring-collision regression. Existing
sources-view + lint-view flows have no targeted unit tests, but the
full unit suite (984 cases) passes and the helper's tests pin the
behaviour now shared by all three call sites.1 parent 65c1b4f commit 20d8d97
2 files changed
Lines changed: 32 additions & 77 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 14 | | |
22 | 15 | | |
23 | 16 | | |
| |||
347 | 340 | | |
348 | 341 | | |
349 | 342 | | |
350 | | - | |
351 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
352 | 348 | | |
353 | 349 | | |
354 | 350 | | |
| |||
369 | 365 | | |
370 | 366 | | |
371 | 367 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
| 368 | + | |
| 369 | + | |
384 | 370 | | |
385 | 371 | | |
386 | 372 | | |
387 | 373 | | |
388 | 374 | | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
430 | 390 | | |
431 | 391 | | |
432 | 392 | | |
| |||
803 | 763 | | |
804 | 764 | | |
805 | 765 | | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
0 commit comments