palette

package
v1.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package palette is the command-palette TUI component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddExternalAssetDirMsg added in v1.2.0

type AddExternalAssetDirMsg struct {
	Name string
	Path string
}

AddExternalAssetDirMsg is sent when the user registers a new named external dir.

type BookmarkCurrentTabMsg

type BookmarkCurrentTabMsg struct{}

BookmarkCurrentTabMsg is sent when the user bookmarks the active tab.

type CloseMsg

type CloseMsg struct{}

CloseMsg is sent when the palette is dismissed without a selection.

type CopyFileToAssetsMsg added in v1.2.0

type CopyFileToAssetsMsg struct{ SourcePath string }

CopyFileToAssetsMsg is sent when the user wants to copy a file into vault assets.

type CopyNoteMsg added in v1.3.0

type CopyNoteMsg struct {
	Src  string
	Dest string
}

CopyNoteMsg is sent when the user submits a new note name, after first selecting the source note.

type CreateNoteMsg

type CreateNoteMsg struct {
	Name       string
	InsertLink bool // true when created via "Insert Note Link"
}

CreateNoteMsg is sent when the user submits a new note name.

type CreateTemplateMsg

type CreateTemplateMsg struct{ Name string }

CreateTemplateMsg is sent when the user submits a new template name.

type CreateVaultMsg

type CreateVaultMsg struct{ Path string }

CreateVaultMsg is sent when the user submits a path for a new vault.

type DeleteNoteConfirmMsg

type DeleteNoteConfirmMsg struct {
	Path string
	Name string
}

DeleteNoteConfirmMsg is sent when the user confirms a note deletion.

type DeleteNoteMsg

type DeleteNoteMsg struct{ Path string }

DeleteNoteMsg is sent to execute a confirmed note deletion.

type EditBookmarksMsg

type EditBookmarksMsg struct{}

EditBookmarksMsg is sent when the user opens the bookmark editor.

type InsertAssetLinkMsg added in v1.2.0

type InsertAssetLinkMsg struct{ Path string }

InsertAssetLinkMsg is sent when the user picks an asset to insert a link to. Path is vault-relative (e.g. "assets/photo.jpg").

type InsertLinkMsg

type InsertLinkMsg struct{ Link string }

InsertLinkMsg is sent when the user picks "Insert Note Link".

type InsertTemplateMsg

type InsertTemplateMsg struct{ Path string }

InsertTemplateMsg is sent when the user picks a template to insert inline.

type LoadVaultMsg added in v0.9.0

type LoadVaultMsg struct{ Path string }

LoadVaultMsg is sent when the user selects a vault to load.

type Model

type Model struct {
	FSComplete func(string) []string // nil-safe; set by caller after New()
	// contains filtered or unexported fields
}

Model is the palette component model.

func New

func New(cfg *config.Config, mode common.Mode, idx *vfiles.Index, currentFilePath string) Model

New creates a palette Model filtered to commands available in the given mode.

func (*Model) SetSize

func (p *Model) SetSize(w, h int)

SetSize sets the display dimensions of the palette.

func (Model) Update

func (p Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (p Model) View() string

type NewFromTemplateMsg

type NewFromTemplateMsg struct {
	Name         string
	TemplatePath string
}

NewFromTemplateMsg is sent when a new note is created from a template.

type OpenAssetMsg added in v1.2.0

type OpenAssetMsg struct{ Path string }

OpenAssetMsg is sent when the user picks an asset to open externally.

type OpenBookmarkMsg

type OpenBookmarkMsg struct{ Path string }

OpenBookmarkMsg is sent when the user selects a bookmark to open.

type OpenJournalMsg

type OpenJournalMsg struct{ Ref string }

OpenJournalMsg is sent when the user selects a journal date reference.

type OpenNoteMsg

type OpenNoteMsg struct{ Path string }

OpenNoteMsg is sent when the user selects a note to open.

type OpenSettingsEditorMsg added in v1.2.0

type OpenSettingsEditorMsg struct{ Scope int }

OpenSettingsEditorMsg is sent when the user selects a settings editor command. Scope 0 = global config, 1 = vault config.

type RenameNoteMsg

type RenameNoteMsg struct {
	Path string // file being renamed (selected via picker)
	Name string // new name entered by user
}

RenameNoteMsg is sent when the user submits a new name for a note.

type SwitchLangMsg added in v1.2.0

type SwitchLangMsg struct{ Code string }

SwitchLangMsg is sent when the user selects a language from the language picker.

type SwitchThemeMsg

type SwitchThemeMsg struct{ Name string }

SwitchThemeMsg is sent when the user selects a theme to apply.

type TabsToSpacesMsg added in v0.9.0

type TabsToSpacesMsg struct{}

TabsToSpacesMsg is sent when the user selects "Convert Tabs to Spaces".

type ToggleAllFoldsMsg added in v1.2.0

type ToggleAllFoldsMsg struct{ Folded bool }

ToggleAllFoldsMsg is sent when the user selects "Folds: Expand/Collapse all Folds". folded=false expands all; folded=true collapses all.

type ToggleCheckboxMsg

type ToggleCheckboxMsg struct{}

ToggleCheckboxMsg is sent when the user toggles the nearest checkbox.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL