Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce help context #1484

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
de8d7a6
ui: Make the Help hotkey suggestion in the footer more conventional.
Niloth-p Jul 10, 2024
9fccce3
refactor: ui/core/boxes: Separate out function to reset footer text.
Niloth-p Jul 15, 2024
13410a2
refactor: ui/core: Separate footer events from set_footer_text().
Niloth-p Jul 15, 2024
b9b5ee8
ui: Add state variable to track live footer events.
Niloth-p Jul 15, 2024
af00b47
lint-hotkeys: Handle the doc file does not exist exception.
Niloth-p Jul 15, 2024
d2e0c17
refactor: lint-hotkeys: Remove the write_hotkeys_file() function.
Niloth-p Jul 15, 2024
4e8783c
refactor: lint-hotkeys: Make int error flag boolean & use SystemExit.
Niloth-p Jul 15, 2024
e954870
lint-hotkeys: Rewrite function docstrings and comments.
Niloth-p Jul 15, 2024
4ed23c7
refactor: lint-hotkeys: Rename get_hotkeys_file_string().
Niloth-p Jul 15, 2024
9717776
refactor: lint-hotkeys: Rename ambiguous keyword "action" to "batch".
Niloth-p Jul 15, 2024
11a7ead
refactor: lint-hotkeys: Improve variable naming of generated dict.
Niloth-p Jul 17, 2024
3237251
lint-hotkeys: Refactor the flow by creating new ENTRY_BY_CATEGORIES.
Niloth-p Jul 15, 2024
188bd7f
lint-hotkeys: Delay generation of file string when linting.
Niloth-p Jul 17, 2024
0dd8aa4
refactor: lint-hotkeys: Split out the help text linting function.
Niloth-p Jul 17, 2024
5286488
refactor: lint-hotkeys: Split out the function that lints categories.
Niloth-p Jul 17, 2024
4e7a4f2
lint-hotkeys: Restructure the error messages of lint_help_text().
Niloth-p Jul 17, 2024
efc8f82
lint-hotkeys: Lint for typos in key_category values.
Niloth-p Jul 17, 2024
ac8e715
refactor: lint-hotkeys: Use help_group instead of HELP_CATEGORIES.
Niloth-p Jul 17, 2024
58ec337
refactor: lint-hotkeys: Create generic variable entries_by_group.
Niloth-p Jul 17, 2024
3ce52db
refactor: lint-hotkeys: Create generic variables for key_category.
Niloth-p Jul 17, 2024
4911685
refactor: lint-hotkeys: Replace 'category(ies)' with 'group(s)'.
Niloth-p Jul 17, 2024
b35e0ce
refactor: lint-hotkeys: Delete constant OUTPUT_FILE_NAME, compute it.
Niloth-p Jul 17, 2024
001814b
refactor: lint-hotkeys: Replace usage of OUTPUT_FILE.
Niloth-p Jul 17, 2024
e2c7e57
refactor: lint-hotkeys: Generalize the traversal of key group values.
Niloth-p Jul 17, 2024
f908dc6
refactor: lint-hotkeys: Use bundled group values.
Niloth-p Jul 18, 2024
f5d0bc4
keys: Add a contexts field to Key Binding.
Niloth-p Jul 8, 2024
a8dd4de
lint-hotkeys: Add argument to generate a keys file grouped by contexts.
Niloth-p Jul 18, 2024
a76da7f
keys: Use the help contexts in generating random help tips.
Niloth-p Jul 8, 2024
9c48eb7
keys: Include previously excluded random help hints.
Niloth-p Apr 16, 2024
2e1b0f0
ui: Enable footer texts to display contextual help tips.
Niloth-p Jul 16, 2024
1b6ad6b
ui/keys: Display the context of the footer hint.
Niloth-p Jul 10, 2024
f75a309
contexts/core/ui: Track the currently focused widget in the UI.
Niloth-p Jul 11, 2024
58b1a96
core/ui/views/keys: Add a Contextual Help Menu.
Niloth-p Jul 10, 2024
3513d73
keys/views: Add mapping of contexts to broader contexts they belong to.
Niloth-p Jul 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions zulipterminal/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ def get_random_help(self) -> List[Any]:
# Get random allowed hotkey (ie. eligible for being displayed as a tip)
allowed_commands = commands_for_random_tips()
if not allowed_commands:
return ["Help(?): "]
return ["Help[?] "]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideas on how we can further highlight the differentation of the Help and its hotkey from the random hint are welcome.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest a space in the first instance? Then it'd be similar to eg. the Search [<key>] formatting we have right now. My other concern when running it is that we end up with

Help[?]  OTHERKEY, KEY  HELP TEXT FOR HINT

In that, the hint looks as close to the hint description as to the help hint, so we could add an extra space?

However, without that latter extra space, I'd still consider it an improvement, since the : is confusing by suggesting the Help is the hint, I think?

In the longer-term I mentioned highlighting hotkeys consistently, which might help here, but that's beyond the remit of this commit I think :)

random_command = random.choice(allowed_commands)
random_command_display_keys = ", ".join(
[display_key_for_urwid_key(key) for key in random_command["keys"]]
)
return [
"Help(?): ",
"Help[?] ",
Comment on lines -113 to +115
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this method, it would be useful to refactor this common text at the same time?

("footer_contrast", f" {random_command_display_keys} "),
f" {random_command['help_text']}",
]
Expand Down