Repository navigation
Replace our own icon font, Chrome client, GitHub layer and e2e driver with libraries - #45
Merged
Merged
Conversation
- mygo draws SVG icons itself (`ui.Icon`), so the Material Symbols come as the 24 px SVGs of google/material-design-icons, the revision that the font was cut from, outlined and filled, in `shared/icons` - `vfxtool iconfont` (a TrueType subsetter and variable-font instancer, about 7,000 lines) and `vfxtool renamefont` are gone, with the download of the font in the sandbox image, the cache of it in CI and the cache directory that mygo needed for registered fonts (`ownFontCache`) - `vfxtool prepare` copies the icons, the catalogues and the license, and calls the license collector itself instead of running a copy of vfxtool - the icons sit on the centre of the text line, where the font put them 2 px low; the memory use is the same (measured on Home and with Node.js listed)
- `core/i18n` parsed a subset of ICU MessageFormat itself (320 lines, with
plural rules for English and Chinese only); the i18n package of mygo, which
the application links already and which needs nothing but
golang.org/x/text/language, parses all of it and picks the plural category
from the CLDR
- a number that is an argument is written the way of the language
(`2,641 versions`), and an apostrophe before `{`, `}` or `#` quotes, as in
ICU; the catalogues have no such apostrophe
- the language of the desktop is read with `i18n.Base`, which also takes
`zh_CN.UTF-8` and the like
- `requireSameOrigin` compared the Origin and the Referer by hand; `http.CrossOriginProtection` reads Sec-Fetch-Site first and the Origin where a browser sends no such header (the Referer is not read any more); requests without either header, like curl, pass as before - `isTerminal` took any character device for a terminal, /dev/null too; `term.IsTerminal` asks the system
- `vfxtool webheap` carried a WebSocket client (RFC 6455), a DevTools Protocol client and a Chrome launcher of its own, and its tests a fake Chrome with a WebSocket server; chromedp starts the browser, speaks the protocol over a pipe and removes the profile, and the tests drive a real Chrome (they are skipped where there is none) - the screenshots of a page, of two scenes and of the dark theme come out byte for byte as before, and the heap is read the same way (three samples, the median) - `vfxtool coverage` reads the profile with golang.org/x/tools/cover, which also merges the blocks that two packages report - `go mod tidy` drops brotli, which only the font cutter used, and lists go-licenses and go-getter as the direct dependencies that they are
- mygo v0.6.3 -> v0.7.3, which asks for Go 1.27.3 in go.mod and in the docs - the 36 snapshots of the interface are pixel-identical to those of 0.6.3 - measure the memory table again: 50 MB of PSS on the Home page and 58 MB with the versions of Node.js listed; main measures 49 and 58 in the same sandbox today, so the 45 and 53 of the table came from an earlier state of the application, and the update costs nothing - the desktop binary is 18 MB, not 12 MB; the headless one is 12 MB - the Technology link of the table pointed to an anchor that the README no longer has
- shared/icons.json pins @iconify-json/material-symbols 1.2.97 (Apache-2.0, 1.3 MB, 936k downloads a month) with the SHA-512 of its tarball - vfxtool prepare downloads it once with go-getter, which checks the checksum, keeps it in the cache directory (VFOX_PLUS_ICONS; VFOX_PLUS_NPM_REGISTRY names a mirror) and cuts the outlined and the filled SVG of every symbol in use into mygo/assets/icons; a symbol that the package lacks fails the build, naming it - vfxtool prepare --fetch only downloads: the sandbox runs it in its deps task, into a cache volume (SANDBOX_NPM_REGISTRY names a mirror), and runs the rest offline; CI caches the package - shared/icons (110 SVG files and their license) is gone; licenses.txt gives the origin of the icons and the license text of the repository, which is the same - the icons are still those of Google; extension, extension_off and explore were redrawn upstream, and the snapshots of the interface differ by fewer than 300 pixels each, nearly all of them in the extension icon - no Go module qualifies for this: cogentcore.org/core/icons is the Outlined style, a 48 MB module with 104 importers
- the layer that routed REST paths and returned decoded JSON (API, GitHubAPI, toAny, asInt, asString, ApiError; about 370 lines) is gone: the functions take a Repository and read *github.Artifact, *github.WorkflowRun, *github.PullRequest and the like - retries are a RoundTripper (repository.go): GET, PATCH and DELETE are sent up to three times after an HTTP 5xx or a broken connection, waiting 2 and 4 seconds, with their body; a POST is sent once, and a refusal or a rate limit is passed on, as before - the comments of a pull request are paged by go-github (ListCommentsIter); the old code stopped after 1000 - the zip of an artifact is fetched from the address that the API redirects to, without the token, and read up to 64 KiB - the tests talk to a fake of the API over HTTP (httptest) instead of calling a fake Go interface, and an error of the API at any of 11 stages ends the report without a write - the comments are byte-identical to those of the old code for three merged pull requests, checked against the real API - no library for the retries qualifies: go-retryablehttp, backoff and retry-go had their last release more than six months ago, go-retry has 722 stars
- 71 links in 14 documents lacked their closing bracket, as in [`x`(../x.md), and showed as text; vfxtool docs-check now fails on such a link (markdownlint does not see it, for the text is no link) - 8 bare URLs followed by ")" or by the full-width ")" are in <...>: GitHub takes a bare URL up to the next space, so the punctuation after it became part of the address - a '|' in the code of a table cell cut the cell, and the Windows cross-compile row lost arm64; the trailing space of a code span is said in words; an anchor of the memory table pointed to a heading that the README no longer has - .markdownlint.yaml and the markdownlint-cli 0.50.0 image (pinned by its digest) run in the lint job of repository.yml; contributing.md says how to run it and what matters - markdownlint-cli (1,102 stars, 4.4M downloads a month) was chosen over markdownlint-cli2 (966 stars); Prettier would rewrite 38 of the 58 documents, so there is no formatter
- shared/tooling/internal/automation speaks the protocol of plugins/automation (new in mygo 0.7.3: one JSON object per line over a Unix socket) as a Go client: windows, idle, act, input, capture and tree; a failure that the application reports is an *Error with the code of the protocol - the helpers on a tree read a window the way a person does: find and filter nodes, whether a node is within another, what a text says, the title of a list item, the field that follows the title of a setting, the percent of a download that the window shows - the tests talk to a fake application on a socket and cover 96 % of the statements - nothing uses it yet: the next commits drive the end-to-end scenarios, the memory measurement and the screenshots through it
- under rootless Docker what a task writes as tester belongs to a subordinate uid of the host (101000), and a directory it made, such as the stage of a package, has no write permission for others: the user cannot empty it, so the second vfxtool sandbox all ended with "unlinkat dist/sandbox/mygo/package/stage-x64/vfox-plus.exe: permission denied" - removeResults tries the host first; when it is refused, a throw-away container of the sandbox image (else the base image, else the clean Ubuntu) deletes the directory with rm -rf, for root in the container is the user, who may delete what the subordinate uid owns; without any of the images it says what to do - vfxtool sandbox clean deletes the results before it deletes the images, for the container needs one - the Docker commands are variables, so the tests, which stand in for Docker and for root, need neither - checked against the real thing: a vfxtool built from the previous commit failed on files of uid 101000 as before, this one printed "Deleting ... in a container" and the second vfxtool sandbox all ran green
- the setting "System" matched the locales of the environment (LANGUAGE, LC_ALL, LC_MESSAGES and LANG, as GLib reads them) against the catalogues; Windows sets none of them, so a Chinese Windows showed English until the language was chosen in the settings - once the window can be opened (App.WhenReady), the application asks mygo for the languages of the user (Application.PreferredLanguages: on Windows the display languages of GetUserPreferredUILanguages, on Linux the same variables as before) and puts them before the locales of the environment; mygo can tell them only when it runs, for the call waits for the main loop, so ui.New cannot ask - eight cases are tested with the languages of the system given: Chinese Windows without a variable, Traditional Chinese (which has the one Chinese catalogue), the first language that has a catalogue, none that has, the environment alone, the system before the environment, and a language of the settings, which wins - the call into Windows is compiled and vetted for Windows here, but was not run on one
…plugin of mygo - the application has no scenario code any more: ui/e2e_driver.go and ui/e2e_scenarios.go (about 800 lines), the hooks of the frame and the "e2e: SHOT" and "e2e: MEASURE" lines of its output are gone; mygo/automation_e2e.go links plugins/automation with the build tag e2e, and ui/e2e.go keeps the profile of the offline test plugin and VFOX_PLUS_E2E_WINDOW, the size of the window of the compact layout - the scenarios are Go in shared/tooling: appsession starts the application with a new home, the fake or the real vfox and a socket, and drives it by the elements of the window (the labels and the keys that the components give them); e2erun (fake, real), measure and screenshots use it. The commands, the workflows and the numbers are the same, and a wait that times out prints the elements that the window showed - vfxtool build --e2e builds with the tag e2e alone: the plugin needs the inspector, which the release build leaves out. That build is 0.4 MB larger, and the memory table now says 51 / 63 / 59 / 73 MB for it (it said 50 / 62 / 58 / 73) - the screenshots are still taken from the X root window, for the capture of the plugin has no title bar and is twice as large; the compact ones start the application in a window of that size, so there are five runs instead of three. In the sandbox 16 of the 27 pictures are identical to those of the old driver, 8 differ by a few pixels (the random path of the sandbox, a percent, the caret) and 3 only by the position of the window - the application says what a screen reader reads: the row of a task says its status (it is one button, whose children are hidden), a closed dialog leaves the frame at once (the last frame kept it in the tree), and the widgets of a list item are in it by its title, not by the name it is called - kit.Registry stays for the unit tests of the components; the tests of appsession (95 %) run against a fake application on a socket and against the test binary run as the application, which is ended by SIGTERM or killed - the documents in both languages say how the scenarios, the measuring and the screenshots work now
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@iconify-json/material-symbols1.2.97 (Apache-2.0, 1.3 MB, 936k downloads a month) with the SHA-512 of its tarball; vfxtool prepare downloads it once with go-getter, which checks the checksum, keeps it in the cache directory (VFOX_PLUS_ICONS; VFOX_PLUS_NPM_REGISTRY names a mirror) and cuts the outlined and the filled SVG of every symbol in use into mygo/assets/icons, and a symbol that the package lacks fails the build and is named{,}or#quotes, as in ICU (the catalogues have no such apostrophe), and the language of the desktop is read with i18n.Base, which also takes zh_CN.UTF-8 and the like<...>, because GitHub takes a bare URL up to the next space and the punctuation after it became part of the address. A "|" in the code of a table cell cut the cell and the Windows cross-compile row lost arm64, and an anchor of the memory table pointed to a heading that the README no longer has. .markdownlint.yaml and the markdownlint-cli 0.50.0 image, pinned by its digest, run in the lint job of repository.yml, and contributing.md says how to run it; markdownlint-cli (1,102 stars, 4.4M downloads a month) was chosen over markdownlint-cli2 (966 stars), and Prettier would rewrite 38 of the 58 documents, so there is no formatter