@@ -732,15 +732,14 @@ impl Plugin for NotePlugin {
732732 let tag_ok = if filters. include_tags . is_empty ( ) {
733733 true
734734 } else {
735- filters
736- . include_tags
737- . iter ( )
738- . all ( |tag| n. tags . iter ( ) . any ( |t| t == tag) )
735+ filters. include_tags . iter ( ) . all ( |tag| {
736+ n. tags . iter ( ) . any ( |t| t. contains ( tag) )
737+ } )
739738 } ;
740739 let exclude_ok = !filters
741740 . exclude_tags
742741 . iter ( )
743- . any ( |tag| n. tags . iter ( ) . any ( |t| t == tag) ) ;
742+ . any ( |tag| n. tags . iter ( ) . any ( |t| t. contains ( tag) ) ) ;
744743 let text_ok = if text_filter. is_empty ( ) {
745744 true
746745 } else {
@@ -1182,6 +1181,61 @@ mod tests {
11821181 restore_cache ( original) ;
11831182 }
11841183
1184+ #[ test]
1185+ fn note_list_supports_partial_tag_filters ( ) {
1186+ let original = set_notes ( vec ! [
1187+ Note {
1188+ title: "Alpha" . into( ) ,
1189+ path: PathBuf :: new( ) ,
1190+ content: "Review #testing and #ui-kit changes." . into( ) ,
1191+ tags: Vec :: new( ) ,
1192+ links: Vec :: new( ) ,
1193+ slug: "alpha" . into( ) ,
1194+ alias: None ,
1195+ } ,
1196+ Note {
1197+ title: "Beta" . into( ) ,
1198+ path: PathBuf :: new( ) ,
1199+ content: "Follow up on #testing checklist." . into( ) ,
1200+ tags: Vec :: new( ) ,
1201+ links: Vec :: new( ) ,
1202+ slug: "beta" . into( ) ,
1203+ alias: None ,
1204+ } ,
1205+ Note {
1206+ title: "Gamma" . into( ) ,
1207+ path: PathBuf :: new( ) ,
1208+ content: "Finalize #ui rollout." . into( ) ,
1209+ tags: Vec :: new( ) ,
1210+ links: Vec :: new( ) ,
1211+ slug: "gamma" . into( ) ,
1212+ alias: None ,
1213+ } ,
1214+ ] ) ;
1215+
1216+ let plugin = NotePlugin {
1217+ matcher : SkimMatcherV2 :: default ( ) ,
1218+ data : CACHE . clone ( ) ,
1219+ templates : TEMPLATE_CACHE . clone ( ) ,
1220+ external_open : NoteExternalOpen :: Wezterm ,
1221+ watcher : None ,
1222+ } ;
1223+
1224+ let list_test = plugin. search ( "note list #test" ) ;
1225+ let labels_test: Vec < & str > = list_test. iter ( ) . map ( |a| a. label . as_str ( ) ) . collect ( ) ;
1226+ assert_eq ! ( labels_test, vec![ "Alpha" , "Beta" ] ) ;
1227+
1228+ let list_ui = plugin. search ( "note list @ui" ) ;
1229+ let labels_ui: Vec < & str > = list_ui. iter ( ) . map ( |a| a. label . as_str ( ) ) . collect ( ) ;
1230+ assert_eq ! ( labels_ui, vec![ "Alpha" , "Gamma" ] ) ;
1231+
1232+ let list_not_ui = plugin. search ( "note list !#ui" ) ;
1233+ let labels_not_ui: Vec < & str > = list_not_ui. iter ( ) . map ( |a| a. label . as_str ( ) ) . collect ( ) ;
1234+ assert_eq ! ( labels_not_ui, vec![ "Beta" ] ) ;
1235+
1236+ restore_cache ( original) ;
1237+ }
1238+
11851239 #[ test]
11861240 fn note_tag_lists_tags_and_drills_into_list ( ) {
11871241 let original = set_notes ( vec ! [
0 commit comments