Skip to content

Feat/note pinning#40

Open
MRvandals4vage wants to merge 3 commits intomainfrom
feat/Note-Pinning
Open

Feat/note pinning#40
MRvandals4vage wants to merge 3 commits intomainfrom
feat/Note-Pinning

Conversation

@MRvandals4vage
Copy link
Collaborator

What does this PR do?

Here is a summary of all the changes made to the note-taking app to implement the "Pin to Top" feature:

  1. State Management & Persistence (

useAppStore.ts
)
State Added: Introduced a pinnedFiles array to safely store the absolute file paths / IDs of pinned notes.
Pin Action: Created a

togglePinFile(fileId)
action that adds or removes notes from the pinned list.
Local Persistence: Integrated localStorage (cinder-pinned-files) so your pinned files load reliably every time you restart the app.
Global File Lookup Resolution: Rewrote the core

findFile
engine. It dynamically intercepts missing files and rebuilds them based purely on their path; this safely ensures files pinned from outside your current workspace can still be seamlessly opened.
2. Context Menu System (

contextMenu.ts
)
Action Wiring: Updated the

StoreActions
type to accept new

togglePinFile
and

isPinned
helper logic.
UI Insertion: Injected "Pin" and "Unpin" toggle options dynamically into two core locations: File context menus (right-clicking inside your sidebar tree) and Tab context menus (right-clicking actively opened tabs at the top of the editor).
3. Editor Tabs (

EditorTabs.tsx
)
Tab Realignment: Added dynamic sorting logic that forces pinned files to magnetically align to the left side of your open tabs bar.
Visual Feedback: Implemented a responsive icon (via lucide-react) next to the names of pinned tabs to mark them clearly.
Out-of-Bounds Parsing: Inserted an intelligent layout fallback that accurately displays titles for tabs opened off of pinned files lacking strict active workspace trees.
4. File Explorer Structure (

FileExplorer.tsx
)
Unified Visibility: Added a persistent, static "Pinned" section pinned exclusively to the highest echelon of the file explorer sidebar.
Workspace Filtering: Organized everything seamlessly—if you have both pinned notes and generic workspace notes, they're gracefully separated by bolded "PINNED" and "FILES" subtitle headers, taking dynamic search results properly into account.
5. File Tree Rendering (

FileTreeItem.tsx
)
Interactive Connectivity: Added

togglePinFile
and

isPinned
definitions specifically into the context menu initialization payload for all tree items.
Inline Pin Icon: Crafted and injected a beautifully minimal SVG pin that rests cleanly at the far right (ml-auto) corner of specifically pinned file lines, adapting automatically to your hover/active highlight colors.

Related issue 32

Fixes #

Checklist

  • [ yes] I tested my changes
  • [ yes] I didn’t break existing functionality
  • [ yes] I followed repo style

@MRvandals4vage MRvandals4vage requested a review from 7sg56 as a code owner March 13, 2026 18:17
Copy link
Owner

@7sg56 7sg56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discard the settings and translation i18n changes rest seems fine

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translation in note pinning ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is settings file modified for note pinning ?

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.

2 participants