Skip to content

Refactor galore#8

Merged
mdowst merged 41 commits intomainfrom
refactor_galore
Feb 19, 2026
Merged

Refactor galore#8
mdowst merged 41 commits intomainfrom
refactor_galore

Conversation

@mdowst
Copy link
Owner

@mdowst mdowst commented Feb 7, 2026

This pull request introduces several foundational enhancements to PSNotes, significantly expanding its capabilities around organization, execution, and interaction. The changes span multiple core functions and introduce a new interactive terminal experience, while remaining backward-compatible with existing note workflows.


Note Catalog Support

Affected Areas

  • PSNote class
  • NoteStore
  • Get-PSNote
  • Import / Export functions
  • Start-PSNote

Details

  • Notes now support a Catalog property, allowing notes to be logically grouped.
  • Catalogs provide a higher-level organizational structure beyond tags.
  • Get-PSNote can now filter notes by Catalog, both when listing notes and when resolving aliases.
  • Import and export operations preserve catalog information.
  • The terminal app uses catalogs as a primary navigation boundary.

Why
As note libraries grow, tags alone become insufficient. Catalogs provide a predictable, hierarchical way to organize notes without overloading search semantics.


Default Snippet Execution

Affected Areas

  • PSNote class
  • Invoke-PSNote
  • Alias resolution logic

Details

  • Notes can now be marked to execute by default when invoked.

  • When enabled, the note no longer requires an explicit -Execute or equivalent flag.

  • This behavior applies consistently whether the note is invoked:

    • Directly via alias
    • Through Invoke-PSNote
    • From the terminal app

Why
For frequently used snippets, PSNotes should feel closer to invoking a command than recalling documentation. This reduces friction while preserving safety for non-executable notes.


File Execution via Note Alias

Affected Areas

  • PSNote class
  • Invoke-PSNote
  • Note resolution logic

Details

  • Notes can now reference a file path instead of (or in addition to) inline snippet content.

  • When invoked, PSNotes will execute the referenced file in the current session context.

  • File execution respects:

    • Default execution behavior
    • Existing alias resolution rules
  • Enables notes to act as lightweight launchers for scripts, utilities, or automation entry points.

Why
This bridges the gap between snippet recall and real automation. PSNotes can now be used as a discoverable command registry for local tooling.


Import & Export Improvements

Affected Areas

  • Import-PSNote
  • Export-PSNote
  • Note serialization logic

Details

  • Import and export now fully support:

    • Catalogs
    • Execution defaults
    • File-based notes
  • Improved handling of metadata to ensure round-trip consistency.

  • Exported data is more resilient to future schema evolution.

  • Import logic is more defensive, reducing failures caused by missing or partial fields.

Why
As PSNotes gains richer metadata, import/export must be reliable enough to support backups, sharing, and environment portability.


Interactive PSNotes Terminal App

New Command

  • Start-PSNote

Details

  • Introduces a full-screen, terminal-based interactive UI.

  • Runs directly in the current console session (no new window).

  • Provides:

    • Catalog-based browsing
    • Alias-based execution
    • Snippet display or execution
  • Designed with a retro, menu-driven feel inspired by classic terminal tools, while remaining PowerShell-native.

  • Acts as a discovery and execution layer on top of existing PSNotes functionality rather than a replacement.

Why
As the feature set grows, discoverability becomes critical. The terminal app provides an intuitive, keyboard-first way to explore and use PSNotes without memorizing aliases or parameters.


Architectural Impact

  • Expands the role of the note model to include execution intent and organization.

  • Reinforces NoteStore as the authoritative source for note persistence and resolution.

  • Lays groundwork for future features such as:

    • Favorites
    • Scoped views
    • Richer metadata and filtering

Backward Compatibility

  • Existing notes without catalogs continue to function as before.
  • Inline snippets remain fully supported.
  • Execution behavior defaults to non-executing unless explicitly configured.

@mdowst mdowst marked this pull request as draft February 7, 2026 14:16
@mdowst mdowst merged commit 5bdc346 into main Feb 19, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant