From a8e73cbab09fff47902b416ad7199a7ec7dfe88f Mon Sep 17 00:00:00 2001 From: Palash Debnath <4178343+debpalash@users.noreply.github.com> Date: Fri, 9 Oct 2026 06:30:52 +0000 Subject: [PATCH] Fix platform-specific imports and bounded Ghostty zlib fetch retry --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++ crates/superplexr-desktop/src/app_menu.rs | 18 ++++++++-------- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2834bbc..6723e48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,31 @@ jobs: mkdir "$GHOSTTY_SOURCE_DIR" tar -xzf "$RUNNER_TEMP/ghostty.tar.gz" --strip-components=1 \ --directory "$GHOSTTY_SOURCE_DIR" + - name: Prefetch pinned Ghostty zlib + shell: bash + run: | + # Include zlib's lazy archive, without fetching the whole Ghostty graph + # or running build scripts. Zig verifies the existing manifest hash. + cd "$GHOSTTY_SOURCE_DIR/pkg/zlib" + log=$(mktemp) + trap 'rm -f "$log"' EXIT + for attempt in 1 2 3; do + if zig build --fetch=all --color off >"$log" 2>&1; then + cat "$log" + break + else + status=$? + fi + cat "$log" >&2 + # Retry only the observed transient fetch timeout. Hash mismatches + # and other failures must remain immediately visible and fatal. + if [ "$attempt" -eq 3 ] \ + || ! grep -qE 'error: HTTP response read failure: Timeout$' "$log" \ + || grep 'error:' "$log" | grep -vE 'error: HTTP response read failure: Timeout$' >/dev/null; then + exit "$status" + fi + sleep 5 + done - name: Record toolchain run: | rustc --version diff --git a/crates/superplexr-desktop/src/app_menu.rs b/crates/superplexr-desktop/src/app_menu.rs index d4183ae..b5dcaa2 100644 --- a/crates/superplexr-desktop/src/app_menu.rs +++ b/crates/superplexr-desktop/src/app_menu.rs @@ -4,13 +4,15 @@ use crate::{ AboutSuperplexr, ActivateLastWorkspace, ActivateWorkspace1, ActivateWorkspace2, ActivateWorkspace3, ActivateWorkspace4, ActivateWorkspace5, ActivateWorkspace6, ActivateWorkspace7, ActivateWorkspace8, CloseActiveWorkspace, CopyTerminal, DecreaseAppZoom, - DuplicateWorkspace, HideApplication, HideOtherApplications, IncreaseAppZoom, MinimizeWindow, - NewSession, NewTerminal, NewWorkspace, NextSession, NextWorkspace, OpenGraphInspector, - OpenPluginManager, OpenProviderSettings, PasteTerminal, PreviousSession, PreviousWorkspace, - QuitApplication, ReloadTheme, RenameWorkspace, ResetAppZoom, RestoreClosedWorkspace, - ShowAllApplications, ToggleCommandDeck, ToggleFocusMode, ToggleFullScreen, ToggleSidebar, - ToggleWorkspacePin, UseGraphiteTheme, UsePaperTheme, ZoomWindow, theme::ThemeSelection, + DuplicateWorkspace, IncreaseAppZoom, MinimizeWindow, NewSession, NewTerminal, NewWorkspace, + NextSession, NextWorkspace, OpenGraphInspector, OpenPluginManager, OpenProviderSettings, + PasteTerminal, PreviousSession, PreviousWorkspace, QuitApplication, ReloadTheme, + RenameWorkspace, ResetAppZoom, RestoreClosedWorkspace, ToggleCommandDeck, ToggleFocusMode, + ToggleFullScreen, ToggleSidebar, ToggleWorkspacePin, UseGraphiteTheme, UsePaperTheme, + ZoomWindow, theme::ThemeSelection, }; +#[cfg(target_os = "macos")] +use crate::{HideApplication, HideOtherApplications, ShowAllApplications}; pub(crate) fn native_menus(theme: &ThemeSelection) -> Vec { vec![ @@ -105,7 +107,7 @@ pub(crate) fn native_menus(theme: &ThemeSelection) -> Vec { #[cfg(test)] mod tests { use super::*; - use gpui::{OwnedMenuItem, SystemMenuType}; + use gpui::OwnedMenuItem; #[test] fn native_menu_exposes_the_complete_application_hierarchy() { @@ -141,7 +143,7 @@ mod tests { #[cfg(target_os = "macos")] assert!(app_items.iter().any(|item| matches!( item, - OwnedMenuItem::SystemMenu(menu) if menu.menu_type == SystemMenuType::Services + OwnedMenuItem::SystemMenu(menu) if menu.menu_type == gpui::SystemMenuType::Services ))); let edit_items = &menus[2].items;