File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -542,18 +542,7 @@ export class NotesView {
542542 }
543543
544544 const currentEntries = await this . callbacks . listNotes ( ) ;
545- const currentVisible = currentEntries . filter ( ( entry ) =>
546- matchesFilter ( entry , this . filter ) ,
547- ) ;
548- if ( currentVisible . length > 0 ) {
549- return { entries : currentEntries , allRepos : false , fallback : false } ;
550- }
551-
552- return {
553- entries : flattenNoteSections ( await this . callbacks . listAllNotes ( ) ) ,
554- allRepos : true ,
555- fallback : true ,
556- } ;
545+ return { entries : currentEntries , allRepos : false , fallback : false } ;
557546 }
558547
559548 private applyFilter ( ) : void {
Original file line number Diff line number Diff line change @@ -128,6 +128,41 @@ describe("Notes service", () => {
128128 expect ( context . warnings ) . toEqual ( [ ] ) ;
129129 } ) ;
130130
131+ test ( "lists only the local project outside Git" , async ( ) => {
132+ const { root } = fixture ( ) ;
133+ const projectDir = mkdtempSync ( join ( tmpdir ( ) , "local-directory-" ) ) ;
134+ temporaryDirectories . push ( projectDir ) ;
135+ const localNotesPath = join (
136+ root ,
137+ "projects" ,
138+ "local" ,
139+ basename ( projectDir ) ,
140+ ) ;
141+ mkdirSync ( localNotesPath , { recursive : true } ) ;
142+ writeFileSync (
143+ join ( localNotesPath , "local.md" ) ,
144+ renderDraft (
145+ "note" ,
146+ {
147+ source : "local" ,
148+ owner : "local" ,
149+ repo : basename ( projectDir ) ,
150+ } ,
151+ "date" ,
152+ "Local" ,
153+ "Local description" ,
154+ ) ,
155+ ) ;
156+
157+ const entries = await Effect . runPromise (
158+ Effect . gen ( function * ( ) {
159+ return yield * ( yield * Notes ) . list ( ) ;
160+ } ) . pipe ( Effect . provide ( serviceLayer ( root , projectDir ) ) ) ,
161+ ) ;
162+
163+ expect ( entries . map ( ( entry ) => entry . filename ) ) . toEqual ( [ "local.md" ] ) ;
164+ } ) ;
165+
131166 test ( "lists markdown notes newest-first with parsed metadata" , async ( ) => {
132167 const { root, path, layer } = fixture ( ) ;
133168 const notesPath = join ( root , "projects" , "timmo001" , "notes" ) ;
You can’t perform that action at this time.
0 commit comments