Update participant guide and interface instructions for clarity and consistency
This commit is contained in:
@@ -43,7 +43,7 @@ func (q *QuestionnaireModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
q.form.WithWidth(msg.Width)
|
||||
case tea.KeyPressMsg:
|
||||
switch msg.String() {
|
||||
case "q", "ctrl+c":
|
||||
case "ctrl+c":
|
||||
q.userQuit = true
|
||||
return q, tea.Quit
|
||||
}
|
||||
|
||||
@@ -28,16 +28,16 @@ type TaskHelpKeys struct {
|
||||
|
||||
var DefaultTaskKeys = TaskHelpKeys{
|
||||
Quit: key.NewBinding(
|
||||
key.WithKeys("q", "ctrl+c"),
|
||||
key.WithHelp("q", "Quit"),
|
||||
key.WithKeys("ctrl+c"),
|
||||
key.WithHelp("ctrl+c", "quit"),
|
||||
),
|
||||
Start: key.NewBinding(
|
||||
key.WithKeys("enter"),
|
||||
key.WithHelp("enter", "Start"),
|
||||
key.WithHelp("enter", "start"),
|
||||
),
|
||||
About: key.NewBinding(
|
||||
key.WithKeys("?"),
|
||||
key.WithHelp("?", "Learn interface"),
|
||||
key.WithHelp("?", "interface info"),
|
||||
),
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ func (m TaskModel) View() tea.View {
|
||||
var body string
|
||||
if m.aboutVisible {
|
||||
about := style.TextStyle.
|
||||
Width(textWidth).
|
||||
Width(bodyWidth - 2).
|
||||
Align(lipgloss.Left).
|
||||
Render(m.InterfaceDescription)
|
||||
|
||||
@@ -147,9 +147,9 @@ func (m TaskModel) View() tea.View {
|
||||
|
||||
card := cardStyle.Render(body)
|
||||
|
||||
helpText := "Press " + m.keys.Start.Help().Key + " " + m.keys.Start.Help().Desc +
|
||||
" • " + m.keys.Quit.Help().Key + " " + m.keys.Quit.Help().Desc +
|
||||
" • " + m.keys.About.Help().Key + " " + m.keys.About.Help().Desc
|
||||
helpText := "Press " + m.keys.Start.Help().Key + " to " + m.keys.Start.Help().Desc +
|
||||
" • " + m.keys.Quit.Help().Key + " to " + m.keys.Quit.Help().Desc +
|
||||
" • " + m.keys.About.Help().Key + " for " + m.keys.About.Help().Desc
|
||||
|
||||
view := lipgloss.JoinVertical(
|
||||
lipgloss.Center,
|
||||
@@ -176,11 +176,13 @@ func (m TaskModel) View() tea.View {
|
||||
func (m TaskModel) getQuitHelpText() string {
|
||||
switch m.InterfaceType {
|
||||
case models.InterfaceTypeWeb:
|
||||
return "Press esc/q in the terminal to skip the task"
|
||||
return "Press 'q' in the server terminal to skip the task"
|
||||
case models.InterfaceTypeTUI:
|
||||
return "Press 'q' to skip task during the survey"
|
||||
case models.InterfaceTypeCLI, models.InterfaceTypeREPL:
|
||||
return "Write 'exit' to skip task during the survey"
|
||||
return `Write 'exit' to skip task during the survey
|
||||
|
||||
Note: Use 'tab' to scroll through suggestions`
|
||||
default:
|
||||
return m.keys.Quit.Help().Key + " to quit"
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ func helpBarConfig(view ViewKind) HelpBarConfig {
|
||||
{Key: "/", Desc: "search"},
|
||||
{Key: "a", Desc: "add"},
|
||||
{Key: "c", Desc: "comment"},
|
||||
{Key: "e/d/s/p/t/A/D", Desc: "edit"},
|
||||
{Key: "e/d/s/p/t/A/D", Desc: `edit("?" for details)`},
|
||||
{Key: "x", Desc: "delete"},
|
||||
{Key: "q", Desc: "quit"},
|
||||
{Key: "?", Desc: "help"},
|
||||
|
||||
@@ -56,7 +56,7 @@ func (m tuiModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
return m, nil
|
||||
case tea.KeyPressMsg:
|
||||
switch msg.String() {
|
||||
case "q", "esc", "ctrl+c":
|
||||
case "q":
|
||||
select {
|
||||
case <-m.quitChan:
|
||||
default:
|
||||
@@ -71,7 +71,7 @@ func (m tuiModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
|
||||
func (m tuiModel) View() tea.View {
|
||||
content := lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, fmt.Sprintf(
|
||||
"Web server running at %s\n\nPress q, esc, or Ctrl+C to stop the task and server.\n",
|
||||
"Web server running at %s\n\nPress q to stop the task and server.\n",
|
||||
m.address,
|
||||
))
|
||||
v := tea.NewView(content)
|
||||
|
||||
Reference in New Issue
Block a user