@danhachuel/thunderbolt 0.4.0 → 0.4.2

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.
Files changed (2) hide show
  1. package/app/main.py +48 -14
  2. package/package.json +1 -1
package/app/main.py CHANGED
@@ -1281,9 +1281,9 @@ def render_channel_edit_form(channel: dict, youtube_account_ids: list[str], yout
1281
1281
  st.rerun()
1282
1282
 
1283
1283
 
1284
- def render_dashboard():
1285
- ui_language = current_ui_language()
1286
- update_area, version_area = st.columns([1.45, 4.55])
1284
+ def render_home_update_controls() -> None:
1285
+ """Render the update controls only on the home page and keep notices dismissible."""
1286
+ update_area, version_area, _ = st.columns([1.45, 2.55, 3.0])
1287
1287
  with update_area:
1288
1288
  st.markdown(
1289
1289
  """
@@ -1306,6 +1306,8 @@ def render_dashboard():
1306
1306
  if st.button("Atualizar Versão", key="home_update_version", use_container_width=True, type="primary", icon=":material/system_update:"):
1307
1307
  with st.spinner("A instalar a versão mais recente…"):
1308
1308
  st.session_state["home_update_result"] = update_to_latest(APP_VERSION)
1309
+ st.session_state["home_update_notice_dismissed"] = False
1310
+ st.rerun()
1309
1311
  with version_area:
1310
1312
  cache_key = "home_update_version_check"
1311
1313
  checked_at_key = "home_update_version_checked_at"
@@ -1313,18 +1315,48 @@ def render_dashboard():
1313
1315
  st.session_state[cache_key] = check_version(APP_VERSION)
1314
1316
  st.session_state[checked_at_key] = time.monotonic()
1315
1317
  version_status = st.session_state[cache_key]
1318
+ notice_signature = f"{version_status.latest_version}|{version_status.update_available}|{version_status.error}"
1319
+ if st.session_state.get("home_update_notice_signature") != notice_signature:
1320
+ st.session_state["home_update_notice_signature"] = notice_signature
1321
+ st.session_state["home_update_notice_dismissed"] = False
1316
1322
  if version_status.update_available:
1317
- st.info(f"Nova versão disponível: {display_version(version_status.latest_version)}. A versão actual é {APP_VERSION_LABEL or 'desconhecida'}.")
1323
+ notice_message = f"Nova versão disponível: {display_version(version_status.latest_version)}. A versão actual é {APP_VERSION_LABEL or 'desconhecida'}."
1324
+ notice_kind = "info"
1318
1325
  elif version_status.error:
1319
- st.caption(f"Versão actual: {APP_VERSION_LABEL or 'desconhecida'} · verificação de actualização indisponível.")
1326
+ notice_message = f"Versão actual: {APP_VERSION_LABEL or 'desconhecida'} · verificação de actualização indisponível."
1327
+ notice_kind = "caption"
1320
1328
  else:
1321
- st.caption(f"Versão actual: {APP_VERSION_LABEL or 'desconhecida'} · já está actualizada ({display_version(version_status.latest_version)}).")
1329
+ notice_message = f"Versão actual: {APP_VERSION_LABEL or 'desconhecida'} · já está actualizada ({display_version(version_status.latest_version)})."
1330
+ notice_kind = "success"
1331
+ if not st.session_state.get("home_update_notice_dismissed"):
1332
+ notice_col, close_col = st.columns([8.5, 1])
1333
+ with notice_col:
1334
+ if notice_kind == "info":
1335
+ st.info(notice_message)
1336
+ elif notice_kind == "success":
1337
+ st.success(notice_message)
1338
+ else:
1339
+ st.caption(notice_message)
1340
+ with close_col:
1341
+ if st.button("×", key="home_update_notice_close", help="Fechar este aviso"):
1342
+ st.session_state["home_update_notice_dismissed"] = True
1343
+ st.rerun()
1322
1344
  update_result = st.session_state.get("home_update_result")
1323
- if update_result is not None:
1324
- if update_result.ok:
1325
- st.success(update_result.message)
1326
- else:
1327
- st.error(update_result.message)
1345
+ if update_result is not None and not st.session_state.get("home_update_notice_dismissed"):
1346
+ result_col, result_close_col = st.columns([8.5, 1])
1347
+ with result_col:
1348
+ if update_result.ok:
1349
+ st.success(update_result.message)
1350
+ else:
1351
+ st.error(update_result.message)
1352
+ with result_close_col:
1353
+ if st.button("×", key="home_update_result_close", help="Fechar este resultado"):
1354
+ st.session_state["home_update_notice_dismissed"] = True
1355
+ st.rerun()
1356
+
1357
+
1358
+ def render_dashboard():
1359
+ ui_language = current_ui_language()
1328
1360
  st.title("Thunderbolt")
1329
1361
  st.caption(ui_text("Interface local para operação e automação de conteúdo faceless", ui_language))
1330
1362
  summary = pipeline_summary()
@@ -2739,7 +2771,7 @@ def render_music_creation():
2739
2771
 
2740
2772
  def render_custom_music_voices() -> None:
2741
2773
  """Reserved view for future reusable custom music-voice blueprints."""
2742
- st.title("Vozes Personalizadas, Funcionará como um Blueprint")
2774
+ st.title("Vozes Personalizadas")
2743
2775
 
2744
2776
 
2745
2777
  def render_scripts():
@@ -6999,7 +7031,7 @@ def main():
6999
7031
  music_items = [
7000
7032
  ("Criação de Músicas", ":material/music_note:", "Criação de Músicas"),
7001
7033
  ("Music Backlog", ":material/queue_music:", "Music Backlog"),
7002
- ("Vozes Personalizadas, Funcionará como um Blueprint", ":material/record_voice_over:", "Vozes Personalizadas, Funcionará como um Blueprint"),
7034
+ ("Vozes Personalizadas", ":material/record_voice_over:", "Vozes Personalizadas"),
7003
7035
  ("Upload Música", ":material/library_music:", "Upload Música"),
7004
7036
  ]
7005
7037
  models_ai_items = [
@@ -7092,6 +7124,8 @@ def main():
7092
7124
  current_page = "Início"
7093
7125
  st.session_state["page"] = current_page
7094
7126
  ui_language = current_ui_language()
7127
+ if current_page == "Início":
7128
+ render_home_update_controls()
7095
7129
  render_ui_language_picker(ui_language)
7096
7130
 
7097
7131
  def navigate(target: str):
@@ -7123,7 +7157,7 @@ def main():
7123
7157
  "Backlog Vídeos": render_videos,
7124
7158
  "Criação de Músicas": render_music_creation,
7125
7159
  "Music Backlog": render_music_backlog,
7126
- "Vozes Personalizadas, Funcionará como um Blueprint": render_custom_music_voices,
7160
+ "Vozes Personalizadas": render_custom_music_voices,
7127
7161
  "Upload Música": render_music_upload,
7128
7162
  "Roteiros": render_scripts,
7129
7163
  "Thumbnails": render_thumbnails,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",