Skip to content

Commit

Permalink
chore(tui): copy tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Jan 10, 2025
1 parent 8283fa1 commit e9d74c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
12 changes: 3 additions & 9 deletions tui/analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ Shortcuts:
- esc: leave page
- tab: toggle between viewport and input box
- ctrl+u: scroll viewport up a page
- ctrl+d: scroll viewport down a page
- u: scroll viewport up a page
- d: scroll viewport down a page
- j,k: scroll viewport
Commands: [help, stats, site {domain}, post {slug}]
Expand Down Expand Up @@ -138,7 +138,6 @@ func (m Model) Init() tea.Cmd {
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmds []tea.Cmd
var cmd tea.Cmd
updateViewport := true
switch msg := msg.(type) {
case tea.WindowSizeMsg:
m.viewport.Width = headerWidth(msg.Width)
Expand All @@ -161,11 +160,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg.String() {
case "q", "esc":
return m, pages.Navigate(pages.MenuPage)
// when typing in input, ignore viewport updates
case " ", "k", "j":
if m.input.Focused() {
updateViewport = false
}
case "tab":
if m.input.Focused() {
m.input.Blur()
Expand Down Expand Up @@ -215,7 +209,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

m.input, cmd = m.input.Update(msg)
cmds = append(cmds, cmd)
if updateViewport {
if !m.input.Focused() {
m.viewport, cmd = m.viewport.Update(msg)
cmds = append(cmds, cmd)
}
Expand Down
8 changes: 4 additions & 4 deletions tui/menu/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ type MenuChoiceMsg struct {
const (
KeysChoice menuChoice = iota
TokensChoice
NotificationsChoice
PlusChoice
SettingsChoice
LogsChoice
AnalyticsChoice
ChatChoice
NotificationsChoice
PlusChoice
ExitChoice
UnsetChoice // set when no choice has been made
)
Expand All @@ -30,12 +30,12 @@ const (
var menuChoices = map[menuChoice]string{
KeysChoice: "Manage pubkeys",
TokensChoice: "Manage tokens",
NotificationsChoice: "Notifications",
PlusChoice: "Pico+",
SettingsChoice: "Settings",
LogsChoice: "Logs",
AnalyticsChoice: "Analytics",
ChatChoice: "Chat",
NotificationsChoice: "Notifications",
PlusChoice: "Pico+",
ExitChoice: "Exit",
}

Expand Down
2 changes: 1 addition & 1 deletion tui/notifications/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Add this URL to your RSS feed reader:
## Using our [rss-to-email](https://pico.sh/feeds) service
Create a feeds file (e.g. pico.txt):`, url)
Create a feeds file (using list file format, e.g. pico.txt):`, url)

md += "\n```\n"
md += fmt.Sprintf(`=: email [email protected]
Expand Down
4 changes: 4 additions & 0 deletions tui/plus/plus.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ func PlusView(username string, w int) string {
- prose
- no inherent storage limits
- blog analytics
- irc bouncer
- 10GB total storage
> You can use this same flow to add additional years to your membership,
> including if you are already a pico+ user.
There are a few ways to purchase a membership. We try our best to
provide immediate access to pico+ regardless of payment
method.
Expand Down

0 comments on commit e9d74c8

Please sign in to comment.