From 195d95794def1ed3dc32bf18a831e22b41d96d03 Mon Sep 17 00:00:00 2001 From: roeming Date: Sun, 21 Dec 2025 19:30:21 -0500 Subject: [PATCH 1/4] forward linked status to ts --- crates/web/src/handlers/report.rs | 6 ++++++ js/env.d.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/crates/web/src/handlers/report.rs b/crates/web/src/handlers/report.rs index 1d61e6d..65ae7a5 100644 --- a/crates/web/src/handlers/report.rs +++ b/crates/web/src/handlers/report.rs @@ -77,6 +77,7 @@ pub struct ReportTemplateUnit<'a> { pub y: f32, pub w: f32, pub h: f32, + pub is_linked: bool, } #[derive(Serialize, Clone)] @@ -606,6 +607,7 @@ fn apply_scope<'a>( y: 0.0, w: 0.0, h: 0.0, + is_linked: false, }) }) .collect::>() @@ -636,6 +638,10 @@ fn apply_scope<'a>( y: 0.0, w: 0.0, h: 0.0, + is_linked: unit + .metadata + .as_ref() + .is_some_and(|m| m.complete.is_some_and(|c| c)), }) }) .collect::>() diff --git a/js/env.d.ts b/js/env.d.ts index 646de22..903cffd 100644 --- a/js/env.d.ts +++ b/js/env.d.ts @@ -9,6 +9,7 @@ type Unit = { y: number; w: number; h: number; + is_linked: bool; // Runtime fields filtered: boolean; }; From 1aa18d7f45f252c4a3345cde6e3afe6b9cc722e7 Mon Sep 17 00:00:00 2001 From: roeming Date: Sun, 21 Dec 2025 19:40:57 -0500 Subject: [PATCH 2/4] Add filter check for linked/unlinked TUs --- js/treemap.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/treemap.ts b/js/treemap.ts index 4b35e11..b9a5c0a 100644 --- a/js/treemap.ts +++ b/js/treemap.ts @@ -409,7 +409,14 @@ const SPECIAL_TERM_REGEXP = new RegExp( ); const checkFilterTermMatches = (term: string, unit: Unit): boolean => { + if (term === "is:linked") { + return unit.is_linked; + } else if (term === "is:unlinked") { + return !unit.is_linked; + } + const match = term.match(SPECIAL_TERM_REGEXP); + if (match) { // Filter based on match percent or size. const operator = match[1]; From 97226c01cc8b8f65b765ba1de5592469ed76e8f2 Mon Sep 17 00:00:00 2001 From: roeming Date: Sun, 21 Dec 2025 20:19:20 -0500 Subject: [PATCH 3/4] functions reflect linking status of TU --- crates/web/src/handlers/report.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/web/src/handlers/report.rs b/crates/web/src/handlers/report.rs index 65ae7a5..ad12a06 100644 --- a/crates/web/src/handlers/report.rs +++ b/crates/web/src/handlers/report.rs @@ -588,6 +588,7 @@ fn apply_scope<'a>( } let (w, h) = query.size(); let mut units = if let Some(unit) = current_unit { + let linked = unit.metadata.as_ref().is_some_and(|m| m.complete.is_some_and(|c| c)); unit.functions .iter() .filter_map(|f| { @@ -607,7 +608,7 @@ fn apply_scope<'a>( y: 0.0, w: 0.0, h: 0.0, - is_linked: false, + is_linked: linked, }) }) .collect::>() From 2573b07331e8681f5b33bb2eff3684497ed0d5d8 Mon Sep 17 00:00:00 2001 From: roeming Date: Sun, 21 Dec 2025 20:49:08 -0500 Subject: [PATCH 4/4] use correct ts boolean type --- js/env.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/env.d.ts b/js/env.d.ts index 903cffd..9160233 100644 --- a/js/env.d.ts +++ b/js/env.d.ts @@ -9,7 +9,7 @@ type Unit = { y: number; w: number; h: number; - is_linked: bool; + is_linked: boolean; // Runtime fields filtered: boolean; };