fix: note list shows incomplete relationships when opening from sidebar
Two root causes: 1. noteListHooks used a stale selection.entry to build relationship groups — now looks up the fresh entry from the entries array so relationship updates propagate immediately. 2. frontmatterToEntryPatch didn't update entry.relationships — added RelationshipPatch support so frontmatter changes also update the relationships map in state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -486,6 +486,70 @@ References:
|
||||
);
|
||||
}
|
||||
|
||||
// --- large relationship array (regression: No Code note with 32 Notes) ---
|
||||
|
||||
#[test]
|
||||
fn test_parse_large_notes_relationship_array() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let content = r#"---
|
||||
type: Topic
|
||||
Referred by Data:
|
||||
- "[[michele-sampieri|Michele Sampieri]]"
|
||||
- "[[varun-anand|Varun Anand]]"
|
||||
Belongs to:
|
||||
- "[[engineering|Engineering]]"
|
||||
aliases:
|
||||
- No Code
|
||||
Notes:
|
||||
- "[[8020-we-help-companies-move-faster-without-code|8020 | We help companies move faster without code.]]"
|
||||
- "[[airdev-build-hub|Airdev Build Hub]]"
|
||||
- "[[airdev-leader-in-bubble-and-no-code-development|AirDev | Leader in Bubble and No-Code Development]]"
|
||||
- "[[budibase-internal-tools-made-easy|Budibase - Internal tools made easy]]"
|
||||
- "[[bullet-launch-bubble-boilerplate|Bullet Launch Bubble Boilerplate]]"
|
||||
- "[[canvas-base-template-for-bubble|Canvas • Base Template for Bubble]]"
|
||||
- "[[chameleon-microsurveys|Chameleon | Microsurveys]]"
|
||||
- "[[felt-the-best-way-to-make-maps-on-the-internet|Felt – The best way to make maps on the internet]]"
|
||||
- "[[flutterflow-build-native-apps-visually|FlutterFlow | Build Native Apps Visually]]"
|
||||
- "[[framer-ai-generate-and-publish-your-site-with-ai-in-seconds|Framer AI — Generate and publish your site with AI in seconds.]]"
|
||||
- "[[jumpstart-pro-the-best-ruby-on-rails-saas-template|Jumpstart Pro | The best Ruby on Rails SaaS Template]]"
|
||||
- "[[mailparser-email-parser-software-workflow-automation|MailParser • Email Parser Software & Workflow Automation]]"
|
||||
- "[[make-work-the-way-you-imagine|Make | Work the way you imagine]]"
|
||||
- "[[michele-sampieri|Michele Sampieri]]"
|
||||
- "[[n8nio-a-powerful-workflow-automation-tool|n8n.io - a powerful workflow automation tool]]"
|
||||
- "[[n8nio-ai-workflow-automation-tool|n8n.io - AI workflow automation tool]]"
|
||||
- "[[nocodey-find-best-nocoder|Nocodey • Find Best Nocoder]]"
|
||||
- "[[outseta-software-for-subscription-start-ups|Outseta | Software for subscription start-ups]]"
|
||||
- "[[payments-tax-subscriptions-for-software-companies-lemon-squeezy|Payments, tax & subscriptions for software companies • Lemon Squeezy]]"
|
||||
- "[[retool-portals-custom-client-portal-software|Retool Portals • Custom Client Portal Software]]"
|
||||
- "[[rise-of-the-no-code-economy-report-formstack|Rise of the No-Code Economy Report | Formstack]]"
|
||||
- "[[scene-the-smart-way-to-build-websites|Scene • The smart way to build websites]]"
|
||||
- "[[scrapingbee-the-best-web-scraping-api|ScrapingBee • the best web scraping API]]"
|
||||
- "[[softr-build-a-website-web-app-or-portal-on-airtable-without-code|Softr | Build a website, web app or portal on Airtable without code]]"
|
||||
- "[[superblocks-build-modern-internal-apps-in-days-not-months|Superblocks • Build modern internal apps in days, not months]]"
|
||||
- "[[superwall-quickly-deploy-paywalls|Superwall • Quickly deploy paywalls]]"
|
||||
- "[[tails-tailwind-css-page-creator|Tails | Tailwind CSS Page Creator]]"
|
||||
- "[[the-open-source-firebase-alternative-supabase|The Open Source Firebase Alternative | Supabase]]"
|
||||
- "[[varun-anand|Varun Anand]]"
|
||||
- "[[xano-the-fastest-no-code-backend-development-platform|Xano - The Fastest No Code Backend Development Platform]]"
|
||||
- "[[directus-open-data-platform-for-headless-content-management|{'Directus': 'Open Data Platform for Headless Content Management'}]]"
|
||||
- "[[framer-design-beautiful-websites-in-minutes|{'Framer': 'Design beautiful websites in minutes'}]]"
|
||||
title: No Code
|
||||
---
|
||||
# No Code
|
||||
"#;
|
||||
create_test_file(dir.path(), "no-code.md", content);
|
||||
let entry = parse_md_file(&dir.path().join("no-code.md")).unwrap();
|
||||
|
||||
let notes = entry.relationships.get("Notes").expect("Notes relationship should exist");
|
||||
assert_eq!(notes.len(), 32, "All 32 Notes entries should be parsed");
|
||||
|
||||
let referred = entry.relationships.get("Referred by Data").expect("Referred by Data should exist");
|
||||
assert_eq!(referred.len(), 2);
|
||||
|
||||
let belongs = entry.relationships.get("Belongs to").expect("Belongs to should exist");
|
||||
assert_eq!(belongs.len(), 1);
|
||||
}
|
||||
|
||||
// --- type from frontmatter only (no folder inference) ---
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user