Repository navigation
Rework how vfox+ presents vfox: fixes, plugin profiles, environments and navigation - #79
linghengqian wants to merge 30 commits into
Conversation
vfox doctor exits with 1 when a finding is an error, with the report on standard output all the same. The application took any other exit code than 0 for a failure, and it runs vfox outside of an activated shell on purpose, which vfox 1.1.0 reports as the error path.not-activated: the health check of the home page failed with the real vfox, showing "}" as its message. Read the report whether vfox exits with 0 or 1, and leave out what it finds about the process that asks. The captures gain the answer of vfox outside of an activated shell, the fake vfox gives it, and the end-to-end test against the real vfox checks the home page for it.
The home page of every interface said to add the Bash line to ~/.bashrc, also on Windows. It now offers the shells of the machine that runs vfox (Bash, Zsh, fish, PowerShell, Nushell and Clink), the person's own first, with what to do for the chosen one. The inventory of the remote API carries them to the web interface and the phone app. In the web interface, also: draw the settings icon while the settings are open; use the menu icon for the rail and move its add button to the top; name each page once, and say so when the page reconnects instead of showing a status dot; leave a gap between the items of segmented lists; and give plugins the avatars of the desktop, shapes of the Material library picked by the same hash.
The desktop showed every value at its target at once, whatever the platform asked. Its springs now move by default, and a new Animation setting chooses between following the system, moving even when the system asks for less motion, and not moving. Page transitions stay off: their layers cost memory. Dialogs and menus grow in under the full setting too, on a value of their own, as mygo takes poses to their target at once while the system asks for less motion. The springs take about 9 MB more memory on the list of versions (docs/en/dev/memory.md).
Memory use at
|
| Implementation | Technology | Processes | Home PSS | Home RSS | Versions PSS | Versions RSS | The list adds (PSS) |
|---|---|---|---|---|---|---|---|
| mygo | mygo 0.9.0, Go 1.27.4, GTK 3 (purego), CPU renderer | 1 | 50 (+2) | 63 | 55 (+3) | 70 | +5 |
In MB, for the application and all of its child processes, sorted by the PSS of the Home page; "Versions" is the SDKs page with the available versions of Node.js listed. A number in parentheses is the difference from main, in bold when it is more than the noise of CI. "(main)" marks an implementation that this pull request did not rebuild: its numbers are those of main.
Lightweight mode
What the application uses with the web interface on and its window closed, with the fake vfox, in MB for the application and all of its child processes: lightweight-idle is settled with no browser, lightweight-loaded with a paired browser past its first inventory over server-sent events (vfxtool measure-lightweight). A change is judged by the private memory, the heap and the stacks, and only by a difference of more than the larger of 2 MB and 5 % of main. The resident and the proportional memory include the pages of files that the system takes back, so they are shown without a judgement.
| Measure | This pull request | Main |
|---|---|---|
| Idle RSS | 50 MB (+2) | 48 MB |
| Idle PSS | 37 MB (+2) | 35 MB |
| Idle private memory | 14.9 MB (+0.8) | 14.0 MB |
| Loaded RSS | 52 MB (+2) | 50 MB |
| Loaded PSS | 39 MB (+2) | 37 MB |
| Loaded private memory | 15.0 MB (+0.8) | 14.2 MB |
Phone app
What the release APK uses cold-started on an emulator, in MB from dumpsys meminfo after settling: apk-cold. Emulator boots vary, so only differences of more than 5 MB and 10% count as changes.
| Measure | This pull request | Main |
|---|---|---|
| Cold RSS | 142 MB (main) | 142 MB |
| Cold PSS | 48 MB (main) | 48 MB |
Details
- Measured by
vfxtool measurein the workflow of the implementation, on a GitHub-hosted runner with Xvfb and no GPU. These are not the numbers ofdocs/en/dev/memory.md, which come from another machine: compare the rows of one comment. - The same code does not use the same memory in every CI run, so a difference counts as a change only when it is more than 5 MB and more than 5% of the number on main.
- Runs of this pull request: mygo.
- Latest runs on main: mygo (
29ebaf0).
The window listens to what the pages show and asks for a frame when it changes, but not to the health check. A check that ended after everything else had loaded left the home page saying that it was still checking until something else drew a frame. The end-to-end test against the real vfox showed it in the sandbox of CI.
The floating label of a text field changed its font size in every frame of its spring, 25 sizes in one move. The libraries that draw text, and the glyph atlas of the toolkit, keep what each size needs: after a few dialogs with a field the application held about 8 MB more of C memory and 4 MB more of Go heap. The label now moves in its two sizes, drawn at the larger one and scaled in between. The application also frees what drawing grew the Go heap by, two seconds after the last frame. Under Xvfb, after five dialogs and every page, the application takes 63 MB of PSS with motion, where it took 76 MB, and 62 MB without motion.
measure-apk fails when the log of the device shows a crash, and took every error of the Android runtime for one of the app. uiautomator, which reads the screens for the tool, fails now and then on the emulator of CI with a timeout while it connects, and its crash failed the run. Errors of its processes are left out now.
What the application knows about particular plugins was Go code, so adapting a plugin, or a new release of one, needed a release of the application. The profiles of the 20 plugins are now JSON files (shared/profile/plugins, with a schema), whose format 2 adds parts for some platforms, version names read by regular expressions, filters that match a pattern, and switch and text variables. For an installed plugin, each section of a profile comes from the first of the user's files, the profile that the plugin ships as lib/vfox-plus.json, the online directory (this repository's main, at most once a day, checked by SHA-256), the files of the application, and inference. A profile may not set variables that change what runs, its links and preset addresses are https only, and the interfaces ask before they set a value that the application did not ship. Detect and link is offered only for plugins that can detect. vfxtool profile lints profiles, for plugin repositories through a reusable workflow too, and indexes the online directory. A setting inferred from a plugin that takes text can be set now, and the filters inferred for a profile that declares none filter the list.
The format of the profile files, where they come from and what they may not do, in English and Simplified Chinese, with the changes of the web API, the interface specification and the user guide.
vfox-plus now manages vfox in each environment on its own: the computer, every distribution of WSL and every development container that Docker has, on the computer or in a running distribution (core/env). Looking for them changes nothing; only Start starts one, and a distribution that the person started stays started, although WSL stops idle ones. Commands run through a shell wrapper that keeps values off command lines and ends them on cancel. A vfox older than 1.1.0 is read only. Each environment has its own settings and task lane; the remote API gains /api/environments and routes per environment, and the desktop, the web interface and the phone app switch between them. The Windows application is a program of the window subsystem now, and opens no console window for the programs that it runs. CI runs the real vfox in development containers and in a distribution of WSL.
A project is a folder whose .vfox.toml names the versions that it uses: vfox+ reads it with the TOML library that vfox uses, asks vfox which versions it puts in effect there, and installs the missing ones. Installed versions carry what vfox lists about them (links, copies and aliases), and the SDKs that a plugin finds on the machine can be listed without linking them.
/api/projects lists the projects of an environment with what vfox says of each, adds those that the computer suggests and forgets them, and /api/projects/install installs what is missing. The browser can use a version in a listed project, and /api/sdks/<name>/detect lists the SDKs that a plugin finds on the computer.
…ainer The browser and the phone add plugins through a call that reads no file, and name a project only to pick one that the application holds, whose own path it then uses. Docker prints what it pulls beside the id of a new container, which the integration test read as the id.
The navigation has four destinations. The overview says what runs, what needs attention and what is in use; the projects show what each .vfox.toml asks for and put the missing versions right; the toolchain lists the plugins, whose button adds a version to download, one found on the machine or one by name, and holds the registry. The tasks are reached from a dock under the other pages and from the overview. Rows that hold buttons are list items that can be pressed, so that assistive technology reaches the buttons.
The end-to-end scenarios, the screenshots and the memory measure follow the pages of the desktop, and both scenarios of vfox check a project: the real one installs what a project misses. The fake vfox answers current in a folder that has a .vfox.toml.
The interface, the task dock, the routes and events of the projects, what vfox says of a project and finds on its machine, and the TOML parser that reads a .vfox.toml.
The Install button of the registry sends the name of the plugin as the source of the add operation, which was refused as not a URL, so that no plugin of the registry could be added from the web interface or the phone app. A name that the registry lists is added with `vfox add <name>` now; any other source still has to be a URL.
The web and phone interfaces read the inventory again on every change that they are told of, and each read loaded a list that had failed again, which told them of a change: a vfox that could not list its plugins, offline for instance, was run without end. A failure younger than three seconds stays.
The web interface has four destinations now: an overview of what goes on and needs attention, the projects of the environment with the versions that their .vfox.toml asks for, the toolchain with the installed plugins, and the settings. The versions to download and the plugin registry are pages of the toolchain, installs that a plugin finds on the computer can be linked, and a dock at the bottom of the pages says what runs and leads to the list of the tasks. The earlier addresses lead where their pages went. The pages are drawn with lit-html, which puts every value of the computer and of vfox into the page as text, and keeps the elements that stay. Pages change with the View Transitions API on the spring curves, with a plain animation where a browser lacks it and none for a person who asks for less motion. webheap opens the new pages with -tab, and its scenes click the new page.
The refresh button of the projects answered with what vfox had said before, so that a .vfox.toml changed by hand did not show until a task ran. The protocol also documents adding a plugin of the registry by its name and the pause before a failed list is read again.
The client of the phone lists the projects of an environment, adds those that the computer suggests, forgets them and installs what they miss, lists the SDKs that a plugin finds on the computer, uses a version in a listed project, reads what vfox says of installed versions besides their names, and learns of changes of the projects from the events.
The page of an SDK on the phone has "Add version" as its main action, a split button filled with the primary colour as on the desktop.
A snack bar keeps above the navigation bar of a narrow window only, so it lies over the dock of the tasks that the phone shows at the bottom of its pages. A window can now say how much room it keeps there.
The bar of the tabs has the overview, the projects, the toolchain and the settings. The overview shows what runs, what needs the person (projects that miss versions and the health check), the versions in use, the card of the shell and the last tasks. The projects tab lists the projects and the folders of development containers, and the page of a project installs what it misses, uses an installed version and adds a tool. The toolchain lists the plugins and opens the registry as a page. The page of an SDK has the button "Add version", which opens the versions to download as a page and offers to link one on the computer or install one by name, its versions say how they are used and what they are, and a plugin without a version lists what it finds on the computer. A dock at the bottom of the pages says what runs and the failures that were not seen, and opens the list of tasks, which is a page now, so starting a task no longer moves to another page.
The tool visits the four tabs, opens the page of an SDK from the toolchain and updates its plugin, opens the registry and the dialog that adds a plugin, takes the overview in the dark theme, and opens the list of tasks from the overview, swiping the page up to its button. What is scrolled above the screen has negative bounds in the accessibility tree, which the tool now reads. The dark picture of the home page is now android-dark-overview, and the pictures of the tabs are android-overview, android-projects, android-toolchain and android-settings.
A computer with an older vfox+ has no projects to add one to, so the projects tab shows no button for it while it cannot read them. A test checks that the room of the snack bars above the dock does not keep the window drawing.
The message of a whole view scrolls at large text sizes, as the room above the dock does not hold it, and the buttons of the header of a project go under its name before the name is broken. A project that cannot be read says so, and removing one from the list has a cross and no danger colour, as its files stay. A test draws the pages as a phone shows them, under the bar of the system.
A task that works in the folder of a project says it, so that the web and phone pages show the use of a version in the project that asked for it. The projects are being read, not without a .vfox.toml, while vfox is probed. The phone's refresh has the computer read the files again, and the answer of a change of its settings stays with the environment that it was made in.
A rework of how vfox+ presents vfox, all in this one pull request. It fixes what is broken with the real vfox 1.1.0, brings back the motion of the desktop, turns what vfox+ knows about particular plugins into data, manages vfox in every environment (the computer, the distributions of WSL and development containers), and arranges the three interfaces around what vfox 1.1 can do: projects, the toolchain and the work that runs. More commits follow: a view of the work as a pipeline and a map.
Fixes and motion
doctorfinds an error, with the report on standard output, and it always findspath.not-activatedfor a caller outside of an activated shell, as the application is. The home page therefore showed a failed check whose message was}. The report is now read, and what vfox finds about the process that asks is left out. The captures, the fake vfox and the end-to-end test against the real vfox cover it.~/.bashrc, on Windows too. It now offers Bash, Zsh, fish, PowerShell, Nushell or Clink, as the system of the machine that runs vfox has them, the person's own first. The inventory of the remote API carries them to the web interface and the phone app (vfox.activations).mygo/gatewaykeeps them in step).measure-apktook a crash ofuiautomator, which reads the screens for it, as one of the app's, and failed the phone job.NonMotionand grows dialogs on a value of their own.Plugin profiles
Adapting a plugin, or a new release of one, needs no release of the application any more.
shared/profile/plugins, with a JSON Schema. Format 2 adds parts for some platforms (when), version names read by regular expressions instead of two hard-coded namings, filters that match a pattern, andtoggleandtextvariables.docs/en/dev/profiles.mddescribes it.profiles/<plugin>.json; the plugin's ownlib/vfox-plus.json(vfox packslib, so it arrives with the plugin and works offline); the online directory (shared/profileon this repository's main: fetched at most once a day, through the update mirror, only the files that differ, each checked by SHA-256); the files the application ships; and inference. The unusedFetchProfileand the rootvfox-plus.json, which no packaged plugin could carry, are gone.PATH,HOME,LD_*,NODE_OPTIONS, compilers, proxies, tokens, …); documentation links and preset addresses arehttps://; and a value that the application did not ship is shown and confirmed before it is set, on the desktop, the web interface and the phone app.togglevariables, a text field fortextones; "Detect and link" is hidden for a plugin whose files show it has no Detect hook.vfxtool profile lint(with--pluginfor the profile of a plugin, and a reusable workflow,profile-lint.yml, for plugin repositories) andvfxtool profile index.Compatibility
profile.naming, which no client used, and addscapabilities,unvetted,onandoff. Older phone apps keep working; a newer one takes a missingcapabilitiesas able to detect.namingstring, a search without a default) comes from the next source instead.shared/profile/index.jsonfrom main at most once a day, as it already asks GitHub for its latest release at startup. Until this lands, main has no such file, and the request fails without effect. The end-to-end build does not use the network for it.Environments
vfox+ manages vfox in each environment on its own: the computer, every distribution of WSL (on Windows) and every development container of Docker, of the computer or of a running distribution (environments).
wsl.exe --execordocker exec, with a fixedshwrapper that passes the arguments on as they are, takes variables from standard input (no secrets on command lines) and ends commands inside the environment on cancel (neither program forwards signals). Plugin files and profiles are read through the same layer./api/environments,…/refresh,…/<id>/startand every vfox route under/api/environments/<id>/; the old routes stay the computer's. Events name the environment.CREATE_NO_WINDOW; it used to open a console window beside its own.Navigation around vfox 1.1
The desktop, the web interface and the phone app have the same four destinations, Overview, Projects, Toolchain and Settings. The tasks are behind a dock under the other pages, which says what runs or what failed, and the overview lists them itself.
.vfox.tomlis read, each version that it asks for is shown with whatvfox currentsays in the folder, and each is put right: an installation, or the use of an installed version that the name stands for. Install missing queuesvfox install --yes name@versionone by one (neverinstall --all, which exits 0 also when everything fails), and a tool is added withvfox use --project.vfox link --detect), or install by name. The registry is a page of the toolchain./api/projects(?refresh=truereads the files again),/api/projects/install,/api/sdks/<name>/detect, and tasks that work in a project name its folder. Adding a plugin of the registry from the browser or the phone works (it answered 400), and a list that failed to load is read again only after 3 seconds (an offline registry ran vfox without end).measure-apkfollow the new navigation.A phone app from before this works with a computer that has it; a newer phone app on an older computer asks to update vfox+ where it shows projects.
Memory
The springs first cost about 14 MB after a few dialogs. Two causes, both removed:
Medians of five runs under Xvfb, end-to-end build, fake vfox, MB of PSS (
docs/en/dev/memory.md):On the Wayland compositor of WSLg, GTK keeps more buffers while frames are drawn, which the application cannot reach: about 9 MB more on the version list with motion.
Verification
go vet,go test -racewith the coverage gate (core and state 87 %, ui 86 %), and the census of the screens, on Linux.golangci-lint2.15.0 (fmt --diff,run,run --build-tags e2e): no issues; the tests and Windows vet ofshared/tooling.fake,real(vfox 1.1.0),python,pluginsandtray.vfxtool profile lintagainst the main branch of their plugin, and validate against the schema.npm testandnpm run build; the audit of the pages found no text under the contrast of WCAG AA, no size off the type scale and no control under 24 px.vfxtool docs-check, markdownlint and actionlint.wsl.exeanddockerthat run the wrapper and scripts with real shells; the integration test with real Docker containers, locally and in CI; the integration test with a real WSL distribution in CI only; screen tests and census of the desktop, the phone and the web interface (audit of contrast, type scale and target sizes).Not verified yet
wsl.exewas not tried.measure-apkrun on an emulator for the first time in CI.