Skip to main content

Module app

Module app 

Source
Expand description

geop app [DIR | program.geop]: the web editor in a window of its own, editing the files of the folder DIR on the kernel of this process.

It is geop open (see crate::open) without the browser: the same page, served by the same server on 127.0.0.1, shown in the system’s webview (WebKitGTK, WKWebView, WebView2, through wry and tao) with no browser chrome around it. Everything the editor does is the page’s, so it behaves as the web app does; what the window adds is only what a browser tab cannot do:

  • its title is the page’s, which names the program edited and the folder (backend.local.ts);
  • a folder to edit is asked for in the system’s dialog, when none is given and from the page’s File menu (“Open folder…”, which starts another geop app); a file chosen “from disk” is chosen in the system’s dialog, which the webview shows for the page’s file inputs;
  • a file the page downloads (Save, an export) is saved where the system’s save dialog says;
  • a link out of the page opens in the default browser;
  • its size is kept from one run to the next (WindowState);
  • one app edits a folder: a second geop app of the same folder brings the first to the front and ends (Claim).

What needs no window — how one app finds the one already editing its folder, what it keeps between runs — is built in every geop, and the tests drive the app’s server (crate::open::Serving) without one; the window needs the feature app.

Structs§

AppArgs
Claim
This app’s claim on its folder: the port and token another geop app of the folder raises it with (POST /api/raise). Readable by the user alone, since the token opens the folder’s files; given up when the app ends (Claim::release).
WindowState
The window’s size as the last app left it, in logical pixels.

Functions§

claim_file 🔒
Where the app editing root says how to reach it: a file per folder, named by a digest of its canonical path, in the user’s runtime folder.
config_dir 🔒
The folder geop keeps its settings in: the platform’s for each user.
default_folder 🔒
The folder to open with none asked for: the one edited last, while it is there; else Geop in the user’s Documents, made if it has to be. A person who has only clicked on an icon has nothing to answer yet, and their parts are somewhere they will find them.
desktop_args
The arguments of the program a person double-clicks (the feature desktop): it is the app, whatever it is given. A file dropped on it is the path to open; app ... is what the app’s “Open folder…” starts it with. An old macOS adds a -psn_... of its own.
is_for_browser 🔒
Whether url is one for the browser: a page on the web or a mail.
is_page 🔒
The page’s own address: what it may navigate to in the window. Any other is a link out of it, for the browser.
keep_last_folder 🔒
Keep folder as the one to open next time; a failure only loses it.
last_folder_file 🔒
The file the last folder edited is kept in.
raise_running
Bring the app editing root to the front, if one is: whether one was. A claim whose app is gone (it crashed, or was killed) is no app.
run