-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Feature Description
Add the ability to attach multiple context notes to a single line of code, allowing developers to add different types of annotations, comments, or references to the same line without conflicts.
Problem/Motivation
Currently, the extension only supports one note per line. When working on complex code, developers often need to add multiple types of annotations to the same line:
- A TODO comment
- A reference to related code
- A bug note
- Documentation or explanation
- A link to an issue or PR
Having to choose which note to attach or spreading them across adjacent lines reduces the effectiveness of the note-taking system.
Proposed Solution
Allow multiple notes to be attached to a single line with the following features:
- Visual Indicators: Show a count badge or stacked icon in the gutter when multiple notes exist
- Note List View: When clicking on a line with multiple notes, display all notes in a list or panel
- Note Types/Categories: Optionally allow categorizing notes (TODO, BUG, REFERENCE, NOTE, etc.)
- Individual Management: Each note can be edited or deleted independently
- Quick Add: Provide a quick way to add another note to a line that already has one
Alternative Solutions
- Adjacent Lines: Continue using adjacent lines for multiple notes (current workaround)
- Combined Notes: Merge all notes into a single text field with manual formatting
- Linked Notes: Create a primary note with links to secondary notes stored elsewhere
- Hierarchical Notes: Support nested/child notes under a parent note
Use Cases
- Code Review: Add both a question and a suggested improvement to the same line
- Bug Tracking: Attach a bug description and a link to the issue tracker on the problematic line
- Learning: Add both an explanation and a reference link when studying unfamiliar code
- Refactoring: Mark a line with both a TODO and a note about why the change is needed
- Collaboration: Multiple team members can add their own notes to the same line without overwriting each other's comments
Examples
Similar features in other tools:
- Google Docs: Multiple comments can be attached to the same text selection
- GitHub PR Reviews: Multiple review comments can target the same line
- Notion: Multiple comments can be added to the same block
- JetBrains IDEs: Bookmarks and breakpoints can coexist on the same line
Additional Context
Possible UI approaches:
- Gutter Badge: Show "2" or "3" badge when multiple notes exist
- Stacked Icons: Display slightly offset icons in the gutter
- Expandable Panel: Click to expand a list of all notes for that line
- Hover Preview: Show all notes in a tooltip on hover
- Side Panel List: Display all notes for the current line in the sidebar
Data Structure Consideration:
The storage format would need to change from:
line -> note
to:
line -> [note1, note2, note3, ...]
Implementation Considerations
Technical approach:
- Storage Layer: Modify
storageManager.tsto store an array of notes per line instead of a single note - Decoration System: Update gutter decorations to show count or stacked indicators
- UI Components: Create a note list component for viewing/managing multiple notes
- Migration: Provide backward compatibility for existing single-note data
- Performance: Ensure efficient rendering when lines have many notes
Potential challenges:
- Maintaining backward compatibility with existing notes
- UI/UX design for managing multiple notes without cluttering the interface
- Performance with large numbers of notes per line
Willing to Contribute?
Would you be willing to submit a pull request for this feature?
- Yes, I'd like to implement this
- I can help with testing
- I'd like to help with documentation
- No, just suggesting the idea