Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/zephium-app/src/actor/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ fn scoped_launcher_actions_cross_the_real_operation_admission_boundary() {
action: action.clone(),
background: false,
replace: None,
new_mini: false,
}
));
let Command::Operation { command, .. } = queue.try_recv().unwrap() else {
Expand Down
50 changes: 50 additions & 0 deletions crates/zephium-app/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ pub trait PresentationChrome: GeometryChrome {
presentation: ChromePresentation,
done: ChromePresentationCallback,
) -> ChromePresentationDispatch;

/// The same barrier for the page of a mini window, whose own toolbar
/// must show the exact page before it may appear.
fn apply_mini_presentation(
&self,
_window: zephium_core::ids::WindowId,
_presentation: ChromePresentation,
_done: ChromePresentationCallback,
) -> ChromePresentationDispatch {
ChromePresentationDispatch::Rejected
}
}

/// Terminal result of the ordered application shutdown protocol.
Expand Down Expand Up @@ -251,6 +262,24 @@ pub enum SpaceCommand {
MoveActive(zephium_core::ids::SpaceId),
}

/// Something the toolbar of a mini window asks of its page.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MiniAction {
Back,
Forward,
Reload,
/// Moves the page into the main window as a tab and closes the window.
OpenInMain,
/// The same, into the space the person picked.
OpenInSpace(zephium_core::ids::SpaceId),
Close,
/// Keeps the window above other applications' windows, or stops; `None`
/// turns it the other way.
KeepOnTop(Option<bool>),
/// The native window could not be built, so the page opens as a tab.
Unbuilt,
}

/// What the person chose for a page's request to open another application
/// or a blocked new tab.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -671,6 +700,9 @@ pub enum Command {
SearchScoped {
query: String,
context: Box<zephium_ipc::SearchContext>,
/// The launcher is choosing a page for a mini window, so it offers
/// only sites, and an open tab's site rather than the tab.
mini: bool,
},
CancelSearch {
session_id: String,
Expand All @@ -687,6 +719,9 @@ pub enum Command {
/// The tab whose address the launcher was opened to edit: an address
/// chosen there replaces that tab's page while it is still in front.
replace: Option<String>,
/// The launcher was opened for a new mini window: an address chosen
/// there opens in one, unless the main window shows a private session.
new_mini: bool,
},
OpenUrl {
input: String,
Expand All @@ -698,6 +733,21 @@ pub enum Command {
/// `navigation::external_target`. Each opens in a new tab; any that
/// arrive before the session is restored wait for it.
OpenExternal(Vec<String>),
/// The desktop built the native window for a mini window the shell
/// opened, and the engine took its handle.
MiniAttached {
window: zephium_core::ids::WindowId,
size: Size,
},
MiniResized {
window: zephium_core::ids::WindowId,
size: Size,
},
/// Something a mini window's toolbar, keys or native window asked of it.
Mini {
window: zephium_core::ids::WindowId,
action: MiniAction,
},
SetAppSetting {
key: String,
value: String,
Expand Down
7 changes: 5 additions & 2 deletions crates/zephium-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub use api::AgentLifecycle;
pub use api::{AppProxyAttachment, AppProxyReport};
pub use api::{
BrowserPage, ChromePresentation, ChromePresentationCallback, ChromePresentationDispatch,
Command, ContentPolicyStatusQueryOutcome, EmitFn, PagePermissionPromptDecision,
Command, ContentPolicyStatusQueryOutcome, EmitFn, MiniAction, PagePermissionPromptDecision,
PageRequestDecision, PresentationChrome, SharedBlocker, SharedChrome, SharedEngine,
SharedStore, ShellTerminalFailure, ShellTerminalFailureCallback, ShutdownOutcome, TabMetadata,
WorkPaneTarget,
Expand All @@ -97,7 +97,10 @@ pub use lookup::{NoteMatch, TaskMatch};
pub use onboarding::{finish_onboarding, onboarding_due};
#[cfg(feature = "work-planning")]
pub mod work_context;
pub use shell::{Shell, WebExtensionStatus, WebExtensionTarget};
pub use shell::{
admitted_mini_size, Shell, WebExtensionStatus, WebExtensionTarget, MAX_MINI_WINDOWS,
MINI_PAGE_INSET, MINI_TOOLBAR_HEIGHT, MINI_WINDOW_MIN_SIZE, MINI_WINDOW_SIZE,
};

#[doc(hidden)]
pub use store_reads::{ImportWork, ImportedSite, StoreReadResult};
Expand Down
Loading
Loading