ui

package
v0.0.0-...-3d82c56 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(dep RuntimeDependencies) error

Types

type ActionDependencies

type ActionDependencies struct {
	Sender                    MessageSender
	Traceroute                TracerouteAction
	OnSave                    func(cfg config.AppConfig) error
	OnChatSelected            func(chatKey string)
	OnDeleteDMChat            func(chatKey string) error
	OnMapViewportChanged      func(zoom, x, y int)
	OnMapDisplayConfigChanged func(cfg config.MapDisplayConfig)
	OnClearDB                 func() error
	OnClearCache              func() error
	OnStartUpdateChecker      func()
	OnQuit                    func()
	NodeSettings              NodeSettingsAction
	NodeOverview              NodeOverviewAction
	NodeFavorite              NodeFavoriteAction
}

ActionDependencies contains user-triggered operations invoked from UI.

type BluetoothScanner

type BluetoothScanner interface {
	Scan(ctx context.Context, adapterID string) ([]DiscoveredBluetoothDevice, error)
}

BluetoothScanner scans nearby BLE devices and returns normalized results.

type ChatAction

type ChatAction string

ChatAction identifies a message-level action available from context menu.

const (
	ChatActionReply ChatAction = "reply"
	ChatActionReact ChatAction = "react"
)

type ChatActionHandler

type ChatActionHandler func(message domain.ChatMessage, action ChatAction)

ChatActionHandler handles selected chat message context action.

type DataDependencies

type DataDependencies struct {
	Config            config.AppConfig
	Paths             app.Paths
	ChatStore         *domain.ChatStore
	NodeStore         *domain.NodeStore
	Bus               bus.MessageBus
	LastSelectedChat  string
	LocalNodeID       func() string
	LocalNodeSnapshot func() app.LocalNodeSnapshot
	CurrentConfig     func() config.AppConfig
	CurrentConnStatus func() (busmsg.ConnectionStatus, bool)
}

DataDependencies contains read-only state consumed by UI tabs.

type DiscoveredBluetoothDevice

type DiscoveredBluetoothDevice struct {
	Name                 string
	Address              string
	RSSI                 int
	HasMeshtasticService bool
}

DiscoveredBluetoothDevice represents a discovered BLE device entry for UI selection.

type FyneNotificationSender

type FyneNotificationSender struct {
	// contains filtered or unexported fields
}

FyneNotificationSender bridges app notifications to native Fyne notifications.

func NewFyneNotificationSender

func NewFyneNotificationSender(app fyne.App) *FyneNotificationSender

func (*FyneNotificationSender) Send

func (s *FyneNotificationSender) Send(notification notifications.Payload)

type LaunchOptions

type LaunchOptions struct {
	StartHidden bool
}

LaunchOptions controls initial window behavior at startup.

type MessageSender

type MessageSender interface {
	SendText(chatKey, text string, opts radio.TextSendOptions) <-chan radio.SendResult
}

MessageSender sends user text messages through the active radio service.

type NodeAction

type NodeAction string

NodeAction identifies a node-level action available from context menu.

const (
	NodeActionDirectMessage NodeAction = "direct_message"
	NodeActionShare         NodeAction = "share"
	NodeActionFavorite      NodeAction = "favorite"
	NodeActionTraceroute    NodeAction = "traceroute"
	NodeActionInfo          NodeAction = "info"
)

type NodeActionHandler

type NodeActionHandler func(node domain.Node, action NodeAction)

NodeActionHandler handles selected node action menu item.

type NodeFavoriteAction

type NodeFavoriteAction interface {
	SetFavorite(ctx context.Context, targetNodeID string, favorite bool) error
}

NodeFavoriteAction handles marking remote nodes as favorite on local node DB.

type NodeOverviewAction

type NodeOverviewAction interface {
	RequestUserInfo(ctx context.Context, targetNodeID string, requester app.LocalNodeSnapshot) error
	RequestTelemetry(ctx context.Context, targetNodeID string, kind radio.TelemetryRequestKind) error
	ListTelemetryHistory(ctx context.Context, nodeID string, limit int) ([]domain.NodeTelemetryHistoryEntry, error)
	ListPositionHistory(ctx context.Context, nodeID string, limit int) ([]domain.NodePositionHistoryEntry, error)
	ListIdentityHistory(ctx context.Context, nodeID string, limit int) ([]domain.NodeIdentityHistoryEntry, error)
}

NodeOverviewAction handles node overview requests and history reads.

type NodeRowBackground

type NodeRowBackground struct {
	ThemeColorName fyne.ThemeColorName
	CustomColor    color.Color
	Alpha          float32
}

NodeRowBackground defines optional row background styling.

type NodeRowRenderer

type NodeRowRenderer struct {
	Create func() fyne.CanvasObject
	Update func(obj fyne.CanvasObject, node domain.Node)
}

NodeRowRenderer defines create/update callbacks for nodes list row widgets.

func DefaultNodeRowRenderer

func DefaultNodeRowRenderer() NodeRowRenderer

type NodeSettingsAction

