Skip to content

Commit

Permalink
fix: update tab keybinding from Alt to Meta
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-grgt committed Feb 5, 2025
1 parent 7ee331c commit e00b6bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions ktea_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ func TestKtea(t *testing.T) {
view := model.View()

var expectedLayout = `
╭────────────────╮╭─────────────────────────╮╭─────────────────────────╮╭──────────────────
│ Topics (Alt-1) ││ Consumer Groups (Alt-2) ││ Schema Registry (Alt-3) ││ Clusters (Alt-4) │
┴────────────────┴┘ └┴─────────────────────────┴┴──────────────────┴────────
╭────────────────╮╭─────────────────────────╮╭─────────────────────────╮╭───────────────────╮
│ Topics (Meta-1) ││ Consumer Groups (Meta-2) ││ Schema Registry (Meta-3) ││ Clusters (Meta-4) │
┴────────────────┴┘ └┴─────────────────────────┴┴───────────────────┴────
`
assert.Contains(t, view, expectedLayout)

Expand All @@ -89,9 +89,9 @@ func TestKtea(t *testing.T) {
view = model.View()

expectedLayout = `
╭────────────────╮╭─────────────────────────╮╭─────────────────────────╮╭──────────────────
│ Topics (Alt-1) ││ Consumer Groups (Alt-2) ││ Schema Registry (Alt-3) ││ Clusters (Alt-4) │
┴────────────────┴┴─────────────────────────┴┘ └┴──────────────────┴────────
╭────────────────╮╭─────────────────────────╮╭─────────────────────────╮╭───────────────────╮
│ Topics (Meta-1) ││ Consumer Groups (Meta-2) ││ Schema Registry (Meta-3) ││ Clusters (Meta-4) │
┴────────────────┴┴─────────────────────────┴┘ └┴───────────────────┴────
`
assert.Contains(t, view, expectedLayout)

Expand All @@ -112,9 +112,9 @@ func TestKtea(t *testing.T) {
view = model.View()

expectedLayout = `
╭────────────────╮╭─────────────────────────╮╭──────────────────
│ Topics (Alt-1) ││ Consumer Groups (Alt-2) ││ Clusters (Alt-3) │
┴────────────────┴┴─────────────────────────┴┘ └───────────────────────────────────
╭────────────────╮╭─────────────────────────╮╭───────────────────╮
│ Topics (Meta-1) ││ Consumer Groups (Meta-2) ││ Clusters (Meta-3) │
┴────────────────┴┴─────────────────────────┴┘ ────────────────────────────────
`
assert.Regexp(t, "X\\W+tst", view)
assert.NotRegexp(t, "X\\W+prd", view)
Expand Down
2 changes: 1 addition & 1 deletion ui/components/tab/tabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (m *Model) View(ctx *kontext.ProgramKtx, renderer *ui.Renderer) string {
}
tabsToRender := make([]string, len(m.elements))
for i, e := range m.elements {
tabName := fmt.Sprintf("%s (Alt-%d)", e, i+1)
tabName := fmt.Sprintf("%s (Meta-%d)", e, i+1)
if i == m.activeTab {
tabsToRender = append(tabsToRender, styles.Tab.ActiveTab.Render(tabName))
} else {
Expand Down

0 comments on commit e00b6bb

Please sign in to comment.