Repository navigation
Expand file tree
/
Copy pathroadmap_icons.py
More file actions
178 lines (172 loc) · 6.54 KB
/
Copy pathroadmap_icons.py
File metadata and controls
178 lines (172 loc) · 6.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
from __future__ import annotations
# Every name below is validated against Streamlit's Material Symbols allowlist at:
# https://github.com/streamlit/streamlit/blob/9bfd9f093e42755676bf862d17ba20624bae9670/lib/streamlit/material_icon_names.py
LABEL_ICON_MAP = {
# Areas
"area:accessibility": "accessibility_new",
"area:ai": "smart_toy",
"area:arrow": "swap_horiz",
"area:backend": "dns",
"area:contribution": "diversity_3",
"area:debugging": "bug_report",
"area:dependencies": "account_tree",
"area:deployment": "rocket_launch",
"area:docker": "deployed_code",
"area:elements": "widgets",
"area:events": "bolt",
"area:execution-model": "play_circle",
"area:extensibility": "extension",
"area:frontend": "web",
"area:geospatial": "map",
"area:integrations": "hub",
"area:layout": "dashboard",
"area:localization": "translate",
"area:mobile": "smartphone",
"area:network": "lan",
"area:onboarding": "waving_hand",
"area:performance": "speed",
"area:printing": "print",
"area:protobuf": "data_object",
"area:security": "security",
"area:server": "dns",
"area:styling": "palette",
"area:threading/processing": "memory",
"area:typing": "data_object",
"area:utilities": "construction",
"area:widgets": "toggle_on",
"area:windows": "desktop_windows",
# Cross-cutting features
"feature:app-menu": "menu",
"feature:app-testing": "science",
"feature:authentication": "lock",
"feature:builtin-charts": "bar_chart",
"feature:cache": "cached",
"feature:cache-hash-func": "fingerprint",
"feature:callbacks": "bolt",
"feature:charts": "bar_chart",
"feature:cli": "terminal",
"feature:community-cloud": "cloud",
"feature:config": "settings",
"feature:connections": "cable",
"feature:custom-components": "extension",
"feature:embedding": "iframe",
"feature:file-watcher": "visibility",
"feature:magic": "auto_awesome",
"feature:markdown": "markdown",
"feature:multipage-apps": "tab",
"feature:parallel-fragments": "splitscreen",
"feature:query-params": "link",
"feature:runtime": "memory",
"feature:state": "database",
"feature:static-file-serving": "folder",
"feature:theming": "palette",
"feature:tooltip": "tooltip",
# Streamlit commands and elements
"feature:st.altair_chart": "bar_chart",
"feature:st.audio": "audio_file",
"feature:st.audio_input": "mic",
"feature:st.badge": "sell",
"feature:st.balloons": "celebration",
"feature:st.bokeh_chart": "bar_chart",
"feature:st.button": "smart_button",
"feature:st.camera_input": "photo_camera",
"feature:st.caption": "subtitles",
"feature:st.chat_input": "chat",
"feature:st.chat_message": "chat",
"feature:st.checkbox": "check_box",
"feature:st.code": "code",
"feature:st.color_picker": "palette",
"feature:st.column_config": "table_chart",
"feature:st.columns": "view_column",
"feature:st.container": "dashboard",
"feature:st.context": "language",
"feature:st.data_editor": "edit_note",
"feature:st.dataframe": "table_chart",
"feature:st.date_input": "calendar_month",
"feature:st.datetime_input": "event",
"feature:st.dialog": "dialogs",
"feature:st.divider": "horizontal_rule",
"feature:st.download_button": "download",
"feature:st.echo": "code",
"feature:st.empty": "crop_free",
"feature:st.error": "error",
"feature:st.exception": "bug_report",
"feature:st.expander": "expand_more",
"feature:st.feedback": "thumb_up",
"feature:st.file_uploader": "upload_file",
"feature:st.form": "fact_check",
"feature:st.form_submit_button": "send",
"feature:st.fragment": "splitscreen",
"feature:st.graphviz_chart": "account_tree",
"feature:st.header": "title",
"feature:st.help": "help",
"feature:st.html": "html",
"feature:st.image": "image",
"feature:st.info": "info",
"feature:st.json": "data_object",
"feature:st.latex": "function",
"feature:st.link_button": "open_in_new",
"feature:st.login": "login",
"feature:st.logo": "branding_watermark",
"feature:st.map": "map",
"feature:st.menu_button": "menu",
"feature:st.metric": "monitoring",
"feature:st.multiselect": "checklist",
"feature:st.navigation": "navigation",
"feature:st.number_input": "pin",
"feature:st.page_link": "link",
"feature:st.pdf": "picture_as_pdf",
"feature:st.pills": "view_agenda",
"feature:st.plotly_chart": "bar_chart",
"feature:st.popover": "web_asset",
"feature:st.progress": "progress_activity",
"feature:st.pydeck_chart": "map",
"feature:st.pyplot": "bar_chart",
"feature:st.radio": "radio_button_checked",
"feature:st.rerun": "refresh",
"feature:st.secrets": "key",
"feature:st.segmented_control": "view_week",
"feature:st.select_slider": "tune",
"feature:st.selectbox": "list",
"feature:st.session_state": "database",
"feature:st.set_page_config": "settings",
"feature:st.sidebar": "dock_to_right",
"feature:st.slider": "tune",
"feature:st.snow": "weather_snowy",
"feature:st.spinner": "progress_activity",
"feature:st.status": "pending",
"feature:st.stop": "stop_circle",
"feature:st.success": "check_circle",
"feature:st.switch_page": "swap_horiz",
"feature:st.table": "table_chart",
"feature:st.tabs": "tab",
"feature:st.text": "text_fields",
"feature:st.text_area": "subject",
"feature:st.text_input": "text_fields",
"feature:st.time_input": "schedule",
"feature:st.title": "title",
"feature:st.toast": "notifications",
"feature:st.toggle": "toggle_on",
"feature:st.user": "person",
"feature:st.vega_lite_chart": "bar_chart",
"feature:st.video": "video_file",
"feature:st.warning": "warning",
"feature:st.write": "edit_note",
"feature:st.write_stream": "stream",
}
BUG_LABELS = frozenset({"type:bug", "type:regression"})
DEFAULT_BUG_ICON = "bug_report"
DEFAULT_FEATURE_ICON = "lightbulb"
def icon_for_issue(labels: tuple[str, ...]) -> str:
"""Return a deterministic Material icon directive for an issue's labels."""
normalized_labels = {label.casefold() for label in labels}
for prefix in ("feature:", "area:"):
for label in sorted(normalized_labels):
if label.startswith(prefix) and label in LABEL_ICON_MAP:
return f":material/{LABEL_ICON_MAP[label]}:"
fallback = (
DEFAULT_BUG_ICON
if normalized_labels.intersection(BUG_LABELS)
else DEFAULT_FEATURE_ICON
)
return f":material/{fallback}:"