type NodeSettingsAction interface {
	LoadUserSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeUserSettings, error)
	SaveUserSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeUserSettings) error
	LoadSecuritySettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeSecuritySettings, error)
	SaveSecuritySettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeSecuritySettings) error
	LoadLoRaSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeLoRaSettings, error)
	SaveLoRaSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeLoRaSettings) error
	LoadDeviceSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeDeviceSettings, error)
	SaveDeviceSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeDeviceSettings) error
	LoadPositionSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodePositionSettings, error)
	SavePositionSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodePositionSettings) error
	LoadPowerSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodePowerSettings, error)
	SavePowerSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodePowerSettings) error
	LoadDisplaySettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeDisplaySettings, error)
	SaveDisplaySettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeDisplaySettings) error
	LoadBluetoothSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeBluetoothSettings, error)
	SaveBluetoothSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeBluetoothSettings) error
	LoadNetworkSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeNetworkSettings, error)
	SaveNetworkSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeNetworkSettings) error
	LoadMQTTSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeMQTTSettings, error)
	SaveMQTTSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeMQTTSettings) error
	LoadSerialSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeSerialSettings, error)
	SaveSerialSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeSerialSettings) error
	LoadExternalNotificationSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeExternalNotificationSettings, error)
	SaveExternalNotificationSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeExternalNotificationSettings) error
	LoadStoreForwardSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeStoreForwardSettings, error)
	SaveStoreForwardSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeStoreForwardSettings) error
	LoadRangeTestSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeRangeTestSettings, error)
	SaveRangeTestSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeRangeTestSettings) error
	LoadTelemetrySettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeTelemetrySettings, error)
	SaveTelemetrySettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeTelemetrySettings) error
	LoadCannedMessageSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeCannedMessageSettings, error)
	SaveCannedMessageSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeCannedMessageSettings) error
	LoadAudioSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeAudioSettings, error)
	SaveAudioSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeAudioSettings) error
	LoadRemoteHardwareSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeRemoteHardwareSettings, error)
	SaveRemoteHardwareSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeRemoteHardwareSettings) error
	LoadNeighborInfoSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeNeighborInfoSettings, error)
	SaveNeighborInfoSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeNeighborInfoSettings) error
	LoadAmbientLightingSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeAmbientLightingSettings, error)
	SaveAmbientLightingSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeAmbientLightingSettings) error
	LoadDetectionSensorSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeDetectionSensorSettings, error)
	SaveDetectionSensorSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeDetectionSensorSettings) error
	LoadPaxcounterSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodePaxcounterSettings, error)
	SavePaxcounterSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodePaxcounterSettings) error
	LoadStatusMessageSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeStatusMessageSettings, error)
	SaveStatusMessageSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeStatusMessageSettings) error
	LoadChannelSettings(ctx context.Context, target app.NodeSettingsTarget) (app.NodeChannelSettingsList, error)
	SaveChannelSettings(ctx context.Context, target app.NodeSettingsTarget, settings app.NodeChannelSettingsList) error
	ExportProfile(ctx context.Context, target app.NodeSettingsTarget) (*app_generated.DeviceProfile, error)
	ImportProfile(ctx context.Context, target app.NodeSettingsTarget, profile *app_generated.DeviceProfile, options app.NodeProfileImportOptions) error
	RebootNode(ctx context.Context, target app.NodeSettingsTarget) error
	ShutdownNode(ctx context.Context, target app.NodeSettingsTarget) error
	FactoryResetNode(ctx context.Context, target app.NodeSettingsTarget) error
	ResetNodeDB(ctx context.Context, target app.NodeSettingsTarget, preserveFavorites bool) error
}

NodeSettingsAction loads and saves node settings from UI.

type NodesTabActions

type NodesTabActions struct {
	OnNodeSecondaryTapped func(node domain.Node, position fyne.Position)
}

NodesTabActions contains optional callbacks for node row interactions.

type PlatformDependencies

type PlatformDependencies struct {
	BluetoothScanner      BluetoothScanner
	OpenBluetoothSettings func() error
}

PlatformDependencies contains OS-specific helpers used by UI actions.

type RuntimeDependencies

type RuntimeDependencies struct {
	Data     DataDependencies
	Actions  ActionDependencies
	Platform PlatformDependencies
	UIHooks  UIHooks
	Launch   LaunchOptions
}

RuntimeDependencies is the complete dependency graph required to run the UI.

func BuildRuntimeDependencies

func BuildRuntimeDependencies(rt *meshapp.Runtime, launch LaunchOptions, onQuit func()) RuntimeDependencies

type TinyGoBluetoothScanner

type TinyGoBluetoothScanner struct {
	// contains filtered or unexported fields
}

TinyGoBluetoothScanner is a BluetoothScanner backed by tinygo.org/x/bluetooth.

func NewTinyGoBluetoothScanner

func NewTinyGoBluetoothScanner(scanDuration time.Duration) *TinyGoBluetoothScanner

func (*TinyGoBluetoothScanner) Scan

type TracerouteAction

type TracerouteAction interface {
	StartTraceroute(ctx context.Context, target app.TracerouteTarget) (busmsg.TracerouteUpdate, error)
}

TracerouteAction starts traceroute requests for UI actions.

type UIHooks

type UIHooks struct {
	CurrentWindow           func() fyne.Window
	RunOnUI                 func(func())
	RunAsync                func(func())
	ShowBluetoothScanDialog func(window fyne.Window, devices []DiscoveredBluetoothDevice, onSelect func(DiscoveredBluetoothDevice))
	ShowErrorDialog         func(err error, window fyne.Window)
	ShowInfoDialog          func(title, message string, window fyne.Window)
}

UIHooks overrides default UI interactions for tests and custom embedding.

Source Files

Directories

Path Synopsis
map

Jump to

Keyboard shortcuts

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