Documentation
¶
Index ¶
- func DefaultDBPath(workDir string) string
- func ExactTitleMatch(query string, note Note) bool
- func FuzzyMatchNote(query string, note Note) int
- type AutoSaveTickMsg
- type FocusPane
- type InlineAutoSaveResultMsg
- type InlineAutoSaveTickMsg
- type InlineEditExitedMsg
- type InlineEditStartedMsg
- type Note
- type NoteArchiveToggledMsg
- type NoteContentSavedMsg
- type NoteDeletedMsg
- type NoteFilter
- type NoteMatch
- type NotePinToggledMsg
- type NoteRestoredMsg
- type NoteSavedMsg
- type NotesLoadedMsg
- type Plugin
- func (p *Plugin) BlocksGlobalKeys() bool
- func (p *Plugin) Commands() []plugin.Command
- func (p *Plugin) ConsumesTextInput() bool
- func (p *Plugin) Cursor() *tea.Cursor
- func (p *Plugin) FocusContext() string
- func (p *Plugin) ID() string
- func (p *Plugin) Icon() string
- func (p *Plugin) Init(ctx *plugin.Context) error
- func (p *Plugin) IsFocused() bool
- func (p *Plugin) Name() string
- func (p *Plugin) PreferredMouseMode() tea.MouseMode
- func (p *Plugin) SetFocused(f bool)
- func (p *Plugin) Start() tea.Cmd
- func (p *Plugin) Stop()
- func (p *Plugin) Update(msg tea.Msg) (plugin.Plugin, tea.Cmd)
- func (p *Plugin) View(width, height int) string
- func (p *Plugin) WheelAtBoundary(msg tea.MouseWheelMsg) bool
- type Store
- func (s *Store) Close() error
- func (s *Store) Create(title, content string) (*Note, error)
- func (s *Store) Delete(id string) error
- func (s *Store) Get(id string) (*Note, error)
- func (s *Store) List(includeArchived bool) ([]Note, error)
- func (s *Store) ListArchived() ([]Note, error)
- func (s *Store) ListDeleted() ([]Note, error)
- func (s *Store) NotePath(id string) string
- func (s *Store) Restore(id string) error
- func (s *Store) ToggleArchive(id string) error
- func (s *Store) TogglePin(id string) error
- func (s *Store) Unarchive(id string) error
- func (s *Store) Update(note *Note) error
- func (s *Store) UpdateContent(id, content string) error
- type TaskCreatedMsg
- type UndoAction
- type UndoActionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultDBPath ¶
DefaultDBPath returns the default database path for a given workdir.
func ExactTitleMatch ¶
ExactTitleMatch returns true if query matches a note's title exactly (case-insensitive).
func FuzzyMatchNote ¶
FuzzyMatchNote scores how well query matches a note's title and content. Returns score (0 = no match). Scoring:
- Consecutive matches: bonus per consecutive char
- Word start matches: large bonus
- Title match bonus: prefer title matches over content
- Shorter text: small bonus
Types ¶
type AutoSaveTickMsg ¶
type AutoSaveTickMsg struct {
// ID identifies which auto-save timer this is (for debounce check)
ID int
}
AutoSaveTickMsg is sent when the auto-save debounce timer fires.
type InlineAutoSaveResultMsg ¶
type InlineAutoSaveResultMsg struct {
Err error
Epoch uint64
Activation uint64
Generation int
Content string
Saved bool
}
InlineAutoSaveResultMsg is sent after an inline auto-save completes.
func (InlineAutoSaveResultMsg) GetEpoch ¶
func (m InlineAutoSaveResultMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type InlineAutoSaveTickMsg ¶
type InlineAutoSaveTickMsg struct {
// Generation identifies which auto-save timer this is (for staleness check)
Generation int
}
InlineAutoSaveTickMsg is sent periodically during inline edit mode for auto-save.
type InlineEditExitedMsg ¶
InlineEditExitedMsg is sent when inline edit mode exits.
type InlineEditStartedMsg ¶
type InlineEditStartedMsg struct {
SessionName string
NoteID string
NotePath string
Editor string
Activation uint64
Epoch uint64
}
InlineEditStartedMsg is sent when inline edit mode starts successfully.
type Note ¶
Note is the plugin's view of a td note.
func FindExactTitleMatch ¶
FindExactTitleMatch returns the note with exact title match, or nil if none.
type NoteArchiveToggledMsg ¶
NoteArchiveToggledMsg is sent when a note's archived state is toggled.
func (NoteArchiveToggledMsg) GetEpoch ¶
func (m NoteArchiveToggledMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type NoteContentSavedMsg ¶
type NoteContentSavedMsg struct {
ID string
Err error
Epoch uint64
EditorActivation uint64 // Non-zero only for an inline-editor save lifecycle.
}
NoteContentSavedMsg is sent when a note's content is saved from the editor.
func (NoteContentSavedMsg) GetEpoch ¶
func (m NoteContentSavedMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type NoteDeletedMsg ¶
NoteDeletedMsg is sent when a note is deleted.
func (NoteDeletedMsg) GetEpoch ¶
func (m NoteDeletedMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type NoteFilter ¶
type NoteFilter int
NoteFilter represents the current note filter view.
const ( FilterActive NoteFilter = iota FilterArchived FilterDeleted )
func (NoteFilter) String ¶
func (f NoteFilter) String() string
String returns the display name for the filter.
type NoteMatch ¶
NoteMatch represents a note matching the search query.
func FilterNotes ¶
FilterNotes filters and scores notes against a query. Returns matches sorted by score descending.
type NotePinToggledMsg ¶
NotePinToggledMsg is sent when a note's pinned state is toggled.
func (NotePinToggledMsg) GetEpoch ¶
func (m NotePinToggledMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type NoteRestoredMsg ¶
NoteRestoredMsg is sent when a note is restored (undo delete/archive).
func (NoteRestoredMsg) GetEpoch ¶
func (m NoteRestoredMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type NoteSavedMsg ¶
type NoteSavedMsg struct {
Note *Note
Err error
Epoch uint64
EditorActivation uint64 // Non-zero only for an inline-editor save lifecycle.
}
NoteSavedMsg is sent when a note is created or updated.
func (NoteSavedMsg) GetEpoch ¶
func (m NoteSavedMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type NotesLoadedMsg ¶
NotesLoadedMsg is sent when notes are loaded from the database.
func (NotesLoadedMsg) GetEpoch ¶
func (m NotesLoadedMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin implements the notes plugin.
func (*Plugin) BlocksGlobalKeys ¶ added in v0.96.0
BlocksGlobalKeys reports whether a plugin-owned modal has keyboard focus.
func (*Plugin) ConsumesTextInput ¶
ConsumesTextInput reports whether notes currently has an active text-entry surface and should receive printable keys directly.
func (*Plugin) Cursor ¶ added in v0.88.0
Cursor exposes the inline editor's native cursor in plugin-local coordinates.
func (*Plugin) FocusContext ¶
FocusContext returns the current focus context.
func (*Plugin) PreferredMouseMode ¶ added in v0.88.0
PreferredMouseMode reduces idle hover traffic only while the inline terminal owns input. Modal and ordinary notes views retain all-motion hover.
func (*Plugin) WheelAtBoundary ¶ added in v1.0.0
func (p *Plugin) WheelAtBoundary(msg tea.MouseWheelMsg) bool
WheelAtBoundary implements plugin.WheelBoundaryConsumer for the Notes list and markdown preview. It mirrors handleMouseScroll's routing without moving the cursor, loading a note, or rendering.
Textarea edit mode and the inline tmux editor stay unknown: the textarea exposes no exact viewport boundary, and the inline editor's wheel belongs to the embedded application. Open modals are answered by the modal itself, in the same precedence Update uses, and never by the panes underneath.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a thin adapter over td's public notes API.
func NewStore ¶
NewStore opens the project's td database for notes. baseDir is the project root (not the issues.db path). If sessionID is empty, TD_SESSION_ID or "sidecar" is recorded only for local attribution; writes themselves go through td/pkg/notes.
func NewTestStore ¶ added in v1.0.0
NewTestStore creates an isolated td database for tests.
func (*Store) Get ¶
Get retrieves a note by ID, including soft-deleted rows. Missing notes return (nil, nil) to match the previous store contract.
func (*Store) ListArchived ¶
ListArchived retrieves archived, non-deleted notes.
func (*Store) ListDeleted ¶
ListDeleted retrieves soft-deleted notes.
func (*Store) ToggleArchive ¶
ToggleArchive toggles the archived state of a note.
func (*Store) Update ¶
Update writes title and content. Pin/archive changes should use TogglePin / ToggleArchive — td's Update does not touch those flags.
func (*Store) UpdateContent ¶
UpdateContent updates the content of a note, using the first line as title.
type TaskCreatedMsg ¶
TaskCreatedMsg is sent when a task is created from a note.
func (TaskCreatedMsg) GetEpoch ¶
func (m TaskCreatedMsg) GetEpoch() uint64
GetEpoch returns the epoch for staleness detection.
type UndoAction ¶
type UndoAction struct {
Type UndoActionType
NoteID string
Title string // For toast message
}
UndoAction represents an undoable action.
type UndoActionType ¶
type UndoActionType string
UndoActionType represents the type of undoable action.
const ( UndoDelete UndoActionType = "delete" UndoArchive UndoActionType = "archive" )