@danhachuel/thunderbolt 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +23 -3
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -1303,7 +1303,7 @@ def render_home_update_controls() -> None:
|
|
|
1303
1303
|
""",
|
|
1304
1304
|
unsafe_allow_html=True,
|
|
1305
1305
|
)
|
|
1306
|
-
if st.button("Atualizar Versão", key="home_update_version",
|
|
1306
|
+
if st.button("Atualizar Versão", key="home_update_version", type="primary", icon=":material/system_update:"):
|
|
1307
1307
|
with st.spinner("A instalar a versão mais recente…"):
|
|
1308
1308
|
update_result = update_to_latest(APP_VERSION)
|
|
1309
1309
|
st.session_state["home_update_result"] = update_result
|
|
@@ -7136,12 +7136,29 @@ def main():
|
|
|
7136
7136
|
st.session_state["page"] = target
|
|
7137
7137
|
st.rerun()
|
|
7138
7138
|
|
|
7139
|
+
def is_nav_target_active(target: str) -> bool:
|
|
7140
|
+
"""Return whether a menu target or one of its children is the current page."""
|
|
7141
|
+
if current_page == target:
|
|
7142
|
+
return True
|
|
7143
|
+
return any(child[0] == current_page for child in groups.get(target, []))
|
|
7144
|
+
|
|
7139
7145
|
def render_nav_button(target: str, icon: str, label: str, scope: str):
|
|
7140
7146
|
display_label = ui_text(label, ui_language)
|
|
7141
|
-
if st.button(display_label, key=f"nav_{scope}_{target}", icon=icon, use_container_width=True, type="primary" if
|
|
7147
|
+
if st.button(display_label, key=f"nav_{scope}_{target}", icon=icon, use_container_width=True, type="primary" if is_nav_target_active(target) else "secondary"):
|
|
7142
7148
|
navigate(target)
|
|
7143
7149
|
|
|
7144
7150
|
with st.sidebar:
|
|
7151
|
+
st.markdown(
|
|
7152
|
+
"""
|
|
7153
|
+
<style>
|
|
7154
|
+
section[data-testid="stSidebar"] [data-testid="stExpander"] summary strong {
|
|
7155
|
+
color: #c4b5fd;
|
|
7156
|
+
font-weight: 750;
|
|
7157
|
+
}
|
|
7158
|
+
</style>
|
|
7159
|
+
""",
|
|
7160
|
+
unsafe_allow_html=True,
|
|
7161
|
+
)
|
|
7145
7162
|
version_markup = f'<span class="tb-brand-version">{APP_VERSION_LABEL}</span>' if APP_VERSION_LABEL else ""
|
|
7146
7163
|
st.markdown(f'<div class="tb-brand"><span class="tb-brand-name">Thunderbolt</span>{version_markup}</div>', unsafe_allow_html=True)
|
|
7147
7164
|
for target, icon, label in top_pages:
|
|
@@ -7150,7 +7167,10 @@ def main():
|
|
|
7150
7167
|
render_nav_button(target, icon, label, "top")
|
|
7151
7168
|
continue
|
|
7152
7169
|
child_targets = {item[0] for item in children}
|
|
7153
|
-
|
|
7170
|
+
group_active = is_nav_target_active(target)
|
|
7171
|
+
group_label = f"**{ui_text(label, ui_language)}**" if group_active else ui_text(label, ui_language)
|
|
7172
|
+
group_icon = ":material/radio_button_checked:" if group_active else icon
|
|
7173
|
+
with st.expander(group_label, expanded=current_page in child_targets, icon=group_icon):
|
|
7154
7174
|
for child_target, child_icon, child_label in children:
|
|
7155
7175
|
render_nav_button(child_target, child_icon, child_label, target)
|
|
7156
7176
|
|
package/package.json
CHANGED