host: plugins, custom CSS, feature flags, settings and open_panel are host commands
run_app now keeps and serves what every app's panel and page need, with the same caller checks
as the rest (commands::SHELL: shell_only first; testkit::assert_host_guards covers them):
- app.rs: PageState (the plugin store in app data `plugins`, the feature flags, ShellSettings)
managed by the host; commands plugins_list, plugin_set_enabled, plugins_open_folder,
custom_css_get/set, features_get/set, settings_get/set (moved from wayBetter for X). The app
reads the state through app::page(), gets a loaded document's scripts from app::page_scripts()
(flags, links, custom CSS, plugins) and writes through set_features/set_settings/set_custom_css
(a backup import). AppConfig takes the app's PluginHost (AppConfig::new(site, title, plugins))
and an optional home_url. SiteHooks::navigation_started and new_window_mode default to the
owner's link settings.
- settings.rs (pure, tested): ShellSettings { homeUrl, externalLinks, siteLinks, restoreTabs }
with its input form (missing fields take the defaults; `xLinks`, the name wayBetter for X used,
is read as siteLinks), links_script ({ site: mode }), feature validation and features_script.
- commands::SITE + open_panel: a tab on the site's origin asks the shell to open the app's panel
(site_tab_only first). testkit: assert_site_only(command, site) checks that every capability
granting a site command is a tab capability limited to the site's URLs; assert_host_commands and
assert_host_guards include the site commands.
- shell frame backupModel: a settings section that still says xLinks compares as siteLinks.
This commit is contained in:
parent
cecaf93639
commit
205ee82296
7 changed files with 529 additions and 36 deletions
|
|
@ -11,6 +11,8 @@ pub const EVENT_TAB_OPEN: &str = "tab-open";
|
|||
pub const EVENT_TAB_SHORTCUT: &str = "tab-shortcut";
|
||||
pub const EVENT_LINK_DRAG: &str = "link-drag";
|
||||
pub const EVENT_PROFILES_CHANGED: &str = "profiles-changed";
|
||||
/// A site tab asks the shell to open the app's panel (`{ from, section }`).
|
||||
pub const EVENT_OPEN_PANEL: &str = "open-panel";
|
||||
|
||||
/// One pane as the shell lays it out (`tabs_sync`).
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue