typeahead: Replace code block language hint text with more clear options

This commit
- Replace the blank option with an italicized option that's the current
   default language, if there is one selected with "default" label.
- Make the "text" option more informative by adding (no highlighting)
   to the label.
- Remove the hint for "text".
- Prioritize as left to right, before start typing:
   blank/default language, text, quote, spoiler, math, everything else...

fixes: #33682
This commit is contained in:
Harsh
2025-04-27 03:20:42 +05:30
committed by Tim Abbott
parent 1dcda2ba9d
commit cfdb80ed48
9 changed files with 93 additions and 32 deletions

View File

@@ -6,6 +6,7 @@ from pygments.lexers import get_all_lexers
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../")
# The current priorities data set is based on StackOverflow's 2020 survey.
# We also prioritize text, quote, math, spoiler over others to enhance UX.
DATA_PATH = os.path.join(ZULIP_PATH, "tools", "setup", "lang.json")
OUT_PATH = os.path.join(ZULIP_PATH, "web", "generated", "pygments_data.json")

View File

@@ -1,5 +1,6 @@
{
"default": {
"text": 31,
"javascript": 27,
"python": 26,
"java": 25,
@@ -30,9 +31,9 @@
},
"custom": {
"latex": 10,
"math": 5,
"quote": 5,
"spoiler": 5
"math": 28,
"quote": 30,
"spoiler": 29
},
"aliases": {
"js": 27,