@danhachuel/thunderbolt 0.4.6 → 0.4.7
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 +2 -22
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -7136,29 +7136,12 @@ 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
|
-
|
|
7145
7139
|
def render_nav_button(target: str, icon: str, label: str, scope: str):
|
|
7146
7140
|
display_label = ui_text(label, ui_language)
|
|
7147
|
-
if st.button(display_label, key=f"nav_{scope}_{target}", icon=icon, use_container_width=True, type="primary" if
|
|
7141
|
+
if st.button(display_label, key=f"nav_{scope}_{target}", icon=icon, use_container_width=True, type="primary" if current_page == target else "secondary"):
|
|
7148
7142
|
navigate(target)
|
|
7149
7143
|
|
|
7150
7144
|
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
|
-
)
|
|
7162
7145
|
version_markup = f'<span class="tb-brand-version">{APP_VERSION_LABEL}</span>' if APP_VERSION_LABEL else ""
|
|
7163
7146
|
st.markdown(f'<div class="tb-brand"><span class="tb-brand-name">Thunderbolt</span>{version_markup}</div>', unsafe_allow_html=True)
|
|
7164
7147
|
for target, icon, label in top_pages:
|
|
@@ -7167,10 +7150,7 @@ def main():
|
|
|
7167
7150
|
render_nav_button(target, icon, label, "top")
|
|
7168
7151
|
continue
|
|
7169
7152
|
child_targets = {item[0] for item in children}
|
|
7170
|
-
|
|
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):
|
|
7153
|
+
with st.expander(ui_text(label, ui_language), expanded=current_page in child_targets, icon=icon):
|
|
7174
7154
|
for child_target, child_icon, child_label in children:
|
|
7175
7155
|
render_nav_button(child_target, child_icon, child_label, target)
|
|
7176
7156
|
|
package/package.json
CHANGED