mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-25 07:09:11 +00:00
9d89fc7a29258804e4eecc73a2a876e92e476a4c
866
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9d89fc7a29 |
refactor(gui): folders in a file picker open in the picker, never in a new window (#4666)
Notify HeyPuter / notify (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
From inside a file picker, Open in New Window and ctrl/cmd + click on a folder, a sidebar folder, or a path segment opened a standalone folder window over the dashboard. Those entry points are removed, so the click opens the folder in the picker. The sidebar folder menu, which only held Open and Open in New Window, is removed with them, and so is the open_in_new_window string. |
||
|
|
ed3861f289 |
feat(puter-js): email.get() returns the sender check as senderAuth (#4716)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
An EmailMessage carries `senderAuth`: the result Puter recorded in the
message's X-Puter-Sender-Auth header when it filed it ({ result, from,
signedBy, local }), or null when there is none. Only the first such header
counts, which is the one Puter writes.
|
||
|
|
ef5a78e5bd |
feat(puter-js): offer Add Credits in the Low Balance dialog to accounts with a plan (#4577)
A call refused for credit on a website shows the Low Balance dialog, whose only action was Upgrade. An account that already has a plan can buy add-on credit instead, which is quicker and cheaper than changing plans. For such an account the dialog now leads with Add Credits, which shows the top-up as the user menu's item does, and keeps Upgrade Plan beside it. Accounts without a plan, team seats and every other refusal see the dialog as before. The rule for who can top up moves into lib/topUp.js, shared with <puter-user-menu>. |
||
|
|
743c1a772d |
feat(puter-js): the user menu shows its Upgrade button by default, signed in or out (#4712)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* feat(puter-js): the user menu's Upgrade button shows signed out, and signs in first Signed out or on a temporary account, a click signs in as the Sign in button does, then opens the upgrade for the account that signed in, unless it's a seat. * fix(puter-js): keyboard focus stays on the user menu's Upgrade button through the sign-in it asks for Loading the account that signed in hid the button and dropped the focus to the page, where the upgrade frame then handed it back. * feat(puter-js): the user menu shows its Upgrade button by default, and hide-upgrade hides it A page that sets show-upgrade gets the button as before. |
||
|
|
f0d44a5d4f |
feat(puter-js): <puter-user-menu> can show an Upgrade button (#4711)
* feat(puter-js): <puter-user-menu> can show an Upgrade button With the show-upgrade attribute, the user menu shows an Upgrade button to the left of the Apps button for a signed-in user. It is hidden by default, and while signed out or on a temporary account. Clicking it shows the upgrade in a frame over a first-party page, and opens the dashboard's upgrade page in a new tab anywhere else. The dashboard upgrade URL always carries the upgrade parameter, empty when no refused call is behind it, so the tab opens the upgrade flow either way. * feat(puter-js): the user menu's Upgrade button reads Manage plan for an account with a plan The button's label follows whoami's subscribed: Upgrade without a plan, Manage plan with one (manage-plan-label overrides it). An upgrade made in the frame the button opens changes the label when the frame closes. The button is hidden for a seat, whose team changes the plan. * fix(puter-js): the user menu's Upgrade button reads Manage plan after any framed upgrade An upgrade made in a frame opened by puter.ui.requestUpgrade(), such as from the usage limit dialog, gave the cached whoami a plan but left the button reading Upgrade. The UI module now tells internal listeners when a framed upgrade gives the user a plan, and the menu re-renders its plan state from it. * fix(puter-js): a double-click on the user menu's Upgrade button opens one tab On a page that can't frame the upgrade, each click of a double-click opened the dashboard's upgrade page in its own tab. The button now ignores the second click of a double-click. * docs(puter-js): the user menu's label follows any framed upgrade * fix(puter-js): the user menu's Upgrade button shows its pressed state under a mouse The :hover rule came later at the same specificity, so a press looked the same as a hover. |
||
|
|
6478f18feb |
perf: whoami row reuse, thumbnail URL cache, KV refusals, dashboard KV boot batch, profile revalidation (#4687)
* perf(whoami): answer from the user row token auth already loaded Token auth builds the actor from the user's row with the password hash left out. It now records `hasPassword` in its place, so /whoami builds the details (`oidc_only`, `is_temp`) from the actor and skips reading the same row again by id. An actor built any other way still reads the row. * perf(thumbnails): reuse a read URL signed this hour A thumbnail's read URL is the same for the whole signing hour, so listings re-signed it for nothing. Signed URLs are kept per signing client, keyed by the signing key, bucket, object key and hour (5,000 entries, one hour). A new signing key signs afresh. * perf(kv): a refused conditional write ends at the refusal when it can `set` with `onlyIfAbsent` on a live key, and a write or delete into a foreign namespace refused by a private entry, made four store calls: the refused write, a refused expired-row delete, a consistent read and a second refused write. The conditional write now asks for the refusing item. When its `ttl` is absent, null or a number, the condition already judged it the way reads do and the refusal stands after one call. A text or boolean `ttl`, or a refusal without the item, still settles and retries as before. * perf(gui): the dashboard reads its saved settings in the boot batch The GUI's boot KV batch fetched the desktop's keys on every boot, while the dashboard read its seven (Files view and sort, Apps order, groups and uninstalled list) one request each. The batch now carries the keys of the interface that booted. The uninstalled-apps read-modify-write skips the batch, which may predate another window's write. * perf(profile): answer a revalidated GET /profile without reading it A profile write records a hash of the stored JSON in the file's metadata. GET /profile sends it as the ETag with `Cache-Control: private, no-cache` and answers a matching If-None-Match with 304 before reading the stored profile. Visibility is checked first, so a hidden profile still 404s. A profile stored before this has no tag until its next write. * fix(thumbnails): a listing's concurrent signings share one URL cache The per-client cache was registered after the first signing returned, so a cold client's first listing kept only one of the URLs it signed. * fix(kv): recheck a refusing row's expiry and its private flag A numeric `ttl` that passes while the refusal is on its way now settles and retries, as before, instead of answering false. A share holder's refused `onlyIfAbsent` takes the private flag from the refusing item rather than an eventually consistent read after it. DDBClient tests cover the request and the undecoded item on the wire. * fix(gui): Apps refreshes read the saved layout from the store Only the open's first load takes it from the boot batch. A refresh exists to pick up another tab's changes, which a batch fetched a few seconds earlier can predate. * fix(profile): tag a profile response by the bytes it carries The file is written before its entry and the entry can be read from a cache that is behind, so a 200 now carries the tag of what was read. Tags are weak (the compressed and plain bodies share one) and the early 304 sends `Vary: Accept-Encoding` like the 200. A profile stored without a tag still answers 304 to its content tag, after reading the file. * fix(kv): the GUI boot batch only answers for the token it was fetched with A sign-in from another tab swaps the token while the batch is still live, so reads under the new account fall through to the store. |
||
|
|
65f3586847 |
fix(puter-js): accept the built-in web search tool in chat options (#4628)
* fix(puter-js): accept the built-in web search tool in chat options
The chat docs pass `tools: [{ type: "web_search" }]`, but `ChatOptions.tools`
only accepted function definitions, so the documented call was a type error.
`ChatOptions.tools` now accepts `Tool | BuiltInTool`, where `BuiltInTool` is
`{ type: 'web_search' }`. `Tool` is unchanged. There is no runtime change, since
the backend already accepts this tool.
* docs(puter-js): mark the chat vision option deprecated
The SDK sets vision itself when an image is passed, and the backend never reads it, so a caller's value has no effect. The type stays so existing callers still compile.
|
||
|
|
327eef2d32 |
feat(apps): puter.apps.get() accepts a URL (#4686)
A string containing :// is looked up as a URL instead of a name. The puter-apps driver's read takes id.url and resolves it through appUidFromOrigin, so it returns the same app a page on that origin acts as. |
||
|
|
6b7541d0b6 |
fix: AuthMe relay names, write size caps, worker teardown on uninstall, and fewer share, cache and whoami round trips (#4683)
* fix(auth): AuthMe reads forwards_to only from configured relays and never redirects onto the GUI The authorization dialog names the host in `forwards_to` only when the redirect's origin is listed in the new `authmeRelayOrigins` config, rather than for any host under the deployment domain. An AuthMe request whose redirect lands on the GUI's own origin is refused before the dialog opens, since GUI pages pass their query on to whatever they launch. * fix(fs): hold direct writes to their declared size or the owner's free storage Writes that stream straight onto a file's object (`/fs/write`, `/fs/batchWrite`, WebDAV PUT and signed `/writeFile`) now cap the body before it is stored: - A stream that declares a size fails with 400 once more bytes arrive than it declared, and the upload is aborted. - A stream that declares 0 (a chunked WebDAV PUT, `/writeFile`, a multipart part sent with size 0) is capped at the owner's free storage and fails with 413 past it. Parts of one batch share that allowance. - A body of known length that is longer than declared is checked against the owner's free storage before the upload instead of after. A refused overwrite leaves the stored file and its recorded size unchanged. A new file whose write fails after its upload has its object deleted. The last chunk of a capped stream is held until the body ends, so the store never completes an upload that later turns out too long, and a PutObject is aborted when its streamed body fails. * fix(workers): uninstalling an app takes down its workers in the account The workers an app runs in a user's account, and those bound to apps it created there, are deleted when the user uninstalls it: script, sessions and row. A redeploy of any kind (hot reload, unsuspension, an edge redeploy of an evicted script) reads the row's app, so with the row gone none of them can mint a token for the uninstalled app again. A worker bound to an app the user owns is kept. When the edge can't delete the script, the row is still removed and the script delete is retried in the background. * perf(share): withdraw a share's access modes in one revoke Withdrawing a share revoked each of the five access modes on its own, every one a delete, a primary re-read and a cache bump in series. It now uses the batch revoke: one delete, one re-read and one bump, with each removed permission still audited and announced. A file's withdrawal also skips the subtree scan for re-shares managed below it, since a file has nothing below it. Adds a benchmark scenario for withdrawing a file share. * perf(puter-js): an update to a file drops only that file from the FS cache `item.updated` for a file now removes its cached entry and its folder's listing, including an entry still cached under the file's old path, since a rename arrives as an update naming only the new path. An update to a directory still clears the whole cache. Before, any file overwrite cleared the whole cache, and the desktop then re-read its warm folders. * perf(puter-js): the desktop handing back its own token reads the user once In the GUI environment, `setAuthToken` with the token it already holds no longer re-reads `/whoami` when the user was read with that token and API origin, or a read is still in flight; `puter.os.user()` there keeps what it reads as `puter.whoami`. The auth-state change and its cache check still run. The desktop merges the user it stores into `puter.whoami` when the token is unchanged, so an account saved under a new username shows up there. Other environments behave as before. |
||
|
|
5d2eaeb981 |
fix: billing holds that follow what AI calls cost, reserved godmode hosts, contained upload paths (#4671)
* fix(replicate): send input images as the bytes measured for billing Each input image is fetched once, measured, and passed to Replicate as those bytes, which the client uploads to Replicate's file store. An input that can't be read as an image is refused with 400 instead of being billed as one megapixel. * fix(ocr): hold the page limit for a PDF whose pages can't be counted When the balance can't cover the page limit, the call holds the size-based estimate and asks Mistral for only that many leading pages. A pages selection still holds only the selected pages. * fix(tts): bill gpt-4o-mini-tts by the tokens OpenAI reports The model is streamed as server-sent events, decoded back into the audio stream callers get, and charged the input and audio tokens from the final event. The per-character rate on the text and instructions is the hold, and is charged when no usage arrives. * fix(realtime): response holds include the conversation so far Each response holds the fixed budget plus every token the previous response read and wrote, priced as uncached audio input. An unreported response is billed the same amount. * fix(apps): reserve godmode app hosts and the puter.* launch params apps.create and apps.update refuse an index_url on the host of a godmode app. The desktop drops puter.* params already in an index_url before adding its own. Dev Center inserts the payout email as text. * fix(puter-js): fs.upload refuses paths outside the destination folder A file or folder whose path resolves outside the destination, such as through .. segments, rejects the upload with invalid_upload_path before anything is written. * docs: changelog and quota entries for the billing and upload changes * fix(tts): skip a [DONE] line in the speech event stream Also adds a gpt-4o-mini-tts integration case that checks the streamed audio and the billed tokens. * fix(ocr): a document whose pages can't be counted reads only what the balance covers Counted PDFs hold their page count. Anything else that can't be counted, such as a DOCX or an encrypted PDF, holds the provider's page limit, or as many leading pages as the balance covers, and Mistral is asked for only those pages. Drops the size-based page guess. The changelog keeps only the developer-facing upload error. |
||
|
|
245254ce0c |
fix(gui): make Open With a one-time choice with an explicit default (#4677)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* fix(gui): make Open With a one-time choice with an explicit default Choosing an app under Open With opens the file in it and nothing else; it no longer asks to make that app the default for the file type. A new "Always Open .<ext> Files With" submenu lists the suggested apps with the current default checked and saves the one picked. Open With lists the default app first, then the rest in the server's order. Third-party apps for an extension come back in registration order instead of whatever order the database returned. The desktop item menu and the dashboard menu now build Open With from one helper instead of two copies. The dashboard's touch menu renders checked items. Files without an extension no longer take a default, since one was never loaded back after a reload. * fix(gui): close every parent menu when an item in a nested submenu is chosen Choosing an item in a submenu of a submenu closed that submenu and its parent, and left the root context menu open. The menu now closes with every menu above it. * fix(gui): close a nested submenu together with the submenu it belongs to Moving the pointer from a third-level menu back to the root menu removed the second-level menu and left the third on screen until the next click. A context menu now removes its own submenus when it is removed. * fix(gui): keep keyboard selection in the submenu being opened Pressing the right arrow or Enter on a submenu row highlighted the first row of the first submenu on screen. In a submenu of a submenu that is a row of the menu the key was pressed in, so two rows ended up highlighted. The selection now goes to the submenu that row opens. * fix(gui): make the touch menu's checkmark visible in dark mode The checkmark of a checked item took the button's default text color, so it was black on the dark sheet. It now uses the same color as the label. * fix(gui): show an extension with special characters correctly in Open With The desktop menu encodes the label of a row that has a submenu, and the touch menu renders it as HTML, so the already encoded "Always Open" label read ".a&b" on the desktop for a file named "x.a&b". Each menu now gets the label in the form it expects. * fix(gui): treat a file name that ends in a dot as having no extension A file named "notes." was offered "Always Open . Files With". It takes no default app, like any other file without an extension. * fix(gui): don't offer a default app for a folder A folder whose name ends in an extension, such as "three.js", was offered "Always Open .js Files With", and its Open With list was ordered by the default app for that extension. A folder opens as a folder, so its list keeps the server's order and has no default to set. * fix(gui): keep a context menu label clear of its submenu arrow When a row with a submenu was the widest row of its menu, as "Always Open .ext Files With" is, its label ran right up to the arrow. The label now keeps a 12px gap; menus wider than their submenu rows look the same. * fix(gui): keep a nested submenu off the root menu near the right edge When a menu opened close to the right edge, such as from a row's more button, its submenu opened to the left and that submenu's own submenu opened back to the right, on top of the root menu. A nested submenu now continues to the left when its parent opened there and it fits, and the pointer's path to it is judged from the side it opened on. * test(puter-js): cover context menus with a submenu inside a submenu Two specs for puter.ui.contextMenu(): choosing an item three levels deep closes the whole menu, and the inner submenu closes with the submenu it belongs to. * docs: add the nested context menu fix to the changelog |
||
|
|
74c5bb54a0 |
chore(deps): bump postal-mime from 4.2.0 to 4.2.1 (#4674)
Bumps [postal-mime](https://github.com/postalsys/postal-mime) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/postalsys/postal-mime/releases) - [Changelog](https://github.com/postalsys/postal-mime/blob/master/CHANGELOG.md) - [Commits](https://github.com/postalsys/postal-mime/compare/v4.2.0...v4.2.1) --- updated-dependencies: - dependency-name: postal-mime dependency-version: 4.2.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
768b52c10e |
refactor(push): push database and key names are written once, and the desktop reads its push record through puter.js (#4653)
* refactor(push): the database and key names are written once for the page and both workers pushNames.js holds the puter-push database name, its stores, key prefixes and the subscription-changed message. pushStore.js re-exports them. push-sw.js and the GUI's sw.js are served as they are (push-sw.js also from npm's src/), so neither can import the module. Each carries a block generated from pushNames.js by tools/pushWorkerNames.mjs. The puter.js webpack build and the GUI build fail while either block is stale, and a test compares the names in both worker sources with the page module's. * refactor(push): the desktop reads the confirmed endpoint and the mark through puter.js puter.js now records the endpoint the server confirmed, and clears the subscription-changed mark, inside the Puter GUI as on a website. Three internal methods give the desktop what it kept itself: _webPushRecord() reads both, _noteWebPushSynced() records an endpoint a status check confirmed, and _dropRemovedWebPush() ends a removed subscription and forgets its receipt and the mark. webPushClient.js no longer opens the puter-push database or keeps its own localStorage record. An endpoint an earlier build kept there is read while puter.js has none, and removed once puter.js records one, so an already synced browser keeps its status without registering again. With a puter.js that lacks the methods, the client reads nothing from it and keeps the old record. * refactor(push): one-line comments on the push names and the record methods * fix(push): the worker names check reads CRLF checkouts, lives in tools/ and runs in PR CI The block helper moves to tools/pushNamesBlock.mjs, so it isn't part of the published puter.js sources. It compares and rewrites on LF text and writes back the file's own line endings. Both workers are pinned to LF in .gitattributes. The puter.js tests run when the GUI's sw.js or its build changes, and the GUI build checks sw.js before anything else. * fix(push): the desktop keeps a removed browser off with a puter.js that has no push record The desktop loads puter.js from its own URL, so it can run one without _webPushRecord(). The client then uses pushStore.js's helpers itself: it reads and clears the subscription-changed mark, ends a removed subscription and forgets its receipt and the mark, clears the mark after enable(), and keeps the confirmed endpoint in localStorage as before. _noteWebPushSynced() resolves whether it recorded the endpoint, and the localStorage endpoint is removed only after puter.js has it. A cached status reads only the mark before answering. The accessors carry JSDoc types. * fix(push): the removed-elsewhere check also asks about the endpoint in localStorage When loads alternate between puter.js versions, localStorage can hold a newer confirmed endpoint than puter.js does. The background check now asks about both, with the mark's old endpoint, before registering. * fix(push): with an older puter.js the desktop also asks about the endpoint puter.js recorded Once puter.js has recorded the confirmed endpoint, the desktop drops its localStorage copy. A later load that runs an older puter.js then read neither, so a browser that lost its subscription after being removed in Puter could register again. The fallback now reads puter.js's record from the store directly. * refactor(puter-js): the push record reads use try/catch instead of .catch() --------- Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
e7641676a2 |
feat(puter-js): enable() takes a background option, and the desktop's push sync uses it (#4634)
* feat(puter-js): enable() takes a background option that never prompts or opens sign-in
* fix(gui): background push sync calls enable({ background: true }) and shares puter.js's message name
* fix(puter-js): background enable() on a website needs the user's opt-in here and returns false outside web and gui
* fix(gui): push client reports unavailable push apart from permission and reads store names from puter.js
* fix(puter-js): notifications methods type-check when called on puter.notifications
* fix: background enable() stops when push is turned off meanwhile, sync reports unavailable push
* fix(puter-js): background enable() resolves false when pushes are turned off while it runs
* test: background enable() rejections use rejects matchers, not .catch()
* docs(puter-js): enable()'s background option gets its own section and lists its session errors
* fix(push): the desktop calls enable({ background: true }) only on a puter.js that takes it
An older puter.js ignores the option and runs the call as a click, which
replaces a browser removed in Puter and can open a sign-in. puter.js now
says it takes the option, and without that the desktop keeps the internal
background call it used before.
---------
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
|
||
|
|
cc48b25074 |
fix(net): make off() undo alias-registered handlers and emit drain (#4466)
* fix(net): make off() undo alias-registered handlers and emit drain * fix(net): skip drain on a closing socket, document off() and drain timing --------- Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
f9e25c2754 |
puterjs nodejs fixes (#4659)
Notify HeyPuter / notify (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
|
||
|
|
237ff84cc5 |
feat(hosting): sites list their custom domains, and hosting.detach() removes them (#4651)
* feat(hosting): sites list their custom domains, attach names a moved domain's old site, and hosting.detach() removes domains
- puter-subdomains read/select return `custom_domains` ({ uuid, hostname,
status }) per site, filled by a `site.customDomains` event listener. Only
rows attached under the site's current owner count; the field is left out
when the listener fails, so a failed lookup never reads as "no domains".
- The attach dialog's answer carries `previousSite` when the user moved the
domain from another site, kept through a status check or switch to www.
- puter.hosting.detach(subdomain) opens the custom domain dialog in a
remove-only mode (desktop message, frame, or popup) and resolves the
domains the user removed, or []. Desktops advertise it as
`custom-domains-detach`; older ones reject with not_supported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(workers): expect the sandbox-owner message create() throws now
create() rejects another user's sandbox app with "The sandbox app '…'
belongs to another user…" since the workers name-cap fix; the deploy test
still expected the old wording and failed on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
e7bc94029c |
fix(workers): name length cap, sandbox app freed on delete, no app opens from workers (#4631)
- Worker names are capped at 50 characters, the most a `workers.puter.<name>` subdomain row holds. A longer name is a 400 before any token is minted, instead of a 500 from the insert. The publish dialog caps at 50 too. - Deleting a worker deletes its `sandbox-<name>` app when nothing else runs as it, so the name can be reused by another user. A sandbox app owned by someone else rejects with `sandbox_not_owned` instead of a TypeError. - POST /rao records nothing for a worker or events handler actor, and the worker runtimes' clients no longer ask. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
9e102909d9 |
feat(puter-js): team members carry passwordPending for the owner (#4646)
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* feat(puter-js): team members carry passwordPending for the owner * test(puter-js): team members' passwordPending in the teams API suite * test(puter-js): passwordPending wording, non-boolean inputs, and the member view's account shape * docs(puter-js): one-line passwordPending description * docs(puter-js): listMembers description covers the owner's passwordPending --------- Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
7e419e722f |
fix(puter-js): status() in the desktop reads off when the account has no device in this browser (#4633)
* fix(puter-js): status() in the desktop reads off when the account has no device in this browser * refactor(puter-js): status() reads the device list through listDevices' request and a shared current-device rule |
||
|
|
9ca1acf634 |
Benchmarks that gate PRs on I/O regressions, wider test baseline, and npm run check (#4644)
* feat(bench): backend benchmarks that fail a PR for waterfalled or uncached I/O A scenario runs a request against the in-memory backend and records every SQL, key-value, Redis and object-storage round trip on a modeled clock, then reports round trips per destination, serial stages and modeled latency. tools/bench.mjs runs the scenarios on a base commit and on the head and fails on a regression the pull request description does not accept; benchmarks.yaml runs that on every pull request. Also adds npm run check (lint, type check, related tests and the benchmark comparison for the files a branch changed) and describes the distributed deployment in AGENTS.md. * test(bench): scenarios for fs, kv, auth, apps, permissions, sharing and hosted sites * test(puter-js): count the SDK unit tests in the coverage report Only the bundle the API runners load was instrumented, so the unit tests next to the SDK source never counted. In coverage mode the vitest config now instruments SDK source for them and writes one shard per test file. * test(puter-js): unit tests for ui messaging, dialogs, components, uploads, peer and smaller modules * test(backend): cover fs, permission, app, worker, sharing, broadcast and user edge cases * fix(backend): fs write flags are stored as booleans, app stats weeks are ISO weeks - A write's boolean flags reach the store only once read as booleans; any positive number reads as true. - App open stats grouped by week use ISO 8601 weeks for both the buckets and their labels on every database engine, so the two agree across a year boundary. * fix(puter-js): dialog token source, legacy upload cancel, submenu state, typed-array views - The sign-in dialog takes the token only from the popup it opened, and stops listening when it leaves the page. - Cancelling a legacy upload rejects with `upload_aborted` and no longer runs the `error` callback. - A context menu's submenu stays in step with its parent when the parent item is pressed or the submenu closes itself. - The FileReader polyfill reads a typed-array view through its own offset and length. * ci(bench): benchmark a pull request as merged into its base The comparison ran the branch's own head against the tip of the base branch, so a branch behind its base was charged for (or credited with) what the base gained since. The head side is now the merge commit and the base side its first parent. Shards also get a 15 minute timeout. * test(broadcast): shutdown drain tests send boot's own events first Boot queues cache updates that flush 10 ms later. A test body that started after that flush counted it as its own request, which failed 'bounds a hung flush in onServerShutdown' on a slow runner. |
||
|
|
679f577cd8 |
feat(ai): a declined Claude request reruns on a fallback chain, and its conversation stays on the model that answered (#4641)
* Rerun declined Claude requests on Anthropic's fallback model A Claude model with safety classifiers can decline a request and end it with stop_reason "refusal". Requests to the models that have server-side fallback (Fable 5.2, 5.1 and 5, Opus 5.5 and 5, Sonnet 5.5) now carry `fallbacks: "default"` and the server-side-fallback beta, so Anthropic reruns a declined request on the model it recommends for that refusal and the caller gets that model's answer in the same response. - `refusalFallback: false` turns it off for a request. The Anthropic route takes the native `fallbacks` field instead: "default" or a list of models is the caller's own chain, null turns it off. - The `fallback` content block is a `refusal_fallback` chunk in a stream and `refusalFallbacks` on a non-streaming result, where it is taken out of `message.content`. The Anthropic route writes it back as a native block and accepts it in replayed messages. - `usageDetails.fallbackModel` names the model that answered. - A final refusal is forwarded as before, without the fallback-credit fields of `stop_details`. - A request Anthropic rejects over a fallback the caller did not ask for is sent again without it. * Meter each Claude fallback attempt on the model that ran it A request Anthropic reruns on a fallback model is several attempts, each billed at its own model's rates. `usage.iterations` carries one entry per attempt and the top-level counts describe only the attempt that answered. - Every attempt is its own charge, priced at the rates of the model that ran it and recorded under that model's key: the answer from the top-level counts, each declined attempt from its iteration entry. Nothing is counted twice, and a fast request's attempts are priced at each model's fast rates. - The reported `usage` keeps the answering attempt under the plain keys and adds a declined attempt's tokens under `declined_` keys. Like the advisor's, only their recorded cost prices them, and they are no part of the request's own prompt or output totals. - A provider's `requestPricing` can name the models the upstream may rerun the request on. The credit gate then prices the prompt and the capped output once per model, each at its own rates and cost factor, for the affordability check, the output cap and the hold. Claude names the priciest target of default routing, or every model of a chain the caller named. * Charge a declined Claude request only when Anthropic bills it Anthropic bills a request its classifiers decline before any output only in the bio, frontier_llm and reasoning_extraction categories; any other category, or none, is not billed. A request declined after it produced output is billed for its prompt and that output. Metering follows the same rule for each attempt: the final refusal by its `stop_details.category`, and an attempt that declined before a fallback by the `trigger.category` of its `fallback` block. An attempt Anthropic does not bill is recorded with its token counts at no cost. An attempt whose refusal details are missing is charged as before. * Estimate images inside tool results as attachments The credit gate's prompt estimate read a `tool_result` as the text of its serialized content, so a base64 image inside one counted as text, at many times the tokens the image costs. An image or document block inside a tool result is now estimated the way a top-level one is, from its payload size. Text and other blocks in the result are counted as before. * Name each Claude model's fallback chain, and keep a declined conversation on the model that answered A request to a Claude model with fallback targets names them in order (Opus 5, then Opus 4.8) instead of asking for default routing, which leaves some refusal categories declined. puter.js remembers the model that answered a declined turn and names it on later turns of the same conversation, so they skip the declined attempt. The backend runs such a request on that model and presents it in the requested model's response format. * Rerun a declined Claude request from the driver, one attempt at a time A request a Claude model declines is now rerun by the chat driver on the model's fallback models, instead of by Anthropic inside the same API call. The request sent upstream is the same as before this branch: no `fallbacks` field and no extra beta header. Each rerun is a whole attempt of its own. It goes through the credit gate against the balance left after the declined attempt, takes its own hold once the declined attempt's hold is released, and is metered by the provider under its own model. A request reserves one attempt at a time, as any other chat request does. When the balance can't cover the rerun, or the rerun fails, the response is the refusal. A non-streamed request is rerun on any refusal. A streamed request is rerun only when it was declined before any output, and the answer follows a `refusal_fallback` chunk on the same stream. The response reports the model that answered in `usageDetails.fallbackModel`, each switch in `refusalFallbacks`, the declined attempts' tokens under `declined_` usage keys, and the total charged in `usage.cost`. It keeps the requested model's format. A conversation pinned to a fallback model that declines continues down the rest of the requested model's fallback models. The Anthropic route reads `fallbacks: null` or `false` as an opt-out and ignores any other value. Claude restores `puter_path` parts after a refusal, so a rerun uploads the files again. |
||
|
|
1eed9659e2 |
Forward Claude inference speed from SDK chat options (#4627)
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
2d12dcc99f |
Reorganize AI drivers and harden request handling (#4614)
* Move the AI drivers into drivers/ai
The seven drivers/ai-* folders and the AI-only helpers in drivers/util
become one tree:
drivers/ai/interfaces/<interface>/ the Puter-facing drivers
drivers/ai/providers/<vendor>/<interface>/ vendor adapters, catalogs, tests
drivers/ai/protocols/openaiCompatible/ the shared OpenAI wire protocol
drivers/ai/shared/ helpers several interfaces use
Files are moved and their relative imports rewritten; no implementation
changes. Driver names, aliases, interfaces, config keys, model ids and
usage keys are unchanged.
The chat catalog registration test scanned providers/*/ next to itself.
It now scans providers/*/chat/ and fails if the scan finds no catalog, so
a wrong directory can't pass it.
General helpers that non-AI code also uses stay in drivers/util: file
input, data URIs, upstream errors, stream piping, CRUD limits.
* Document the AI driver layout
doc/ai-drivers.md explains what interfaces, providers, protocols and
shared each own, the import rules between them, where a new file goes,
and the steps for adding a provider or an AI interface. It also lists
the three places that don't follow the layout yet.
doc/architecture.md and AGENTS.md link to it.
* Move catalogPrice into ai/shared
Chat providers and the Cloudflare and xAI image catalogs all parse vendor
prices with catalogPrice, so it lives in shared/ instead of the chat
interface's pricing helpers. The image catalogs no longer import from
the chat interface.
* Move the Textract and Mistral OCR calls into provider classes
OCRDriver held both vendors' clients, request building, response
normalizing and metering. That now lives in TextractOcrProvider
(providers/awsTextract/ocr) and MistralOcrProvider (providers/mistral/ocr),
both implementing IOcrProvider. The driver keeps the provider catalog,
model resolution, auth and credit gates, and input resolution.
The page estimate, document detection and credit hold both providers use
are in interfaces/ocr/common.ts.
No behavior change: same validation order, error messages, usage keys,
holds and charges.
* Move the ElevenLabs voice changer into a provider class
VoiceChangerDriver built the ElevenLabs request, measured the converted
audio and metered it, and imported the output formats from the ElevenLabs
text-to-speech provider. That code is now in providers/elevenlabs:
outputFormats.ts formats both speech interfaces use
speechToSpeech/ElevenLabsSpeechToSpeechProvider.ts
speechToSpeech/measuredOutput.ts WAV, Opus and byte-rate timing
speechToSpeech/costs.ts
The driver keeps provider resolution, test mode and the auth check. With
one provider it holds the class directly; there is no provider interface.
No behavior change: same validation order, error messages, usage keys,
holds and charges.
* Move the AI billing helpers the realtime relay uses below the driver layer
OpenAIRealtimeRelayService is a service, and it imported the cost factor,
the provider key reader and a transcription price from drivers/ai. Those
now live in src/backend/util, which both layers can import:
util/aiCostFactor.ts withAiCostFactor, withAiCreditHold and the
request cost helpers, unchanged
util/aiProviderKey.ts readProviderKey, cut from providerRegistry.ts
util/aiPrices.ts the gpt-transcribe per-second price, read by the
OpenAI speech-to-text cost table and the relay
withStreamedAiCharge returns a DriverStreamResult, so it stays in the
driver layer as drivers/ai/shared/streamedAiCharge.ts with its tests.
MeteringService is untouched. No prices or billing behavior change.
* Remove the aiUserIdentifier alias
shared/aiUserIdentifier.ts re-exported upstreamUserIdentifier under a
second name, and only its own test imported it. The alias is gone; its
tests, which cover truncation and actor shapes the other file didn't,
replace the four cases in upstreamIdentifier.test.ts.
* Move the AI test helpers into the AI tree
drivers/integrationTestUtil.ts held helpers for AI provider tests, but a
store test and the realtime relay test imported from it too.
drivers/ai/shared/integrationTestUtil.ts the provider test helpers
testEnv.ts optionalEnv and skipUnlessEnv,
for any env-gated suite
testUtil.ts withAiCostFactorHook, next to
the server it hooks
No test under services/ or stores/ imports from the driver layer's AI
code now. The typecheck baseline entry for the moved file is renamed, not
regenerated.
* Split the tool and compaction helpers by dialect
FunctionCalling.js and compaction.js each held Puter-facing parsing next
to OpenAI and Anthropic request shapes. Each dialect now owns its mapping:
interfaces/chat/utils normalize_tools_object, readCompaction and the
other dialect-neutral checks
protocols/openaiCompatible/openaiParams.ts
toolsToWire (was make_openai_tools) and
toOpenAiContextManagement
providers/claude/chat/contextManagement.ts
toAnthropicContextManagement
toolsToWire takes the dialect as its second argument, like the other
mappers in that module, and takes an array; every caller already guarded
the empty case.
make_claude_tools is removed. Nothing but its tests called it: the Claude
provider uses claudeToolPolicy directly. The three cases only those tests
had are added to the claudeToolPolicy tests. The chat interface helpers no
longer import from providers/claude.
* Remove the unused ImageProvider base class
Every image provider implements IImageProvider directly; nothing extended
or imported the abstract class in interfaces/image/ImageProvider.ts.
The guide's import rules now say that only an interface's driver file
imports providers, which holds since the tool helpers stopped importing
the Claude policy.
* Rerun Replicate predictions an output safety checker rejects
Some community models check the generated image and fail the
prediction with "Try running it again" for a share of seeds, whatever
the prompt. adirik/realvisxl-v3.0-turbo failed 5 of 24 runs of "a small
red cube on a white table" that way.
A prediction that fails with that message is now run again, up to two
more times, inside the same deadline and credit hold. A request that
pins a seed is not rerun, because the same seed is rejected again.
Only the prediction that succeeds is metered, as before.
* Answer malformed AI requests with a 400 where they enter
A value that used to end in an unclassified error, in a request or in
an upstream answer, now gets a classified one before provider code runs
on it. A value a driver or provider ignored or refused before is
handled as it was.
Every driver:
- shared/scalarOptions.ts answers 400 for a value that cannot be
converted to text, such as { "toString": null }, in the options a
driver reads as text, a number or a flag. The chat, video, text to
speech, speech to text, voice changer and OCR drivers call it first.
- An unknown provider name that is not text gets the same 400 as any
other unknown name.
Chat requests:
- A falsy `tools` means no tools on every provider.
- A tool call id or a content block type that cannot be converted to
text is a 400.
- A tool result that is an object is sent as its JSON, like the content
of a `tool` message.
- `include` that is not an array is a 400.
- `anthropicBetas` that is not a list of names is dropped.
- Gemini's native route answers 400 when no user or assistant message
is left to send.
- The prompt estimate reads a compaction block whose content is not a
string.
Image, video, speech and OCR requests:
- The image driver checks `input_image_mime_type` with `quality` and
`resolution`.
- The video driver answers 400 for a model that is not a string.
- The voice changer answers 400 for an `output_format` that is not a
string.
- Mistral OCR answers 400 when the SDK refuses the options before
sending them, as Mistral chat does.
Upstream answers to chat:
- A choice without a message is the existing 400 bad_response, which
still falls back.
- A usage count that is not a number is reported as zero in the cost
event, as pricing already skips it.
* Fuzz the AI drivers with seeded requests and upstream answers
Two seeded suites send malformed input through the real drivers and
providers. The vendors are played at the HTTP boundary, so each
provider's request and response code runs.
- ChatCompletionDriver.fuzz.test.ts covers the 17 chat providers that
have a static catalog. Requests with a few values changed must
resolve or reject below 500 without marking a route unhealthy.
Valid requests against wrong statuses, bodies of the wrong shape and
broken event streams must end with an answer or a classified error.
A stream only has to end; the error line it carries is not checked.
- mediaDrivers.fuzz.test.ts covers the image, video, speech and OCR
drivers, called as a user with unlimited metering so a request gets
past file input and the credit hold. Every vendor refuses the
request, and every call must end with a classified error.
shared/fuzzTestUtil.ts holds the seeded random source, the hostile JSON
values, the mutation, and the stand-in for fetch, undici and axios. An
SDK that calls https.request itself fails the suite. PUTER_FUZZ_CASES
raises the case count for a longer run. doc/ai-drivers.md describes the
suites.
* Restore the CODEOWNERS default owner and wildcard patterns
The default owner line read `- @Salazareo`, which only matches a file
named `-`, so files without a specific owner had none. Three patterns
had their `*` escaped, which GitHub rejects as invalid, so their lines
assigned no owner.
---------
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
|
||
|
|
af01a554fe |
feat(gui): a top-up asked for from a page names the app it runs as (#4637)
The framed top-up passes the deployment's dialog the app the framing page's origin resolves to, as the framed upgrade does. The dashboard link puter.js opens when no frame can show carries the app in `topup_app`. |
||
|
|
5b1b5b8a7a |
fix(puter-js): apps launched from desktop.puter.com take its messages (#4640)
In an app, puter.js trusted only https://puter.com as the GUI origin, so every desktop message from desktop.puter.com failed the origin check and was dropped. The desktop waits for the app's answer to windowWillClose, so app windows there never closed; itemsOpened, drag-and-drop, focus, theme and locale changes were lost the same way, and a reauth request was posted to the wrong origin. An app now takes its GUI origin from the launch URL's `puter.origin`, but only when that is one of Puter's own desktops (exactly https://puter.com or https://desktop.puter.com); anything else keeps https://puter.com, so a page that frames an app still can't drive it. An explicit PUTER_ORIGIN still wins, and a top-level page never reads it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d1cbfb9fb1 |
fix(puter-js): a godmode app opened in its own tab stays signed in across a reload (#4632)
A tab the desktop opened for an app boots the SDK as a top-level page, where a session-type token was kept in memory only. Once the desktop hands such a tab its launch token, the SDK now keeps it in sessionStorage, as a framed app does, and a reload of that tab reads it back before any stored app token. A page that wasn't handed a token this way still persists no session token. |
||
|
|
b5e4f20087 |
fix: KV size and credit edge cases, a metering double count, site name caching, /token-read content type (#4618)
* fix(fs): /token-read serves a file with no known extension as application/octet-stream * fix(kv): a value too large once stored rejects with value_too_large, and a consistent read of several keys is consistent * fix(kv): remove on an account with no credits left removes the paths and returns null * fix(metering): a buffered increment whose base read fails is not also written through * fix(hosting): site lookups by name share one cache entry for every spelling * fix(metering): an increment whose base read fails is written through and taken back out of the buffer * fix(hosting): create stores a site name trimmed and lowercased |
||
|
|
bdb88507df | throw error for get usage APIs (#4608) | ||
|
|
4a958b3ca1 |
fix(gui): desktop push status counts only Puter's devices and follows subscription changes (#4550)
* fix(gui): desktop push status counts only Puter's devices and follows subscription changes - fix(gui): desktop push status counts only Puter's own devices - fix(gui): the desktop keeps its push subscription when the browser replaces it - docs(gui): shorten push comments to one line - fix(gui): removed browsers stay off after a subscription change, and websites can reach Puter push - docs(puter-js): fit the desktop push request comment on one line - fix(gui): background push registration checks every earlier endpoint and waits out a 429 - fix(puter-js): inside the desktop, requestPermission leaves a held push grant to the desktop - fix(gui): a browser that stays off after being removed forgets its receipt - fix(gui): push status holds right after enable(), and a subscription change is picked up after a run in flight - fix(gui): an app's push grant counts whenever the app list can't be read * fix(puter.js): a held push grant is left to the desktop only when it says it answers push The desktop lists `push-permission` in `puter.gui_features` on the app iframe's URL. Without it the SDK settles a held `notifications:push` from its own check, so a desktop whose requestPermission handler has no held check shows no dialog for a grant the app already holds. * fix(gui): a held push grant isn't asked again beside other access, and never counts without an app uid requestPermission drops a push grant held for Puter's devices from the dialog and asks only for what is missing. The app list lookup answers no for a missing app uid, whatever the list says; an app the list leaves out still keeps its grant, since the list is capped and can trail a grant. * test(puter.js): e2e for a push grant the app already holds inside the desktop A held grant resolves true with no dialog, and a request for it beside access the app is missing shows only the missing access. --------- Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
4653ff6dae |
fix(gui): a removed browser stays off, and launches reuse the page's push status (#4549)
* fix(gui): a browser removed from push stays off until its user turns it on
The silent registration on load and app launch no longer replaces a
subscription the user removed in Puter. When the server answers
push_device_removed, the browser's subscription and its receipt are
dropped and the browser is recorded as turned off, so later loads leave
it alone. Turning push on from Settings or a push dialog still replaces
the removed subscription.
* perf(gui): launches reuse the page's last push status
The built-in push client keeps the last registered status it read in
memory, for the same user and subscription. App launches and an app's
puter.notifications.status() answer from it instead of listing devices
again. It is dropped on enable(), disable(), an unregistered answer and
the worker's subscription-changed message, and the Notifications tab
and push dialogs still read fresh, so a new page load always asks the
server.
* fix(notifications): a background enable opens no sign-in, and a page keeps its last push on for five minutes
_enableWebPush takes { background } in place of { renewRemoved }: a call
without a click leaves a removed browser removed and sends its requests
without interactive sign-in.
The desktop's push client keeps the on that enable() read, so the next
cached status lists no devices, and asks the server again once that on is
five minutes old.
* fix(gui): the kept push on belongs to the user whose devices were listed, and a failed enable() keeps none
A status read or enable() that another user's sign-in overlapped keeps no
on, and an enable() that fails drops what a read begun meanwhile kept.
|
||
|
|
a5c7b427b8 |
fix(puter-js): a confirmed push subscription registers for another account without a new confirmation (#4548)
* fix(puter-js): a confirmed push subscription registers for another account without a new confirmation The server's verify and active subscribe answers can carry a receipt for the subscription. It is kept per worker scope and sent with the next announce of the same endpoint, so the Puter desktop registers the same browser for the next signed-in account without another confirmation push. The receipt is forgotten when the subscription is ended, replaced or removed, and when the app is turned off in Puter. A server without receipts behaves as before. * docs(puter-js): shorten a push helper comment * fix(notifications): keep receipts only in the Puter GUI and store the new one as soon as the server answers |
||
|
|
873303a7c4 |
fix(events): offer a queued delivery only to connections that run its handler (#4590)
* fix(events): offer a queued delivery only to connections that run its handler A queue subscription with an events worker was sent to every connection of the app. A connection without the handler declined it at once, which moved it to the worker while the tab with the handler was still running it. puter.js now sends `events.handle` with the persistent subscriptions a connection runs a handler for, on connect and whenever that set changes. The server puts the connection in a room for each queue row it holds, and offers the row's deliveries only to that room. With nobody in it anywhere in the region, the delivery goes to the worker at once. A peer region handed such a delivery declines it straight back when none of its connections run the handler. Rows without a worker are still sent to the whole app room. * fix(events): probe the handler room only when the app has a connection in the region A queued delivery for a pair with no connection here goes to the worker on the same local lookup and presence read as before, with no request to the other nodes. * fix(events): probe a forwarded batch's handler rooms together, within one timeout A region receiving a batch now looks up every handler room its queued deliveries need before it sends any of them: each distinct room once, up to 16 at a time, all under one shared 500 ms deadline. A room not answered by then counts as empty, so its delivery is declined home with `no_handler` and never sent. Deliveries still go out in the batch's order, and a batch with no such delivery probes nothing. * fix(events): resend a handler announce refused for the call budget puter.js now sends `events.handle` with an ack and a 10 second timeout. When the server refuses it with `too_many_requests`, the client sends the current set again after 10 seconds, until one goes through or the connection is replaced. No answer, as from a server without the verb, and any other refusal are left alone. A connection that never had a persistent handler sends no announce; one that had sends an empty set when the last is removed. The rate limits page now says that announces count toward the acknowledgement budget. * docs(events): say when a client starts getting first try at queued events A client counts once the server has registered its handler, shortly after it connects or calls `onPersistent()`. Before then, an event for a subscription with an events worker goes to another client with the handler or to the worker. * fix(socket): settle a cluster room count on the first node that holds a socket A count ask now hears each node's answer as it arrives: the first node holding a socket answers it at once, every node saying none answers it once all have said so, and a node that never answers only decides it when no answering node holds one. The request sent is unchanged, so every node answers it as before. * fix(events): look up handler connections in the region's record, not every node Each connection that announces a handler is kept in a per-subscription sorted set in the region's Redis, scored by renewal: added after it joins the handler room, removed before it leaves or on disconnect, renewed every minute while it runs one, and counted only for three minutes after its last renewal. Handing out a queued delivery, and receiving a forwarded one, now check this node's sockets and then that set with one read, instead of asking every node in the region to count the room. A connection the set names but that is gone gets the delivery sent to an empty room, and the socket lease hands it to the worker as before. * fix(events): try the next region with the app open after one declines for want of a handler A queued delivery's region is picked by app presence, so the first region tried can have the app open without the handler. Its no_handler decline now hands the delivery to the next region with the app open that hasn't had it, and the worker runs it once none is left. A lease that lapses still goes to the worker. A decline now counts only when it comes from the region the current attempt went to (this region for a local attempt). The region goes into the entry in the same write as the attempt's lease, so a second decline from a region already tried can't take the next region's lease. An attempt made after a decline stamps its lease in its own field, which a server that doesn't make such attempts never reads, so it can't take that lease back either. |
||
|
|
2c3b69011f |
fix(puter-js): unshare lists refused pairs in failed and rejects when all were refused (#4557)
* fix(puter-js): unshare rejects when every revoke was refused
/share/revoke reports refused pairs in a 200 body, and unshare() only
read `revoked`, so a call where every pair was refused resolved as if it
had worked. It now rejects with the first pair's { message, code }, the
same way share() does; a call where some pairs went through still
resolves with { revoked }.
GUI tests drive the SDK's unshare against a refused body and check that
the share dialogs and Remove from Shared show the error and keep the
row. The unshare docs list the per-pair codes.
* fix(puter-js): unshare and share reject with the first refused pair that names a code
A pair the server could not complete carries no code and a generic message,
so it no longer comes ahead of a refusal that says what happened. Both
operations pick the error through one helper. The unshare docs describe which
pair's error is surfaced and the request-level rejections.
* fix(gui): share modal says how many items a person was removed from when some were refused
After removing someone from several items, the refreshed listing is compared
with the items the removal covered, and the status reports the count that
went through instead of all of them.
* test(gui): unshare fixture swaps XMLHttpRequest per call; alert mock cleared in hooks
* feat(puter-js): unshare resolves with the refused pairs; share is as it was
unshare resolves { revoked, failed }, with one failed entry per refused
recipient/item pair. A pair refused because the recipient or the item is gone
counts as nothing to withdraw: the call rejects only when every pair was
refused and at least one for another reason, with the first such refusal that
names a code. paths and recipients are typed and documented.
share() picks its rejection as before; the error choice lives in unshare.
* fix(gui): sharing dialogs report the items an unshare was refused for
The share modal counts refused items from the unshare result across every
run of a large selection, going on past a run refused whole, for removing a
person and for closing the link on several items. The share window and
Remove from Shared show the refusal when the call resolves with the pair
refused.
* fix(gui): sharing dialogs keep the unshare outcome on screen after the listing refresh
The share modal shows the partial count once its refresh has settled, for
removing a person and for closing the link, so a listing that fails for the
refused item does not replace it. The share window does the same when closing
the link.
* feat(puter-js): an unshare rejected for refused pairs lists them in failed; failed[].path is documented as the absolute path
* test(puter-js): API suite covers unshare's refused pairs
* fix(gui): share modal stops at a revoke request that failed and counts only refused items
---------
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
|
||
|
|
7e093d2ba7 |
perf(puter-js): reading the user at load joins the boot lookup (#4574)
* perf(puter-js): reading the user at load joins the boot lookup * fix(puter-js): keep the token fallback to the user lookup resend The fallback bearer is opt-in on initXhr, so other requests and their replays send no bearer after sign-out, as before. A failed join (the lookup or the copy) falls back to sending the request. Adds tests for the legacy callback form and a resend after a network failure. * fix(puter-js): join the boot user lookup only at the same API origin A user lookup sent after setAPIOrigin() joined the boot /whoami still in flight for the old origin and resolved its user instead of asking the new one. The in-flight marker now records the origin too. * fix(puter-js): a joined user read signs in from the boot lookup's answer and leaves on its first retry - The boot lookup keeps one in-flight record (token, origin, user, refusal), made and cleared in cacheWhoami_. - getUser(), puter.getUser() and whoami() share one join. A refused boot lookup drives the sign-in from its own response, so the token is not sent again; a sign-out meanwhile fails with 401 and sends nothing. - The join ends when the boot lookup first has to retry, so the caller's own request goes out at once (new fetchUrl onRetry option). - The joined user is copied with a JSON round trip; initXhr is back to its previous signature. * fix(puter-js): whoami() keeps its refused-request error when it joined the boot lookup --------- Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
aaa5c82236 |
Redirect /show/* to the dashboard and remove leftover desktop code (#4610)
* Redirect /show/* to the dashboard's Files tab /show/<path> redirects to /dashboard#files/<path> with its query intact, instead of booting the desktop and opening Explorer there. Also removes what only that route used: the shell's launch options, the launch_options GUI param, and the GUI service that ran them. * Remove the unused component window and Flexer Nothing opens UIComponentWindow or uses Flexer, and JustHTML was only the component window's default body. Also drops the attach() shim UIQRCode kept for component containers. * Remove translation keys left by removed features Drops 36 keys nothing references in every language: the keyboard shortcuts guide, desktop shortcuts, personalization, the toolbar's fullscreen, GitHub and refer entries, the referral strings, and the publishing option prompt. * Inline the toolbar height, which is always zero The toolbar is gone, so window.toolbar_height only added or subtracted zero in window sizing and placement. * Remove window edge snapping Dragging a window to a screen edge or corner no longer snaps it to half or a quarter of the screen. Double-clicking the head and the scale button still maximize. * Remove the window color theme service Nothing can set a window theme, so the GUI stops reading the saved theme file on boot and windows keep the default colors. puter.ui.on() still accepts themeChanged, which is never sent; its docs entry is removed. * Remove styles and icons nothing references Drops the stylesheet rules of the removed Settings window, launch menu, intro menu and a few other removed features, and 16 icons whose names appear nowhere in the GUI. * Remove more translation keys nothing references Drops 56 keys in every language that no GUI code, extension or backend message uses, such as the system information labels, the old 2FA setup and confirm-code steps, and the auth token copy dialog strings. * Remove the global menubar leftovers and more unused styles Nothing creates a global menubar, so the window code stops hiding, showing and removing one. Also drops stylesheet rules for classes nothing uses, including the old auth dialog, the responsive hidden-* and visible-* helpers, and two keyframes only those rules animated. |
||
|
|
ce70728eeb |
Remove the desktop's icons and right-click menu, and redirect /desktop (#4609)
* Remove the desktop's icons and right-click menu The desktop no longer lists the Desktop folder's items, and right-clicking its background opens no menu. It stays as the surface windows open on. Also removes what only the icons used: file drops and item drops on the desktop, rubber-band selection, auto arrange and saved icon positions, and their two keys in puter.js's GUI boot cache. Clicking the desktop clears the active item container so keyboard shortcuts stop acting on a window's items. * Redirect /desktop and /settings to the dashboard /desktop redirects to the root with its query intact, and /settings to the dashboard's Home tab. /desktop drops out of the OIDC return_to allowlist, sign-out returns to the root, and the auth cover page's logo links there. Also removes eight GUI globals nothing references. * Remove code paths that only ran for the desktop's item container The desktop is no longer an item container, so the Trash item that refresh_item_container added to it, the empty-folder message exemption, and the context menu parent check for it can't be reached. |
||
|
|
8518023b0b |
Remove more desktop-only features and entry points (#4607)
* Remove the desktop's Publish Website window The right-click menu on desktop folders and on an Explorer window's background no longer has a Publish as Website item. This removes UIWindowPublishWebsite, the publishAsWebsite helper that opened it, both menu items, the window's CSS, window.extractProtocol (only the window used it), and the dir_published_as_website and pick_name_for_website i18n keys. The dashboard keeps publishing websites through its own dialog. generateFileContextMenu no longer falls back to the removed window, so it offers Publish as Website only when the caller passes onPublishWebsite, which the dashboard's Files tab does. The website badge on desktop items and the backend hosting API are unchanged. * Remove the desktop's Hide Desktop Icons toggle The desktop's right-click menu no longer has a Hide/Show Desktop Icons item. Without the wallpaper, hiding the icons left an empty page. This removes the menu item, toggleDesktopIcons/hideDesktopIcons/ showDesktopIcons, the boot-time read of the saved setting, and the .desktop-icons-hidden CSS rule. puter.js's GUI boot cache no longer batch-fetches desktop_icons_hidden, menubar_style or user_preferences.clock_visible, which nothing reads anymore. Values already saved under those keys stay in KV, unread. Also drops the desktop's BroadcastChannel, whose message handler was empty and which nothing else referenced. * Remove the desktop's ?download= link handler Opening puter.com/?download=<url> or /desktop?download=<url> no longer asks to save that remote file to the Desktop. The parameter is ignored, and a root URL that carries it boots the dashboard like any other root URL instead of forcing the desktop. This removes the handler in UIDesktop, its UIWindowProgress import, the download entry in the GUI's dashboard routing, and the confirm_download_file_to_desktop, downloading, downloading_file, uploading_file and error_download_failed i18n keys only it used. The decision of whether a page load boots the dashboard moves from an inline block in initgui into helpers/bootsDashboard.js, so it is tested. * Stop granting Camera and Recorder Desktop access on desktop boot The desktop no longer grants Camera and Recorder write access to the user's Desktop folder the first time it loads. Those apps now ask through the normal permission prompt, as they already did for users who only used the dashboard. Grants already given stay in place. puter.js's GUI boot cache no longer batch-fetches the has_set_default_app_user_permissions flag that kept the grant to one run. Values already saved under it stay in KV, unread. * Redirect /@username links to the dashboard puter.com/@<username> no longer opens that user's Public folder on the desktop. The backend now redirects /@:username to /, so old links land on the dashboard instead of booting the desktop. This removes the GUI's /@ handler and the error_invalid_username i18n key only it used. error_user_or_path_not_found stays, since share links still use it. * Redirect /desktop/app links and stop opening share links on the desktop /desktop/app/<name> now redirects to /app/<name>, keeping its query string, so the app opens in the dashboard. The backend no longer serves an app shell there, OIDC sign-in no longer returns to it, and the GUI no longer strips a leading /desktop from its route segments. The rate-limits page lists only /app/<name>, the route the limit still applies to. /desktop?shared=<path> no longer opens the shared item on the desktop. The desktop ignores ?shared=: it doesn't ask a guest to sign in for it, doesn't switch to the account a share email names, and OIDC sign-in from /desktop doesn't carry it along. Share emails link to /?shared=, which the dashboard handles as before. Opening a share notification on the desktop still opens the item. * Remove the desktop's ?app=explorer link handler ?app=explorer[&path=<folder>] no longer boots the desktop and opens an Explorer window. ?app= is ignored and no longer forces the desktop, so a root URL that carries it opens the dashboard, and /app/<name>?app=... now launches its app in the dashboard instead of booting the desktop and launching nothing. * Stop ?puter.fullpage= from booting the desktop The root and /app/<name> with ?puter.fullpage= now open in the dashboard like a plain /app/<name>, with the app maximized. The dashboard always shows apps full page, so the parameter no longer overrides that. Iframe embeds and popups, which still boot the desktop, read it as before. bootsDashboard no longer takes the query string, since no parameter decides the interface anymore. |
||
|
|
33988ac84c |
Remove the desktop taskbar (#4605)
release-please / release-please (push) Canceled after 0s
Maintain Release Merge PR / update-release-pr (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
* Remove the desktop taskbar The desktop no longer has a taskbar. Windows on /desktop can't be minimized, since nothing could bring them back; the dashboard still minimizes into app tiles. The desktop and maximized windows use the full page height. Backend: POST /update-taskbar-items is removed, and /whoami and the login response no longer include taskbar_items. The user table's taskbar_items column stays until a migration drops it. puter.ui.createWindow() still accepts show_in_taskbar, which has no effect and is marked deprecated. * Keep desktop backdrops above ordinary windows A backdrop's z-index used to take the taskbar's as a floor, which kept modal dialogs on /desktop above every ordinary window, including ones focused after the dialog opened. Keep that floor on the desktop; the dashboard and fullpage mode stack as before. Also drops commented-out geometry that referenced window.taskbar_height, and a dashboard comment about the removed fullpage minimize rule. * Keep dropped desktop icons fully on screen, and fill the phone popover A desktop icon drop is accepted only where the whole item fits above the bottom edge. Phone popovers use the full viewport height. |
||
|
|
234994d3af |
Remove the desktop toolbar and nine desktop features, and use puter.js's color picker on the desktop (#4602)
* Remove the desktop's QR login button The desktop toolbar no longer shows a QR code that signs another device into the current session. This removes the toolbar button, its click handler, the UIWindowQR window (its only caller), the qr.svg icon, the window's CSS, and the four i18n keys only that window used. UIQRCode and the qrcode library stay, since 2FA setup still uses them. The ?auth_token= handler in initgui also stays, because the Playwright e2e harness signs in through it. * Remove the desktop's My Websites window The user menu no longer has a My Websites item. This removes the UIWindowMyWebsites window, its menu item, its CSS, the plug.svg icon only it used, and the i18n keys only it used. When publishing a website or worker hits the subdomain limit, the error now shows only the server's message, without the "Manage your subdomains" link that opened the window. The trash handlers keep fading the website badge on a trashed folder and no longer touch the window's rows. * Remove the desktop's Task Manager window The user menu no longer has a Task Manager item. This removes the UIWindowTaskManager window, its menu item, its CSS, the cog.svg icon only it used, and the i18n keys only it used, including the process_type_* and process_status_* keys it built at runtime. The process model in definitions.js, including END_SOFT and END_HARD, stays: windows still register processes, and a process still forwards an end signal to its children. * Remove the desktop's Change Desktop Background window The desktop's context menu no longer has a "Change Desktop Background…" item, or the separator above it. This removes the UIWindowDesktopBGSettings window, its CSS, the palette.svg icon only it used, and the i18n keys only it used. Desktop backgrounds still work: the saved background loads at boot, and an image's "Set as Desktop Background" item still applies and saves it through /set-desktop-bg. * Remove the desktop's Start menu The taskbar no longer has a Start button, so it begins at Explorer. This removes the Start item and its app popover (recent and recommended apps, search, tile context menu, and drag-to-taskbar), along with: - The taskbar's startup /get-launch-apps request and the desktop's app.opened socket handler, which only kept the menu's lists current - The Start popover's search, click and keyboard handlers in UIDesktop.js, keyboard.js, initgui.js and UITaskbarItem.js - The taskbar's handling of items dropped from outside it, and the UITaskbarItem append_to_taskbar option only that path used - The Start CSS, the start.svg icon, and the i18n keys only the menu used The dashboard's recently used apps still load, since the dashboard fetches its own list and launchApp.js still records launches. UITaskbar.test.js now covers the taskbar's item order and that it doesn't fetch launch apps. * Remove the desktop's Search window The desktop toolbar no longer has a Search button, and Ctrl/Cmd+F on the desktop no longer opens the Search window, so it falls through to the browser's find as it already did on the dashboard. This removes UIWindowSearch, the toolbar button and its handler, the window's keyboard handling (arrow keys, Enter, Escape) and click-outside close, its CSS, the search.svg and magnifier-outline.svg icons only it used, and the i18n keys only it used. The backend /search endpoint is unchanged. * Remove the desktop toolbar The desktop no longer has the toolbar at the top of the screen, so its Puter logo, guest Save Account button, and account menu are gone from the desktop. Log out, account switching, language, settings, and contact all remain on the dashboard. Removed: - The toolbar markup, its auto-hide logic and mouse tracking, its right-click menu, and the account menu with its click handlers - The modify-user-options-menu GUI extension, which only added a Developer item to that menu - UIWindowFeedback, the desktop's Contact Us window, which only the menu opened; the dashboard keeps its own contact dialog - Toolbar hooks elsewhere: the hide_toolbar() call on window maximize, pointer-events toggles during window and item drags, the click guard in initgui, the account-button toggle in helpers.js, and the avatar sync for the toolbar's profile image in TabAccount - The toolbar and feedback CSS, the toolbar's two KV keys from the puter.js GUI read cache, and the i18n keys only these used window.toolbar_height stays: it was already 0, so window and desktop layout are unchanged. The welcome window keeps its backdrop stacking. * Remove the desktop's Share window The right-click menu on desktop and Explorer items, and on items in open and save file dialogs, no longer has a Share item. This removes UIWindowShare, that menu item, the share-outline.svg icon only it used, its CSS, and the share_with and share_row_team i18n keys only it used. The Dashboard keeps sharing through UIShareModal. generateFileContextMenu no longer falls back to the removed window, so it offers Share only when the caller passes onShare, which the Dashboard's Files tab does. The share dialog layout classes the Blocked Senders window uses, and the recipient suggestion styles the share modal uses, stay. * Remove the desktop's Welcome window New desktop users no longer see the Welcome window on their first visit. This removes UIWindowWelcome, the first-visit check in UIDesktop that opened it, its CSS, the welcome_* i18n keys only it used, and the UIWindow backdrop_covers_toolbar option only it passed. has_seen_welcome_window is also dropped from the puter.js GUI boot read cache. Values already saved under that key stay in KV, unread. * Replace the desktop's color picker with puter.js's picker puter.ui.showColorPicker() inside Puter now opens puter.js's own <puter-color-picker>, the one it already shows on websites outside Puter, instead of the desktop's iro-based window. Apps get the same answer everywhere: a lowercase 6-digit hex string, or null when the user cancels. Inside Puter it used to resolve to an 8-digit hex with alpha, or undefined. This removes UIWindowColorPicker, UIColorPickerWidget, iro.min.js and its lib-list entries, and the select_color i18n key only that window used. The GUI loads puter.js from js.puter.com, so the IPC handler doesn't rely on this branch's component: it drops the alpha from an 8-digit default, leaves out a default that isn't a 3- or 6-digit hex, and removes the picker once it answers. <puter-color-picker> drops the alpha from an 8-digit default instead of failing to open, opens on its own color when the default isn't valid, and removes itself when Escape closes it. showColorPicker()'s type and docs now give the 6-digit return value and null on cancel. * Remove the desktop's Publish Worker window The right-click menu on .js files on the desktop and in Explorer, and in open and save file dialogs, no longer has a Publish as Worker item. This removes UIWindowPublishWorker, that menu item, its CSS, and the pick_name_for_worker i18n key only it used. The Dashboard keeps publishing workers through its own dialog. generateFileContextMenu no longer falls back to the removed window, so it offers Publish as Worker only when the caller passes onPublishWorker, which the Dashboard's Files tab does. * Add a Language setting to the dashboard's Account tab The desktop toolbar's account menu was the only place to change Puter's language, so removing the toolbar left no way to change it. The Account tab now has a Language card that shows the current language and opens a dialog listing every supported language by its own name. Saving a new one stores it on the account and reloads the page in it. changeLanguage() now returns false when the language can't be saved, so the dialog can show an error instead of doing nothing. The change_language key comes back in every locale, and language_save_failed is new. |
||
|
|
711ece5800 |
feat(gui): let a first-party page frame the custom domain dialog (#4581)
* feat(gui): let a first-party page frame the custom domain dialog `/embed/attach-custom-domain` joins the framed popups. On a signed-in page one label under the Puter origin, `puter.hosting.attach()` now shows the custom domain dialog in a frame over the page instead of a popup window. Apps, the desktop and every other website keep their current behavior. The frame covers the page with a transparent GUI page, so the dialog floats over it with its own scrim as it does on the desktop. The GUI serves only the framing page's own user, with no account check waiting, and otherwise reports `unavailable`, which leaves the page to open the popup as before. It runs the popup's action unchanged: the framing page is the requester the dialog names, and gets the same `customDomainAttached` answer. Escape is left to the dialog, which doesn't close while a request is in flight, and the frame allows `clipboard-write` for the DNS record copy buttons. A call made while the frame shows resolves null without replacing it, as a second call does on the desktop. * Update RecommendedAppsService.ts * fix(gui): let the framed custom domain dialog finish closing before it answers The answer removes the frame from the page, so the dialog's exit transition never showed. The framed action waits for the overlay to leave first, with the wait the feedback embed already had, now one shared helper. |
||
|
|
d8c3e01dd9 |
fix(http): parse large JSON bodies in slices; store WebDAV uploads labeled as JSON (#4563)
Maintain Release Merge PR / update-release-pr (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
release-please / release-please (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
JSON request bodies over 32 KiB are parsed in slices, with the event loop running between them, instead of in one JSON.parse call. Reading, limits, decompression, req.rawBody and the errors stay as express.json has them. Large bodies parse one at a time. Gemini TTS and video replies use the same parser, and their base64 is checked and decoded 1 MiB at a time. A profile picture is sized before its pattern runs, so one of several megabytes gets a 413. Body parsers skip the dav subdomain: a PUT labeled as JSON or form data was read by them and stored empty, or refused. puter.js sends auth_token as the first field of a driver call. A chat body over 50 MiB that opens with a valid token is accepted up to 128 MiB, as one with a header credential is. JSON in a charset other than UTF-8 is now limited to 1 MiB, and a body over 32 KiB nested deeper than 10,000 levels is refused. |
||
|
|
f26201649a |
feat(gui): let a first-party page frame the deployment's top-up dialog (#4570)
* feat(gui): let a first-party page frame the deployment's top-up dialog
`/embed/top-up` joins the framed popups. Like the upgrade, it covers the
framing page with a transparent GUI page, serves only the page's own
user, and reports `unavailable` unless the deployment defines
`window.UITopUp` with `embeddable === true` and no account check is
waiting. It runs `new UITopUp({ onClose }).open()` and posts
`closed { toppedUp }` once the dialog closes. The frame's lifecycle is the
upgrade's, now shared by both.
`<puter-user-menu>` gets an Add credits item under Usage, shown only when
whoami reports `subscribed: true`. It frames the top-up on a page that can
frame the GUI, and otherwise opens the dashboard with `?topup=` in a new
tab, within the click. Hidden items are skipped by the menu's arrow keys.
`puter.ui.showTopUp_()` is internal; no public SDK method is added.
* fix(puter-js): show no usage-limit dialog over an open top-up
A call refused for funds while the framed top-up was open put the
usage-limit dialog in the top layer over it, covering the payment the
user was making to clear that refusal. The prompt now stays out of the
way while a top-up shows, as it does for the framed upgrade.
* fix(puter-js): leave Add credits out of the user menu for a team seat
whoami reports a seat as subscribed through its team's plan, so the menu
offered Add credits to an account that can't buy any: the dialog only
answers that the team pays. The item now stays hidden when whoami names a
team paying for the account, as the desktop's own menu already does.
* fix(puter-js): open the top-up tab on the page's own deployment
The tab the Add credits item falls back to went to puter.com whatever
GUI origin the page belongs to, so on another deployment it opened a
different one, signed in as whoever is signed in there. It now opens the
dashboard of the GUI origin, like the menu's Usage link beside it.
* fix(puter-js): return keyboard focus to the account button after Add credits
Choosing Add credits closed the menu with focus on the item it had just
hidden, and the frame restored focus to the menu's shadow host, which
can't take it, so a keyboard user was left on the page body once the
dialog closed. The menu now moves focus to its button first, and a
framed popup restores focus to the element inside a shadow root.
* docs(embed): say when the top-up dialog's open() resolves
It resolves after the account has loaded, not as soon as the dialog
shows.
* fix(puter-js): offer Add credits after an upgrade made on the page
The user menu showed Add credits by the whoami it loaded with the page.
A user who subscribed in the framed upgrade therefore found no Add
credits in the menu until a reload. A framed upgrade that reports a plan
now marks the page's cached whoami as subscribed, as a confirmed email
already is, and the menu reads it again each time it opens.
* fix(puter-js): let a top-up that failed to start be asked for again
showTopUp_ cleared its in-flight marker in a finally inside the async
function it stored. A failure before that function's first await, such
as building the dashboard address from an origin with no scheme, ran the
finally before the marker was set, so the marker kept the rejected
promise for good: every later call got the same rejection, and
topUpShowing_ went on suppressing the usage-limit dialog. The marker is
now cleared once the stored promise settles.
* fix(puter-js): keep requestUpgrade from framing the upgrade over an open top-up
The usage-limit dialog already stays away while the top-up shows, but a
page's own requestUpgrade() call, such as one in the handler of a call
refused mid-payment, still mounted the upgrade frame. Frames are single
per path, so it covered the top-up and the payment being typed in it,
and the two dialogs' own guard can't see across documents. The call now
waits for the top-up and resolves { upgraded: false } once it closes.
* fix(puter-js): offer Add credits after an upgrade when whoami was read again
The user menu keeps the whoami object it loaded and ignores a token set
again unchanged, but the SDK reads whoami into a new object each time a
token is set. A framed upgrade then marked the new object as subscribed
and the menu went on reading the old one, so Add credits stayed hidden
until a reload. The menu now reads the SDK's cached whoami when it is
the same account's.
* docs(embed): list the top-up tests among the checks to run
|
||
|
|
8a15f09f48 |
Send one request, not four, after the account pick in the sign-in popup (#4564)
Maintain Release Merge PR / update-release-pr (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
release-please / release-please (push) Canceled after 0s
* Send one request, not four, after the account pick in the sign-in popup A sign-in popup exchanges for the opener's app token as soon as the user picks an account. postAuthActions now hands over that result when the opener origin and session token still match, and exchanges again otherwise. The relationship check is skipped when an account was picked, since the pick already decides both the second picker and consent. Signup in the popup is not a pick and still runs it. The /whoami read before the picker is reused only when the same user and session token are still in place, the exchange just accepted that session, no verification gate is pending, and the read is under a minute old. * Test picking a different account in the sign-in popup The popup has to read the picked account once and hand over a token for it, not for the account it opened with. The second-account helper moves to the shared e2e helpers so both specs that need one use the same copy. |
||
|
|
7494aa1cbc |
Reload a tab when another tab switches to a different account (#4560)
* Reload a tab when another tab switches to a different account Every tab shares one stored session token. A tab that sees a new token appear in storage adopted it whoever it was issued to, so after an account switch in one tab the others kept showing the previous account while sending requests as the new one. A tab now reads the user out of the stored token. A token for the account it already shows is adopted as before. A token for a different account reloads the tab, which comes back up as that account. A tab with no signed-in user, or a token whose user can't be read, behaves as before. * Store a new account's token only after its session cookie is set A tab that sees another account's token in storage reloads and signs in from the session cookie. update_auth_data() stored the token before it synced the cookie, so a tab that reloaded faster than the sync came back up as the previous account and stored that account's token again, which the switching tab then adopted under the new account. The token is now stored after the cookie sync, in the same task as the stored user. * Keep the new account's token when another tab stores one during the cookie sync update_auth_data() sets window.auth_token, then waits for the session cookie sync. A token another tab stored during that wait was adopted over it, so the tab finished the switch holding the previous account's token and saved it under the new account in logged_in_users. The token is set again once the sync has settled. * Create one visitor account for the account switch e2e tests Each test signed up its own visitor, and sign-ups are limited to 10 per 15 minutes, so a few runs in a row failed in setup. |
||
|
|
2394221745 |
Answer requestEmailConfirmation() once, and show it in a frame on first-party pages (#4551)
* Answer requestEmailConfirmation() once, and show it in a frame on first-party pages
puter.ui.requestEmailConfirmation() in an app opened a second code dialog
after the first: a confirmed user got a dialog they couldn't complete and
two answers, and an unconfirmed one entered the code and then got a second
dialog, whose result was the only answer. The desktop handler now runs one
walk-through and answers once with its result.
That walk-through is ensureConfirmedEmail: save a temporary account, then
ask an unconfirmed email for its code, each window at most once. Publishing
a website or worker uses it too, replacing two copies of the same steps.
The code window now resolves false when it closes without a confirmation,
so dismissing it answers the app instead of leaving it waiting, and it
marks window.user confirmed before resolving, so a caller that checks next
doesn't ask again before the refresh lands. A logout from its footer still
leaves it unsettled, so the boot gates don't reopen it. In the dashboard
the windows open above the app's window, which stays on top and covered
them.
On a signed-in page one label under the Puter origin, the call now frames
/embed/request-email-confirmation over the page, served like the upgrade
frame, and resolves { response }, the field an app reads from the
desktop's answer. The GUI shows it only for the framing page's own user
with no phone, card or password check waiting. It skips the boot's
non-closable email gate for this action, so the user gets one code window
they can close or Escape. An email already confirmed resolves true without
showing the frame. A frame that can't show it resolves { response: false }.
* Skip the email confirmation frame when the page knows the email is confirmed
A confirmed email never goes back to unconfirmed, so requestEmailConfirmation()
on a first-party page resolves { response: true } from the page's whoami
instead of booting the GUI in a frame behind a loading scrim.
* Close the framed email confirmation on Escape in the save-account window
A temporary account sees the save-account window first, where Escape did
nothing, while it closed the code window that follows.
* Let the email code window recover from a failed code check with no response body
A network failure has no JSON body, so reading its error threw, leaving the
window spinning with its inputs disabled. It now shows an unknown-error message
and lets the user try again.
* Answer an email confirmation asked for while one is showing with the windows already open
A second walk-through opened a second code window over the first, and for a
temporary account it never answered, since the save-account window opens once.
* Read the email code from the code window it was typed in
A second code window read the inputs of the first one on the page, so typing
in it never filled in the code or enabled its button.
* Keep the email code window's answer in step with a code check it was closed during
Closing the window while a code was being checked answered false, and the
check went on to confirm the email. A code not sent yet is no longer sent, and
the window waits for one already sent before it closes.
* Show why a new email code couldn't be sent
A failed re-send, such as one past the hourly limit or a network failure,
showed nothing, so the link seemed to do nothing.
* Skip the email confirmation frame on calls after the user confirmed in one
The page's cached whoami kept reading the email as unconfirmed, so each later
call framed the GUI again and flashed its loading scrim before resolving true.
* Leave the email code window unsettled when any logout closes it
Only a logout from its footer did. One from elsewhere, such as after a 401,
answered false, so the boot's email gate opened a new code window while the
page was navigating away.
* Hide the save-account window while its email code window shows
A save-account window with a backdrop stayed under the code window's own, so
the page behind was dimmed twice, and on a phone the window showed around the
code window's edge.
* Answer a save-account request made while the save-account window is open
The window opens once, so the second request got no window and never
answered, which left an email confirmation that asked for it waiting too.
* Answer a framed email confirmation closed with Escape with the code check it was closed during
Escape in the framed code or save-account window closes that window, and the window's answer closes the frame. A code already sent is waited for, as it is when the window's close button is used. Before, Escape closed the frame and answered false while the check went on to confirm the email.
|
||
|
|
7aadc48cca | Add service speed selection and billing to AI chat | ||
|
|
9a86803418 |
Show the upgrade in a frame on first-party pages (#4541)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
release-please / release-please (push) Canceled after 0s
Maintain Release Merge PR / update-release-pr (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* Show the upgrade in a frame on first-party pages
puter.ui.requestUpgrade() on a signed-in page one label under the Puter
origin now frames /embed/upgrade over the page and resolves { upgraded }
once it closes. The usage limit dialog's Upgrade button does the same on
those pages instead of opening the dashboard in a new tab. Apps, the
desktop and every other page keep their current behavior.
/embed/upgrade is served like the sign-in and picker frames: the GUI
shell with the same framing rules, query and exact-path redirects and
no-store. The GUI shows the deployment's upgrade dialog
(window.UIUpgradeAccount) only for the framing page's own user, with
nothing left to verify, and only when the dialog says it reports its
close (UIUpgradeAccount.embeddable). Otherwise it reports unavailable and
the page opens the dashboard upgrade in a tab, through a consent dialog
when the click has expired. The app it credits is resolved from the
framing page's origin, never read from the fragment.
The frame covers the page with a transparent GUI page so the dialog's own
scrim shows, allows payment, and leaves Escape to the dialog. A call made
while it shows settles with it. If every dialog and window in the frame
goes without a close being reported, the frame closes itself rather than
staying over the page.
* Open the framed upgrade only once the frame has a viewport
The page keeps a loading frame hidden, which Chromium and WebKit lay out at
0x0. The team-seat alert, a GUI window that centers itself when it opens,
landed at (-175, 0) with its message and OK button cut off. A hidden frame
now tells the page it's ready first, and opens the dialog on the resize that
follows, or after a second if none comes.
* Document when the framed upgrade posts ready
* Retry a framed popup's focus() that the frame ignored
Firefox and WebKit ignore focus() inside a frame for a moment after the
page shows it, and Firefox sends no focus event afterwards, so the framed
upgrade dialog and its team-seat alert opened with nothing focused there:
Enter didn't press OK and screen readers didn't land in the dialog. A
focus() that didn't take is now retried briefly, until the user presses a
key or the pointer.
* Keep the framed upgrade's GUI in the light color scheme
The transparent upgrade frame put `color-scheme: light dark` on body as
well as the root, so in dark mode form fields the GUI leaves at browser
defaults turned dark. The email confirmation code digits showed slate
text on a dark grey field inside a white window. Only the root needs to
match the frame's scheme to stay transparent; body now keeps the light
scheme the GUI uses everywhere else.
* Fall back to the upgrade tab when the framed dialog fails to open
If the deployment's upgrade dialog threw while opening, the frame reported
a close, so requestUpgrade() resolved { upgraded: false } and the user's
click did nothing. It now reports itself unavailable, and the page opens
the dashboard's upgrade page as it does for any frame that can't show it.
* Say which plan changes count as upgraded in UpgradeResult
The upgrade dialog sets `upgraded` only for a subscribe or an upgrade;
a downgrade, cancellation or resume closes with false. The type said any
plan change counted.
* Stop the page scrolling behind a framed GUI embed
Firefox and WebKit pass a wheel or touch scroll over a frame on to the
page behind it, whatever the dialog's overscroll-behavior, so scrolling
over the framed upgrade, sign-in or a picker scrolled the page under the
scrim. The page's root now stops scrolling while an embed shows, taking
a classic scrollbar's width as padding so its content doesn't shift, and
gets its own styles back once the last embed closes.
* Skip the usage limit dialog while the framed upgrade shows
A refused call while the upgrade shows in a frame over a first-party
page opened the usage limit dialog on top of it, which made the upgrade
dialog inert until the user closed it. The refusal still rejects.
* Restore the page's root styles after an embed the page removed
An embed dialog the page removed itself never unlocked the page scroll,
and the next embed read the locked styles as the page's own, so the
page stayed unscrollable once it closed. The page's styles now go back
before the next lock reads them.
* Open the upgrade tab when the page can no longer frame it
The usage limit dialog decided to frame the upgrade when it opened, so
an Upgrade click after the page signed out did nothing. onUpgrade now
returns false when the page can't frame it, and the dialog opens the
dashboard tab as it does without onUpgrade.
* Keep the upgrade showing until its tab consent is answered
When the framed upgrade fell back to a consent dialog, requestUpgrade
settled as soon as the dialog showed. A refusal meanwhile opened a usage
limit dialog over it, and a second call asked again. The upgrade now
counts as showing until the user answers, so both join it.
* Say where requestUpgrade never settles
Its JSDoc named only apps, though on any website that can't frame the
upgrade the promise doesn't settle either.
* Treat a GUI embed the page removes as dismissed
A page that re-renders its body took the embed's dialog with it, and the
embed's promise never settled. For the upgrade that left it counted as
showing for good: later requestUpgrade() calls joined the dead one, no
refused call opened the usage limit dialog again, and the page stayed
unscrollable.
* Let the framed upgrade credit the remembered prompt when it knows none
When the framing page's origin resolved to no app and the call named no
reason or method, the frame handed the dialog an empty attribution. The
dialog then remembered that as the latest prompt, erasing another app's
credit, and sent the purchase with no attribution at all. It now gets
null, as from every other entry point.
* Pad the page by the width its scrollbar gives back behind an embed
A page with scrollbar-gutter: stable keeps its gutter once the root stops
scrolling, so padding it by the scrollbar's width as well shifted its
content left while any GUI embed showed. The lock now measures how much
width the root actually gets back.
* Keep the page's scroll position behind an embed when its body scrolls it
A page whose body carries the viewport's overflow (html and body at 100%
height, body with overflow-x hidden) jumped to the top while an embed
showed, and stayed there after: hiding the root's overflow made the body
a scroller of its own. The lock now hides the overflow of whichever
element the viewport uses, and restores a single-axis inline overflow.
|
||
|
|
0fdf40b8da |
Fill the send-feedback popup with the feedback dialog; fix <puter-user-menu> arrow focus (#4539)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Maintain Release Merge PR / update-release-pr (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
release-please / release-please (push) Canceled after 0s
* Fill the send-feedback popup with the feedback dialog The popup opened by puter.ui.showFeedbackDialog() drew the floating modal over a scrim. It now fills the window like the custom domain popup, with the actions pinned to the bottom and the message box taking the spare height. The full-page styles move from .custom-domain-fullpage to a shared .app-feedback-fullpage on the modal shell. * Land the first ArrowDown on the first <puter-user-menu> item after a click Opening the menu with the pointer focused the first item without a visible focus ring, so ArrowDown appeared to skip it. A pointer open now focuses the menu itself; opening from the keyboard still focuses the first item. |
||
|
|
5b850113ff |
Show sign-in and file pickers in a frame on first-party pages (#4537)
* Show sign-in and file pickers in a frame on first-party pages
puter.auth.signIn(), showOpenFilePicker(), showSaveFilePicker() and
showDirectoryPicker() on a page one label under the Puter origin now
show the GUI popup in a frame over the page instead of a window. Every
other page, and any frame that can't serve the request, keeps the popup
exactly as before, so apps need no changes.
/embed/sign-in and /embed/show-{open-file,save-file,directory}-picker
render the normal GUI shell with the framing rules, query redirect and
no-store of /embed/apps, and name the framing page (read from the
referrer, pinned with frame-ancestors) as embed_host_origin. The GUI
runs the popup boot unchanged with that page as window.opener; close()
asks it to remove the frame. Popup parameters come from the fragment
(msg_id, options, request_auth, and user for a picker).
Sign-in has a close button that rejects with auth_window_closed, as
closing the popup does. A federated provider can't be framed, so
choosing one continues in the popup. attempt_temp_user_creation and
cross-origin isolated pages keep the popup.
Pickers frame only for a signed-in page whose user owns the GUI
session; otherwise the GUI reports unavailable and the page opens the
popup, through a consent dialog if the click has expired. The page
keeps its own token rather than adopting the one sent with the answer.
The feedback embed and the new frames share one loading/ready state
machine in guiEmbed.js.
* Close a framed picker when Escape cancels it
Escape closes only the picker window inside the frame, so the frame now
closes with it. The mismatched-user e2e test waits for sign-in's whoami
before naming another user, which it could otherwise overwrite.
* Close a framed sign-in on Escape
The sign-in shows as a page in the frame, which ignored Escape. Escape
now asks the framing page to close it, as its close button does, unless
a request is in flight.
* Focus a framed sign-in once the page focuses the frame
A cross-origin frame's focus() calls do nothing until the framing page
focuses it, so the sign-in opened with focus on the body: keys missed
the form and Escape never reached the dialog. The screen now takes
focus when the frame gains it, unless something already has it.
* Skip the frame on subdomains the server refuses to let frame
The SDK framed embeds from any page one label under the GUI origin, but
the server refuses its own subdomains (api, docs, apps, ...). On those,
sign-in and the pickers waited on a refused frame before opening the
popup, which Safari could then block for want of a recent click. They
open the popup straight away now, and the user menu hides Apps there,
as its docs say.
* Keep a framed picker on the framing page's user
With several saved accounts, a framed picker could still show the
account picker (no grant yet, or request_auth in its fragment). Picking
another account switched the session inside the frame, and the picker
then ran with the first user's details and the second user's token,
saving that token under the first account. A framed picker already
holds the framing page's user, so it no longer offers to switch, and
its user check no longer writes the boot's shared whoami.
* Take a save picker's file only from the page that asked
The save picker opened a dialog for every showSaveFilePickerPopup
message from any window. In a frame, a sibling frame of the framing
page can reach it, so it could supply the bytes the user then saved,
or stack extra dialogs. The picker now takes the file once, and only
from its opener.
* Reopen a framed embed that reloads itself into a refused frame
A reload or navigation the embed starts itself names the embed as its
referrer, so the server refuses the framing: logging out at an account
gate, a sign-out in another tab, or a reset session left a blank box.
The page now shows its spinner and opens the embed again itself, once
per ready, and falls back as for a refused frame if that fails too.
* Correct why a temporary-account sign-in keeps the popup
notes.puter.com and puter.com are the same site, so browsers don't
partition the frame's storage. The popup is kept because only it
creates a temporary account.
* Remove the picker's consent dialog once answered
The consent dialog a picker shows when its click has expired was
closed but left in the page after Continue or Cancel, one element per
fallback. It is removed now, as the other consent dialogs are.
* Name the embed dialog for assistive tech
The modal dialog around a framed embed had no accessible name, so
screen readers announced an unnamed dialog. It is labelled with the
frame's title.
* Expose an embed's loading status only while it shows
The spinner is faded out rather than removed, so assistive tech still
read a Loading status over a frame that was ready. The status is
hidden from it whenever the spinner isn't showing.
* Let a popup frame fill in texted codes
Signup and the account checks fill a texted code in through WebOTP,
which a cross-origin frame may only use when allowed. Popup frames now
allow otp-credentials, so the code fills in as it does in the popup.
* Close a popup frame on Escape from the page too
Once a popup frame was ready, Escape with focus on the page (after a
click on the scrim) only moved focus back into the frame, so it took a
second Escape to close, and none if the frame stopped responding. It
now closes the frame, as Escape inside it does. The feedback embed
still leaves dismissal to the embed.
* Keep scrolling over an embed's scrim from scrolling the page
A wheel or swipe over the scrim around a framed embed chained to the
page behind the modal. The dialog now contains its overscroll.
* Frame a GUI popup only at its exact path
Routes match case-insensitively and with a trailing slash, so another
spelling of /embed/<action> was served frameable while the shell booted
the desktop for it. Any other spelling now redirects to the exact path.
* Prefill a web save picker with the suggested name
The popup and framed save pickers ignored suggestedName and opened with
an empty filename, unlike the save picker an app gets in the desktop.
* Open a provider picked in a framed sign-in straight in the popup
Picking a provider in the framed sign-in fell back to the sign-in popup,
where the user had to pick the provider again. The frame now hands the
page the provider's start URL for its sign-in, and the page opens the
popup there after checking it is the GUI's OIDC start for that sign-in.
* Open the popup straight away for a page framed by another site
frame-ancestors on the embeds allows only the GUI and the framing page,
so a first-party page inside another site's frame waited about a second
on a refused frame before sign-in or a picker opened the popup, by which
time Safari asks for another click. Such a page opens the popup straight
away now, as it did before the frame.
* Close a framed sign-in on Escape at its account checks
Escape closed the framed sign-in on its auth screens but did nothing once
signup moved on to confirming the email, phone or card, which show as
windows. Escape there now closes the frame as well, as its close button
does.
* Leave Escape that cancels an IME conversion to the IME in sign-in
In a framed sign-in, Escape pressed to cancel an IME conversion in a
field also closed the sign-in, losing what was typed. The auth screens
and the account checks now leave an Escape mid-composition to the IME,
as the dashboard's text fields do.
* Fade in a popup frame's scrim and box
The scrim behind a framed sign-in or picker, and the box's white
background, appeared at full opacity in one frame while the GUI's content
faded in over them. Both now fade in briefly, unless the user prefers
reduced motion.
* Keep a page's own styles off a popup frame's dialog, frame and close button
The dialog, its frame and the close button live in the page's document, so
a page's global dialog, iframe and button rules reached them: a transform
that centers the page's own dialogs moved the overlay half off screen, an
iframe max-width shrank the frame inside its box, and button margins and
min sizes turned the close button into a pill. The dialog and frame now
reset those properties inline, and the close button starts from all:unset.
* Fall back to the popup when a reopened embed frame never loads
After a refused self-reload the page opens the embed again, but nothing
timed that second start: a stalled request left the loading spinner up
until the user dismissed it, which settled the request as closed instead
of opening the popup. The reopened frame now gets the same ready timeout
as the first start.
* Hand a save picker frame its file again after it reloads
The page answered a picker's sendMeFileData once and then stopped
listening. A framed save picker that reloads asks again, and without an
answer it never opened its dialog, so the page waited out the ready
timeout and fell back to the popup. A frame is now answered until it
closes; a popup is still answered once.
* Keep a popup frame's white backing off its rounded edge in dark mode
The box's white background shared the frame's anti-aliased corner, so a
light arc showed around the dark sign-in. The backing now stops 1px inside
the edge, which leaves the curve to the frame and the scrim.
* Center a popup frame's box with margins so it fills a phone edge to edge
On a phone with a fractional pixel ratio the translate that centered the
full-screen box left it a fraction of a pixel short of the top, so a line
of scrim showed above the sign-in. Margins snap to device pixels.
* Focus a framed save picker's file name as the popup does
A cross-origin frame's focus() does nothing until the page focuses it, and
the page focusing it again resets it, so the framed save picker opened with
nothing focused and typing went nowhere. A framed popup now gets its latest
focus() back whenever the frame gains focus with nothing focused, until the
user presses a key or the pointer in it.
* Replace a showing popup frame instead of stacking a second one
A double click on a page's picker button framed two GUIs, one over the
other under two scrims, and the user had to cancel twice. A popup reuses
its named window instead. Now a newer popup frame dismisses the one
showing, which settles it as closed.
* Share one framed sign-in between calls made while it's open
A double click on a page's sign-in button started a second framed
sign-in, which replaced the first and rejected it as closed while the
user was still signing in. A call made while a framed sign-in with the
same request_auth is open now settles with it.
* Close only a context menu on Escape over a file dialog
Escape to dismiss a right-click menu in a file dialog also closed the
dialog, which cancels a picker and, in a framed picker, removes the whole
frame. An open context menu now takes the Escape on its own.
* Document that one popup frame shows at a time
* Keep a save dialog's file name and buttons on a phone's screen
The save dialog's bottom bar couldn't shrink below the file name's own
width, so on a phone it spilled off both edges: the name's start and
the Save button were cut off. A framed save picker fills the phone, so it
always hit this. The name now shrinks to fit.
* Keep a file dialog's buttons on one line on a small phone
On a 320px-wide screen the open picker's Open button wrapped under
Cancel and ran into the screen's edge, and Upload wrapped under its
icon. The buttons now stay on one line, with less side padding up to
480px wide so the save dialog's file name keeps room to show.
* Say what a picker is for when its popup needs a click to open
When a framed picker falls back to the popup after the click expired,
the consent dialog said the page used Puter for AI and Cloud features,
not that it wanted a file or folder. It now names the picker, as the
push notification dialog does.
* Share a framed sign-in with a call that differs in request_auth
Implicit auth asks with request_auth, so an explicit signIn() made while
it was open replaced its frame and rejected every puter.* call waiting
on it. Any framed sign-in in progress is now joined.
* Keep a popup frame open when a frame for another popup shows
A sign-in replaced a showing picker frame, cancelling the picker, and
the other way round, though their popups have different window names and
stay open together. Only a frame for the same popup is replaced now.
* Reopen a refused embed frame in WebKit
WebKit took the refused URL as a fragment navigation of its error page
and loaded nothing, so a frame that reloaded itself fell back to the
popup. The frame is reopened through the server's query redirect, which
keeps the fragment.
* Go back to the save picker on Escape at its replace prompt
Escape closed the alert without an answer, so the save waited on it
forever behind the picker's busy mask. In a frame nothing could close
the picker after that. The alert closing now counts as Cancel.
* Leave Safari's IME-ending Escape alone at a framed sign-in's account checks
Safari sends the Escape that ends an IME conversion with keyCode 229 and
isComposing false, so it closed the framed sign-in. The auth screens
already check for it.
* Keep an open dialog's buttons whole on a small phone in German
At 320px, German's longer labels pushed the Open button past the screen
edge, since the upload label couldn't shrink and the buttons could. The
upload label now gives way, cut off with an ellipsis.
|