From c7bdf92619e78174dd85f4b0801a0f8d472411e2 Mon Sep 17 00:00:00 2001 From: Versha Dhankar Date: Fri, 4 Oct 2024 19:11:06 -0700 Subject: [PATCH] Update filter bindings to display on screen Update the controller (filter_controller.go) to set up the binding to be didsplayed. Additionally, update the translations for the binding name to be shorter, to make it more likely the text will fit at the bottom of the screen. This also involved updating the keybindings_*.md files with go generate ./... The keybinding screen in particular (which is a filterable popup) seems frustrating for users. In #3141, @kadaan suggested that perhaps the keybindings page should display a message in the footer about the presence of this option as a way to increase discoverability. This change enables this binding displaying on _all_ filterable views. I'm not sure if it's valuable to restrict this to just the keybinding view. --- docs/keybindings/Keybindings_en.md | 18 +++++++++--------- docs/keybindings/Keybindings_ja.md | 18 +++++++++--------- docs/keybindings/Keybindings_ko.md | 18 +++++++++--------- docs/keybindings/Keybindings_nl.md | 18 +++++++++--------- docs/keybindings/Keybindings_ru.md | 18 +++++++++--------- pkg/gui/controllers/filter_controller.go | 7 ++++--- pkg/i18n/english.go | 2 +- 7 files changed, 50 insertions(+), 49 deletions(-) diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index 214b7359a6d..31b499ae4a3 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -174,7 +174,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | View commits | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Main panel (merging) @@ -242,7 +242,7 @@ If you would instead like to start an interactive rebase from the selected commi |-----|--------|-------------| | `` `` | Execute | | | `` `` | Close | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Reflog @@ -259,7 +259,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | View commits | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Remote branches @@ -277,7 +277,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | View commits | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Remotes @@ -288,7 +288,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` d `` | Remove | Remove the selected remote. Any local branches tracking a remote branch from the remote will be unaffected. | | `` e `` | Edit | Edit the selected remote's name or URL. | | `` f `` | Fetch | Fetch updates from the remote repository. This retrieves new commits and branches without merging them into your local branches. | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Stash @@ -301,7 +301,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` r `` | Rename stash | | | `` `` | View files | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Status @@ -342,7 +342,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` e `` | Update submodule URL | | | `` i `` | Initialize | Initialize the selected submodule to prepare for fetching. You probably want to follow this up by invoking the 'update' action to fetch the submodule. | | `` b `` | View bulk submodule options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Tags @@ -356,7 +356,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | View commits | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Worktrees @@ -366,4 +366,4 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Switch | Switch to the selected worktree. | | `` o `` | Open in editor | | | `` d `` | Remove | Remove the selected worktree. This will both delete the worktree's directory, as well as metadata about the worktree in the .git directory. | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | diff --git a/docs/keybindings/Keybindings_ja.md b/docs/keybindings/Keybindings_ja.md index a433e97b6dc..35ed07bd770 100644 --- a/docs/keybindings/Keybindings_ja.md +++ b/docs/keybindings/Keybindings_ja.md @@ -62,7 +62,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` r `` | Stashを変更 | | | `` `` | View files | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Sub-commits @@ -89,7 +89,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` `` | Switch | Switch to the selected worktree. | | `` o `` | Open in editor | | | `` d `` | Remove | Remove the selected worktree. This will both delete the worktree's directory, as well as metadata about the worktree in the .git directory. | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## コミット @@ -164,7 +164,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` e `` | サブモジュールのURLを更新 | | | `` i `` | Initialize | サブモジュールを初期化 | | `` b `` | View bulk submodule options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## ステータス @@ -188,7 +188,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | コミットを閲覧 | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## ファイル @@ -245,7 +245,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | コミットを閲覧 | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## メインパネル (Merging) @@ -313,7 +313,7 @@ If you would instead like to start an interactive rebase from the selected commi |-----|--------|-------------| | `` `` | 実行 | | | `` `` | 閉じる | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## リモート @@ -324,7 +324,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` d `` | Remove | Remove the selected remote. Any local branches tracking a remote branch from the remote will be unaffected. | | `` e `` | Edit | リモートを編集 | | `` f `` | Fetch | リモートをfetch | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## リモートブランチ @@ -342,7 +342,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | コミットを閲覧 | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 参照ログ @@ -359,7 +359,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | コミットを閲覧 | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 確認パネル diff --git a/docs/keybindings/Keybindings_ko.md b/docs/keybindings/Keybindings_ko.md index cbafa9476e1..5fef83ac208 100644 --- a/docs/keybindings/Keybindings_ko.md +++ b/docs/keybindings/Keybindings_ko.md @@ -66,7 +66,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` `` | Open external diff tool (git difftool) | | | `` `` | 커밋 보기 | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Stash @@ -79,7 +79,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` r `` | Rename stash | | | `` `` | View selected item's files | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Sub-commits @@ -106,7 +106,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` `` | Switch | Switch to the selected worktree. | | `` o `` | Open in editor | | | `` d `` | Remove | Remove the selected worktree. This will both delete the worktree's directory, as well as metadata about the worktree in the .git directory. | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 메뉴 @@ -114,7 +114,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ |-----|--------|-------------| | `` `` | 실행 | | | `` `` | 닫기 | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 메인 패널 (Merging) @@ -201,7 +201,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` `` | Open external diff tool (git difftool) | | | `` `` | 커밋 보기 | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 상태 @@ -225,7 +225,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` e `` | 서브모듈의 URL을 수정 | | | `` i `` | Initialize | 서브모듈 초기화 | | `` b `` | View bulk submodule options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 원격 @@ -236,7 +236,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` d `` | Remove | Remove the selected remote. Any local branches tracking a remote branch from the remote will be unaffected. | | `` e `` | Edit | Remote를 수정 | | `` f `` | Fetch | 원격을 업데이트 | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 원격 브랜치 @@ -254,7 +254,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` `` | Open external diff tool (git difftool) | | | `` `` | 커밋 보기 | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 커밋 @@ -329,7 +329,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | 커밋 보기 | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## 파일 diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md index f63dc02600e..44d169061f2 100644 --- a/docs/keybindings/Keybindings_nl.md +++ b/docs/keybindings/Keybindings_nl.md @@ -113,7 +113,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ | `` `` | Open external diff tool (git difftool) | | | `` `` | Bekijk commits | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Commit bericht @@ -182,7 +182,7 @@ If you would instead like to start an interactive rebase from the selected commi |-----|--------|-------------| | `` `` | Uitvoeren | | | `` `` | Sluiten | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Mergen @@ -237,7 +237,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | Bekijk commits | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Remote branches @@ -255,7 +255,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | Bekijk commits | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Remotes @@ -266,7 +266,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` d `` | Remove | Remove the selected remote. Any local branches tracking a remote branch from the remote will be unaffected. | | `` e `` | Edit | Wijzig remote | | `` f `` | Fetch | Fetch remote | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Staging @@ -301,7 +301,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` r `` | Rename stash | | | `` `` | Bekijk gecommite bestanden | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Status @@ -342,7 +342,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` e `` | Update submodule URL | | | `` i `` | Initialize | Initialiseer submodule | | `` b `` | Bekijk bulk submodule opties | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Tags @@ -356,7 +356,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | Bekijk commits | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Worktrees @@ -366,4 +366,4 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Switch | Switch to the selected worktree. | | `` o `` | Open in editor | | | `` d `` | Remove | Remove the selected worktree. This will both delete the worktree's directory, as well as metadata about the worktree in the .git directory. | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | diff --git a/docs/keybindings/Keybindings_ru.md b/docs/keybindings/Keybindings_ru.md index 2fa0a5d2279..d28a48c0af1 100644 --- a/docs/keybindings/Keybindings_ru.md +++ b/docs/keybindings/Keybindings_ru.md @@ -59,7 +59,7 @@ _Связки клавиш_ | `` `` | Switch | Switch to the selected worktree. | | `` o `` | Open in editor | | | `` d `` | Remove | Remove the selected worktree. This will both delete the worktree's directory, as well as metadata about the worktree in the .git directory. | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Главная панель (Индексирование) @@ -136,7 +136,7 @@ _Связки клавиш_ | `` `` | Open external diff tool (git difftool) | | | `` `` | Просмотреть коммиты | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Коммиты @@ -201,7 +201,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | Просмотреть коммиты | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Меню @@ -209,7 +209,7 @@ If you would instead like to start an interactive rebase from the selected commi |-----|--------|-------------| | `` `` | Выполнить | | | `` `` | Закрыть | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Панель Подтверждения @@ -247,7 +247,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` e `` | Обновить URL подмодуля | | | `` i `` | Initialize | Инициализировать подмодуль | | `` b `` | Просмотреть параметры массового подмодуля | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Сводка коммита @@ -294,7 +294,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | Просмотреть коммиты | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Удалённые ветки @@ -312,7 +312,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` `` | Open external diff tool (git difftool) | | | `` `` | Просмотреть коммиты | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Удалённые репозитории @@ -323,7 +323,7 @@ If you would instead like to start an interactive rebase from the selected commi | `` d `` | Remove | Remove the selected remote. Any local branches tracking a remote branch from the remote will be unaffected. | | `` e `` | Edit | Редактировать удалённый репозитории | | `` f `` | Получить изменения | Получение изменения из удалённого репозитория | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | ## Файлы @@ -366,4 +366,4 @@ If you would instead like to start an interactive rebase from the selected commi | `` r `` | Переименовать хранилище | | | `` `` | Просмотреть файлы выбранного элемента | | | `` w `` | View worktree options | | -| `` / `` | Filter the current view by text | | +| `` / `` | Filter | | diff --git a/pkg/gui/controllers/filter_controller.go b/pkg/gui/controllers/filter_controller.go index 8b049b26cea..635084e441a 100644 --- a/pkg/gui/controllers/filter_controller.go +++ b/pkg/gui/controllers/filter_controller.go @@ -36,9 +36,10 @@ func (self *FilterController) Context() types.Context { func (self *FilterController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { return []*types.Binding{ { - Key: opts.GetKey(opts.Config.Universal.StartSearch), - Handler: self.OpenFilterPrompt, - Description: self.c.Tr.StartFilter, + Key: opts.GetKey(opts.Config.Universal.StartSearch), + Handler: self.OpenFilterPrompt, + Description: self.c.Tr.StartFilter, + DisplayOnScreen: true, }, } } diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index e141a614ccb..07a651747ed 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -1522,7 +1522,7 @@ func EnglishTranslationSet() *TranslationSet { NextScreenMode: "Next screen mode (normal/half/fullscreen)", PrevScreenMode: "Prev screen mode", StartSearch: "Search the current view by text", - StartFilter: "Filter the current view by text", + StartFilter: "Filter", Panel: "Panel", KeybindingsLegend: "Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b", RenameBranch: "Rename branch",