wip: capitalisation, help help & remapping scroll
This commit is contained in:
6
conn.go
6
conn.go
@ -78,7 +78,7 @@ func connInit(m *model) tea.Msg {
|
||||
return errMsg{Err: fmt.Errorf("unable to initialise torrc builder: %s", err)}
|
||||
}
|
||||
|
||||
m.sendStatus("initialising Tor ACN...")
|
||||
m.sendStatus("Initialising Tor ACN...")
|
||||
|
||||
acn, err := tor.NewTorACNWithAuth(
|
||||
path.Join(m.userDir, "/.tor"),
|
||||
@ -93,7 +93,7 @@ func connInit(m *model) tea.Msg {
|
||||
return errMsg{Err: fmt.Errorf("unable to bootstrap tor: %s", err)}
|
||||
}
|
||||
|
||||
m.sendStatus("waiting for Tor ACN to bootstrap...")
|
||||
m.sendStatus("Waiting for ACN to bootstrap...")
|
||||
|
||||
if err := acn.WaitTillBootstrapped(); err != nil {
|
||||
return errMsg{Err: fmt.Errorf("unable to initialise tor: %s", err)}
|
||||
@ -111,7 +111,7 @@ func connInit(m *model) tea.Msg {
|
||||
app := app.NewApp(acn, m.userDir, settingsFile)
|
||||
app.InstallEngineHooks(connections.DefaultEngineHooks{})
|
||||
|
||||
m.sendStatus("the Tor ACN is up")
|
||||
m.sendStatus("Tor ACN is up and running, all engines go")
|
||||
|
||||
return appInitialisedMsg{
|
||||
app: app,
|
||||
|
16
input.go
16
input.go
@ -6,14 +6,14 @@ import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
const cmdHelp = `/clear
|
||||
/connect
|
||||
/help
|
||||
/profile create <name> <password> <password>
|
||||
/profile info
|
||||
/profile unlock <password>
|
||||
/start
|
||||
/quit`
|
||||
const cmdHelp = `/clear | Clear the screen
|
||||
/connect | Start the Tor ACN
|
||||
/help | Show this help
|
||||
/profile create <name> <password> <password> | Create a new profile
|
||||
/profile info | Show profile information
|
||||
/profile unlock <password> | Unlock profile(s)
|
||||
/start | Show getting started guide
|
||||
/quit | Quit the program`
|
||||
|
||||
func isHelpCmd(cmds []string) bool {
|
||||
if cmds[0] == "help" {
|
||||
|
20
model.go
20
model.go
@ -24,11 +24,12 @@ const (
|
||||
Metadata resistant messaging
|
||||
Pre-alpha v0.1.0
|
||||
|
||||
Run /start for the getting started guide
|
||||
Use the /help command to see the command listing`
|
||||
Run /start for the getting started guide.
|
||||
Run /help to see all available commands.`
|
||||
|
||||
gettingStartedMessage = `
|
||||
== Getting started guide ==
|
||||
gettingStartedMessage = `=====================
|
||||
Getting started guide
|
||||
=====================
|
||||
|
||||
Welcome to Cairde, a terminal client for metadata resistant messaging built on
|
||||
the Cwtch protocol. In order to get started, you'll need to connect to the Tor
|
||||
@ -37,12 +38,13 @@ network, initialise Cwtch and create your first profile. It's simple!
|
||||
1. Type /connect to start your Tor engines and initialise Cwtch.
|
||||
|
||||
2. Type "/profile create <name> <password> <password>" to create a profile.
|
||||
Please replace <...> with your own name/passwords.
|
||||
Please replace <...> with your own name/passwords. Both passwords should
|
||||
match. WARNING: if you can't remember your password, you can't unlock your
|
||||
profile, so **write it down somehwere safe**.
|
||||
|
||||
TODO:
|
||||
* how to invite contacts
|
||||
* how to toggle contact via menu
|
||||
`
|
||||
* how to toggle contact via menu`
|
||||
)
|
||||
|
||||
type model struct {
|
||||
@ -91,7 +93,7 @@ func newModel(username, homeDir string) model {
|
||||
|
||||
connState: offline,
|
||||
|
||||
menuBar: []string{"STATUS", "P1", "P2"},
|
||||
menuBar: []string{"STATUS"},
|
||||
menuState: 0,
|
||||
|
||||
input: input,
|
||||
@ -370,7 +372,7 @@ func (m model) View() string {
|
||||
var renderedCmdHelp []string
|
||||
cmdHelp := []string{
|
||||
"CTRL+N/P", "SWITCH PROFILE",
|
||||
"CTRL+U/D", "SCROLL UP/DOWN",
|
||||
"CTRL+J/K", "SCROLL UP/DOWN",
|
||||
"CTRL+L", "CLEAR",
|
||||
"CTRL+C", "EXIT",
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ func newViewport(width, height int) viewport.Model {
|
||||
viewp.KeyMap = viewport.KeyMap{
|
||||
PageDown: key.NewBinding(key.WithKeys("pgdown")),
|
||||
PageUp: key.NewBinding(key.WithKeys("pgup")),
|
||||
HalfPageUp: key.NewBinding(key.WithKeys("ctrl+u")),
|
||||
HalfPageDown: key.NewBinding(key.WithKeys("ctrl+d")),
|
||||
HalfPageUp: key.NewBinding(key.WithKeys("ctrl+k")),
|
||||
HalfPageDown: key.NewBinding(key.WithKeys("ctrl+j")),
|
||||
}
|
||||
return viewp
|
||||
}
|
||||
|
Reference in New Issue
Block a user