delete

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialog

type Dialog struct {
	Target      any    // Generic target being deleted
	ItemType    string // "scan", "network", "interface", etc
	ItemName    string // Display name of the item
	CursorOnYes bool   // true = Delete selected, false = Cancel selected
}

Dialog is a reusable delete confirmation dialog

func (Dialog) Render

func (d Dialog) Render(view string, viewWidth, viewHeight int) string

Render displays the delete confirmation dialog

type HistoryDeleteDialog

type HistoryDeleteDialog struct {
	Target      any    // *historyview.TreeNode
	CursorOnYes bool   // true = Delete selected, false = Cancel selected
	ItemType    string // "scan", "network", "interface"
	ItemName    string // Display name of the item
}

HistoryDeleteDialog is a delete confirmation dialog specific to the history view

func (*HistoryDeleteDialog) HandleMouseClick

func (d *HistoryDeleteDialog) HandleMouseClick(x, y, viewWidth, viewHeight int) (handled bool, action MouseAction)

HandleMouseClick applies main-card click semantics to delete dialog buttons: first click selects a button, second click on the selected button confirms it.

func (*HistoryDeleteDialog) IsDeleteSelected

func (d *HistoryDeleteDialog) IsDeleteSelected() bool

IsDeleteSelected returns true if Delete is currently selected

func (HistoryDeleteDialog) Render

func (d HistoryDeleteDialog) Render(view string, viewWidth, viewHeight int) string

Render displays the delete confirmation dialog for history view

func (*HistoryDeleteDialog) Toggle

func (d *HistoryDeleteDialog) Toggle()

Toggle toggles the cursor between Delete and Cancel

type MouseAction

type MouseAction int
const (
	MouseActionNone MouseAction = iota
	MouseActionConfirmNo
	MouseActionConfirmYes
)

Jump to

Keyboard shortcuts

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