mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-26 15:48:41 +00:00
5b8e0576fdffbe14dc882d2ce27eac47405738e4
1862
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5b8e0576fd |
feat(auth): the SMS-to-card fallback follows what the account owes (#4748)
A card stands in for the phone step only on an account that neither owes a card nor has verified one. A number on file is still stood in for by the card on file. An account that owes both keeps both steps. `puter.phone-verification.check` gains two optional fields: - `countsTowardFallback: false` keeps a refused send out of the count that opens the fallback. Refused sends count by default, as before. - `refuseWithoutFallback` keeps a `card_fallback_instead` refusal in place when there is no fallback to offer, instead of letting the send through. GUI: a message for a card the verification doesn't accept, and the virtual-number message no longer mentions a card (the card link shows on its own when one is offered). |
||
|
|
d0a75e3b2e | fix(gui): a file picker's grid runs down to its button bar (#4750) | ||
|
|
9fba208387 |
feat(gui): file pickers look and work like the dashboard's Files tab (#4746)
* feat(gui): file pickers look and work like the dashboard's Files tab The open, save and directory pickers draw the Files tab's listing: its folders sidebar, breadcrumbs and typed paths, list and grid views, column sorting, thumbnails, selection with Shift/Ctrl/Cmd and drag, and its keyboard. Their rows and markup come from one module, fileListing.js, that the Files tab now uses too. - New FilePicker (listing) and filePickerDialog (button bar, answers). UIWindow keeps its picker options and data attributes; callers are unchanged. Pickers no longer use the explorer item container, so their branches in openItem, UIItem, uploadSelection and refreshItemContainer are gone. - The Open button and a double-click send one answer through one path. - The Files tab and UIDashboard look up their own elements only, so a picker over the dashboard doesn't share their selection or crumbs. - An app's open or directory picker closed with Escape or its close button reports a cancel; the folder a directory picker is open in comes back with a ~/ path. - Pickers can create folders, rename, move to Trash, upload (open) and take dropped files; their menus no longer launch apps. - upload_items takes an onUploaded callback, so a picker selects what it just uploaded even in a popup, which has no socket. * fix(gui): no gap above a narrow file picker's folders Below 768px the Files tab pads its folders column down past the dashboard's menu toggle. A picker has no toggle. * fix(gui): a file picker's folders keep the Files tab's 10px inset The dashboard insets the Files section by 10px; a picker has no such wrapper, so a hovered folder's highlight met the dialog's edge. * style(gui): less room above a file picker's first folder * fix(gui): a save picker's double-click and Enter don't save where Save is disabled Double-clicking a file, or pressing Enter on it, in a save picker names the save after it and presses Save. That ran the save even with the button disabled: in the Trash, the Shared view or a view-only share. The Save handler returns while the button is disabled. * fix(gui): a save picker saves into the folder being opened, not the one before it A folder opened in a picker becomes its current folder once the listing arrives. Save pressed before then wrote into the folder that was on screen before. The picker now exposes the folder a listing is on its way for, and Save goes there; it's also disabled at once when that folder takes no saves. * fix(gui): a file picker's sort arrow follows the click, not the re-listing Clicking a column header or a Sort menu entry re-reads the folder, and the header's arrow only moved once that answered. It moves with the click now, as the Files tab's does. * fix(gui): a file picker's row keeps its fitted name when a rename fails A rename the server refuses puts the old name back cut to the desktop's fixed length, which is shorter than the row has room for. The picker fits the name to its row again. * fix(gui): a file picker fits its names again when it's resized Names are cut in the middle to the room their row has when it's drawn. Resizing the picker left them as they were: still cut short in a wider window, and overflowing in a narrower one. The picker watches the listing's width and fits the names again, at most once a frame, as the Files tab does. * fix(gui): a file picker keeps the keyboard on its listing The picker's keys only work while the keyboard's focus is inside it, and several clicks took the focus away or left it on the wrong thing: - A click on a sidebar folder, a nav arrow or a toolbar button left that control focused. The arrows still moved the selection, but Enter went to the control: it opened the folder again instead of the selected row. The arrows and type-to-select now hand the focus to the listing, as the Files tab's do. - A click on a crumb, on a menu entry, on the picker's head or button bar, and Enter in a rename left the focus on the page, where no key reached the picker. The listing takes the focus back in each case. A crumb reached with the keyboard keeps the focus on that folder's crumb. * test(e2e): the directory picker test waits for the first picker to close The test picked a folder and asked for a second picker at once. The first picker's window was still closing, so the second one's locator matched both windows and the test failed every run. * fix(gui): a file picker's crumbs start at its edge on a phone Below 480px the Files tab moves its crumbs and path field 50px in, to clear the dashboard's menu button. A picker has no button there, so its crumbs sat behind an empty gap, out of line with the arrows under them. * fix(gui): the keyboard returns to a file picker's listing from the path field and a cancelled rename Enter or Escape in the path field, and Escape in a row's name, hid the field while it still held the focus. The listing doesn't take the focus from a field, so it stayed on the hidden one and then fell to the page, where the picker's keys don't work. The field is blurred before the listing takes over. * fix(gui): Enter opens the files just uploaded in a file picker An upload started with the picker's Upload button ends with the uploaded files selected and the focus still on Upload, so Enter asked for more files to upload. The listing takes the focus once the upload is in. * test(e2e): a file picker's keys work after a click on a sidebar folder or a crumb * fix(gui): a change made elsewhere doesn't close a file picker's path field A picker lists its folder again when another tab or device changes something in it. Every listing closed the path field first, so a path being typed was dropped mid-word, and Enter pressed just before the re-listing was ignored. Only opening another folder closes the field. * fix(gui): a file picker still opens a folder when it's sorted or re-listed before the folder arrives * fix(gui): a file picker's alerts open above it and hand the keyboard back when they close * fix(gui): a save picker's name errors show their quotes instead of HTML entities * fix(gui): the Files tab leaves the keyboard on a file picker's crumb when it lists its folder again * fix(gui): a rename made elsewhere doesn't move a file picker's row into the Files tab * fix(gui): a file picker doesn't answer with a file that can't be signed * fix(gui): a file picker keeps a selection made while its folder is being listed again * refactor(gui): UIWindow drops the last of the old file dialog |
||
|
|
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. |
||
|
|
5048007254 |
feat(gui): show thumbnails for uploaded text, YAML and HTML files (#4738)
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(gui): show thumbnails for uploaded text, YAML and HTML files A .txt, .yml, .yaml, .html or .htm file, or one typed as plain text, YAML or HTML, gets a thumbnail of its first lines, drawn as source code is but in one color: an HTML file shows its markup, not the page it makes. Markdown, CSV and source files are matched by name first, since a browser can type any of them as plain text. These files go through the text queue, deadline and 16 KiB read of the other text files, and the dashboard downloads only that much of one that has no thumbnail. In the Files tab's list rows they show their type icon, as other text files do. * fix(gui): wrap the lines of a text file thumbnail, each as its own paragraph A text file's lines ran off the page as source code's do, so a note written one paragraph to a line showed only the start of each paragraph, and a line in a right-to-left script was drawn left to right. A text file now wraps each line inside the page, and a right-to-left line runs from the right. YAML and HTML are one-color languages beside JavaScript, CSS and JSON, and still run off the page as code does. * fix(gui): show the type icon in list rows for text drawn by its type A list row shows a page's type icon instead of the page, but told a page by the file's name alone. A text file the generator draws because of its type, such as a .log or .text file typed text/plain, kept its thumbnail in list rows, where a page is a blank square. The type now counts too, with or without a charset. * fix(gui): read text saved as UTF-16 for its thumbnail Notepad and Excel save Unicode text as UTF-16, and Windows PowerShell writes redirected output that way. Its NUL bytes made such a file look like it wasn't text, so it kept its file icon. Text that starts with a UTF-16 byte order mark is now decoded as UTF-16. |
||
|
|
38ca3d9a76 |
feat(gui): confirm before trashing a worker's source file (#4742)
* feat(gui): confirm before trashing a worker's source file Moving a worker's source file, or a folder that holds one, to the Trash now asks first and deletes those workers when the user agrees. Workers are found by prefix-matching the user's worker list against the trashed paths, so folders aren't walked; the list is cached for a minute and dropped when a worker is published or deleted. * fix(gui): refresh the worker list after a rename or move The cached list keeps each worker's source path, so a folder renamed or moved within the minute went to the Trash without a warning, and a folder a worker's file had just left asked to delete that worker. A move, rename or update heard over the socket now drops the cache; a move into the Trash keeps it. * fix(gui): trash anyway when a listed worker is already gone A worker deleted from another tab or the CLI since the list was cached made the delete fail with not_found, so the user saw "Worker not found" and nothing went to the Trash. That worker is already in the state the user agreed to, so the move goes ahead. * fix(gui): say which worker failed and that nothing was trashed A failed worker delete showed only the raw error, with no title, so the user couldn't tell which worker it was or whether their items had gone to the Trash. The dialog now has a title, names the worker, and says nothing was moved. * fix(gui): show the trash worker dialog over every window The dialog mounted on the body at the dashboard overlay's z-index, but phones and tablets pin every window, the dashboard included, at 9999999, so there the confirm sat hidden and trashing seemed to do nothing. Any window can trash, so the dialog now stacks over all of them, as the auth dialog does. * fix(gui): ask once when Delete is pressed again before the dialog A second Delete press while the worker list was loading opened a second confirm for the same items, so the user had to answer twice and the second answer acted on items already gone. A repeat check for the same paths while one is pending is now dropped; the first one trashes them. * fix(gui): bring back the phone selection bar when a trash is cancelled The Delete button in the phone selection bar hid the bar before trashing. Cancelling the worker dialog, or any other dialog that stops the trash, left the rows selected with no bar to act on them. The bar comes back when a selected row wasn't trashed. * fix(gui): stop waiting on a stalled worker listing after 10s The listing goes through the SDK's 15-minute idle limit, so a backend that stopped answering left Delete doing nothing, and a second press was dropped as a repeat. After 10s the trash goes ahead without the warning, as it does when the listing fails. * fix(gui): name every worker that couldn't be deleted When several worker deletes failed, the dialog named only the first, so the user didn't know the others were still running. It now lists each one with its error. * fix(gui): space lists in dashboard dialogs like paragraphs A list in a dialog's message kept the browser's margins and 40px indent, leaving a gap under it larger than the body's padding. It now takes the paragraphs' spacing and a 20px indent. |
||
|
|
c0717947d1 |
feat(gui): show thumbnails for uploaded iWork, OpenDocument, Sketch and EPUB files (#4685)
* refactor(gui): give the ZIP reader and the image-type check modules of their own The reader of a ZIP archive's directory and entries moves from ooxml.js to zip.js, and telling an image's type from its first bytes moves from audio.js to images.js, so that readers of other packaged formats can use both. The archive's read budget gets a name of its own, with the value it had. What the existing readers do is unchanged. * feat(gui): show the preview a packaged document carries as its thumbnail Some formats are archives that hold a picture of the document, made by the editor that saved it. On upload, the desktop takes that picture and passes it to the image thumbnail generator: - Pages, Numbers and Keynote keep preview.jpg and a smaller preview-web.jpg, and files from before 2013 QuickLook/Thumbnail.jpg. - OpenDocument text, spreadsheets and presentations keep Thumbnails/thumbnail.png. - Sketch keeps previews/preview.png. - An EPUB's cover is found through its container and package document, by the EPUB 3 property, the EPUB 2 metadata entry, or its name. Nothing is rendered, and the image's type comes from its own first bytes. A file with none of these, such as a template or a text file with the name a Keynote file has, keeps its file icon. These files share the queue and the 5 second deadline of Office documents, and a stored preview may be up to 8 MiB, which is published with the other limits. In the Files tab's list rows, Pages, Numbers, Keynote and OpenDocument files show their type icon, as other documents do. A Sketch preview and a book's cover show in list rows too. * fix(gui): scale one packaged document's picture at a time The upload generator is called for every file at once, and the stored preview was scaled outside the queue that read it, so a folder of books decoded all their covers together. Each picture is now scaled inside the queue, as audio covers are. * fix(gui): skip a stored preview that states more than 16 megapixels A packaged document's preview or an EPUB's cover went to the image generator at whatever size it stated, and a picture is decoded at full size before it is scaled. A preview over 16,777,216 pixels is now passed over for the next one the file holds, as pictures in Office documents and HEIC photos are. pixelSizeOf() moves to images.js beside imageTypeOf() and reads WebP, so a WebP preview keeps its thumbnail. * fix(gui): find an EPUB cover whose path holds an XML entity The paths an EPUB's container and package document give are XML attribute values, so a cover at "Tom & Jerry.jpg" is the entry "Tom & Jerry.jpg". The entities in them are now decoded before the percent-encoding is. * fix(gui): pass over a damaged preview entry for the next one a package holds * fix(gui): try each cover an EPUB declares until one is a usable picture * test(gui): import the ZIP fixture with the DOCX one it sits beside |
||
|
|
59524cc580 |
feat(auth): phone on file step, email replacement while unconfirmed, no lock without email (#4707)
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(auth): phone on file step, email replacement while unconfirmed, no lock without email - Phone gate on an account that already has a number: /send-confirm-phone sends the code to that number and ignores any other, /confirm-phone checks only that number, and `lostNumber: true` opens the card fallback (409 when there is none). The send response and whoami carry `phone_on_file`, the number's last two digits; the phone window drops the number field for it. - /user-protected/change-email runs while the email code is pending, with every other gate still applied, for an account with a verified phone, card, paid plan or second factor; otherwise the code is still required. Provider-only accounts keep the code. Confirming the replacement runs the same side effects as confirming the code. The email window gets a step for it. - The per-account wrong-password lock skips accounts with no email; the failures still count and alarm. - puter.signin.validate carries `credential_exposed`. - GUI gate flows read the account again between gate windows and before opening one. * feat(auth): a number on file is stood in for only by the card on file; two codes a day - The card fallback for a phone on file opens only when the account already has a card, and confirming it clears the phone step only when the card's fingerprint matches the one on file (`card_not_on_file` otherwise). - Codes to a number on file: two per account per day; past that the route answers 429 `phone_on_file_send_limit` and offers the card on file. - Phone window drops the signup help line in on-file mode; the email window's footer no longer shows a stray separator in the change step. * feat(auth): replacing an unconfirmed email takes a factor the account had before A phone or card first verified while the address is unconfirmed is recorded in the account's metadata (`factorsAddedWhileEmailPending`), before it is stored, and no longer counts toward /user-protected/change-email. A number on file proven again and the card already on file still count, as do a second factor and a paid plan. The route no longer asks for a new factor; with none from before it answers `email_confirmation_required`, and the email window says the code is needed. * feat(auth): email replacement and the card stand-in each take proof in hand - Replacing an unconfirmed email: a dormant sign-in records, once, the number the account had (`phoneAtDormantSignIn` in metadata). The change is allowed only when the account still has that number and proved it within the hour, by its code or by the card on file; otherwise the route starts the phone step for it, or answers `email_confirmation_required`. A phone or card merely being on the account, a paid plan, and a number or card verified since no longer count. This replaces the list of factors added while unconfirmed. - Card confirmation while a number on file waits: only the card already on file verifies, under any gate order. The confirm event carries `required_fingerprint`, and the listener reports `card_entered` (details typed for this confirmation, not a saved card or an old confirmation); both are checked. - A card fallback opened earlier no longer offers a card to an account whose number on file has no card to stand in for it. |
||
|
|
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. |
||
|
|
31d9f2a89c |
feat(thumbnails): JSON and CSV files get a thumbnail (#4699)
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
* feat(thumbnails): JSON and CSV files get a thumbnail
The desktop draws the start of a .json file like other source code, in a
fixed-width font with keys, strings, numbers and comments colored. A JSON
file whose first line holds a comma, as minified JSON does, is laid out
first one member or element to a line. That layout stops after 64 lines
and indents no deeper than 16 levels, so a file of nothing but brackets
costs no more than any other.
A .csv file is drawn as a spreadsheet opens it, through the sheet drawer
the XLSX reader uses: gridlines, default-sized cells, numbers aligned
right and other text left. Quoted fields follow RFC 4180, and the
delimiter is whichever of comma, semicolon, tab or bar the first line
holds the most of. Cell text is drawn as text; nothing is evaluated.
Both read only the first 16 KiB and share the 2-second upload queue the
other text files use. The dashboard downloads only that much when it
makes a thumbnail for one that has none.
* fix(thumbnails): a quote inside a CSV header field no longer hides its delimiter
Delimiter detection opened a quote at any double quote, while the parser
opens one only at the start of a field. A header such as `Size 5";Length`
then counted no semicolons and the whole file was drawn in one column.
* fix(thumbnails): CSV dates, times, money and grouped numbers align right
A spreadsheet reads these as numbers and aligns them right, as the XLSX
thumbnail does for the same data, but the CSV thumbnail drew them as left-
aligned text.
* fix(thumbnails): a CSV's sep= line sets its delimiter and isn't drawn
Exporters write a first line such as sep=; so Excel splits the file the
same way in every locale. Excel uses it and hides it; the thumbnail drew
it as a row of its own.
* fix(thumbnails): JSON layout keeps block comments apart from their neighbors
A block comment that started a line, such as a copyright header, had the
next token appended to it (`/* ... */{`), and one inside a line touched the
value after it.
* fix(thumbnails): a CSV number too wide for its cell keeps its leading digits
A right-aligned value wider than its column was clipped on the left, so an
ISO date drew as 24-01-15 and 1,234,567.89 as 34,567.89. Numbers in a CSV
sheet that don't fit their cell are drawn from the side the sheet starts at
and still cut off at their cell, as numbers don't run on.
* fix(thumbnails): text that isn't UTF-8 is read in the Windows code page
Excel on Windows saves a CSV in Windows-1252 by default, and accented
letters drew as replacement characters (Caf�). Text that isn't valid UTF-8
is now decoded as Windows-1252. A UTF-8 character cut in two by the read
limit is left out instead of making the whole read fall back.
* docs(thumbnails): describe CSV dates, sep= lines and Windows-1252 text
|
||
|
|
8955253e2f |
feat(gui): app launches say what the user did and which page sent them (#4697)
Apps get `utm_content` set to how the user opened them: `app_icon`, `file_open`, `open_with` or `file_drop`. Apps opened from the app browser embed get the framing page's host as `utm_source`, which the server reads from the same referrer check that pins `frame-ancestors`. |
||
|
|
e8bf0086dd |
fix(gui): no border around the captcha widget once it has passed (#4694)
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
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
The widget renders in its interaction-only mode, so when it passes without asking for anything there is nothing on screen and the border showed as a small green ring on the login and signup screens. |
||
|
|
6b8af52077 |
feat(auth): sign-in pipeline, per-account wrong-password budget and idle session expiry (#4692)
Sign-in - One sign-in path (SignInService) for password, 2FA, recovery code, signup and OIDC. It emits puter.signin.attempt (before the account lookup on POST /login), puter.signin.validate (before the session is created) and puter.signin. Listeners can refuse or require phone or card verification; a listener that throws is ignored. - POST /login keeps a wrong-password budget per account across all networks, 20 an hour and 50 a day. A browser that has signed in to the account before is not refused, and the budget belongs to the current password. - An account unused for dormantSignInDays (default 180) confirms an unconfirmed email at sign-in, where the deployment can send mail. - New account emails: sign-in from a new browser, sign-in attempts blocked, password reset completed. - pwnedPasswords (off by default): a k-anonymity range lookup after a successful password sign-in, with a notice to the owner. - requestSignalHeaders and requestSignalValue turn configured request headers into req.requestSignals and a puter.request.flagged event. Sessions - web and app sessions end after 180 days without activity; accounts with no password and no email keep 365 days. A missing expiry on web, app and asset rows no longer means no expiry, and ended rows are purged. - The cookie a private hosted site sets from ?auth_token= is tied to the token's session row and carries a 7-day expiry. Email confirmation codes - A 6-digit code is valid for 60 minutes and has a wrong-code budget. Mailbox ingress - email.ingress.validate runs before a message is stored; a listener can refuse it or record a sender check. X-Puter-Sender-Auth is written by the server only. Header blocks over 256 KiB are refused. GUI - Login sends the device fingerprint, can show the captcha widget (gui_params.turnstileLogin), offers a password reset when sign-in is locked, and runs pending verification windows after a popup sign-in or signup. |
||
|
|
5266f40383 |
feat(dashboard): file thumbnails get a subtle shadow in the grid views
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
|
||
|
|
6598d798ea |
feat(thumbnails): JavaScript, CSS and Markdown files get a thumbnail (#4693)
* feat(thumbnails): JavaScript, CSS and Markdown files get a thumbnail The desktop draws the start of a .js, .mjs, .cjs or .css file in a fixed-width font with its tokens colored, and a .md or .markdown file as the page it describes: headings, paragraphs, lists, quotes, code and tables. Both go through the page drawer the Word readers use, which now takes a font family per run and paragraphs that don't wrap. Only the first 16 KiB of these files is read. The dashboard downloads only that much when it makes a thumbnail for one that has none, so the file size limit doesn't apply to them. An upload draws them one at a time for at most 2 seconds; the rest keep their icon until the dashboard shows them. * fix(thumbnails): a <br> in Markdown breaks the line instead of joining the words around it * fix(thumbnails): HTML headings and centered blocks in a README are drawn as GitHub shows them An <h1> after other HTML lines was drawn as body text, joined to the lines before it, and a block's align was ignored. HTML block tags now start and end a block of their own, and align="center" or "right" on them, or a <center>, is kept. * fix(thumbnails): code fenced inside a Markdown list item is drawn as code A fence indented four spaces under a list item was read as paragraph text, so its backticks and lines were drawn joined on one line. A fence at any indent now starts code, drawn under the item it belongs to without the fence's indent. * fix(thumbnails): every row of a Markdown table keeps the header's columns A row with fewer or more cells than the header split the page's width its own way, so its cells sat under the wrong headings. Rows now take the header's columns, an escaped bar stays in its cell, and each column is aligned as the row under the header says. * fix(thumbnails): text after a Markdown table is spaced from it as from a paragraph The line after a table sat as close to its last row as the rows sit to each other, so it read as another row. * fix(thumbnails): an empty Markdown heading draws nothing instead of a # * fix(thumbnails): a Markdown task list shows boxes instead of [ ] and [x] * fix(thumbnails): a GitHub alert in Markdown shows its title instead of [!NOTE] * fix(thumbnails): the dashboard asks for only the first 16 KiB of a text file, whatever its listed size A source or Markdown file listed at 16 KiB or less was downloaded whole, so one that had grown since it was listed was fetched up to the 20 MiB cap to read its start. * fix(thumbnails): an HTML comment inside Markdown code is drawn as code Comments were removed from the whole file before it was read, so a code sample lost the <!-- file name --> comment it opens with, and an unclosed <!-- in a code sample hid the rest of the document. Comments are now left out only outside code. |
||
|
|
e62418f7a9 |
fix(thumbnails): files edited or written by apps get a thumbnail in the dashboard (#4691)
* fix(thumbnails): files edited or written by apps get a thumbnail in the dashboard An overwrite clears a file's thumbnail and nothing made a new one, so a file an app saved over lost its picture, and files apps created never had one. The dashboard now makes a thumbnail for a file with none as its row comes into view, with the upload thumbnail generator, within budgets on size, downloads at a time, files per minute, and bytes per page load. A version that gives no thumbnail is remembered so it isn't downloaded again. /update-fsentry-thumbnail takes an optional expectedModified and refuses a thumbnail made from an older version with 409, tells the owner's other clients about the new thumbnail, and has its own rate-limit scope instead of sharing the one opening a file uses. Overwrites and replacements emit thumbnail.discarded, and the thumbnails extension deletes the object behind it, so replaced thumbnails no longer stay in the bucket. * fix(thumbnails): expectedModified must be a whole number of seconds the column can hold A fraction or a value past the column's range reached the UPDATE, which Postgres refuses with an error after the thumbnail was already uploaded. The route now answers 400 before it uploads anything. * fix(thumbnails): setting a thumbnail keeps the current one when the new one can't be stored The route stored whatever the thumbnail.created listeners left behind: a pointer whose upload failed, or the null left for an image that can't be decoded. Either replaced a working thumbnail and answered 200. It now answers 500 or 400 and leaves the entry as it was. * fix(thumbnails): the update announced after setting a thumbnail carries the entry's current name and path The event was built from the entry read before the thumbnail was uploaded, so a rename or move that landed during the upload was announced with the name and path it had just replaced, and open clients put the row back on a path that no longer exists. The entry is read again after the thumbnail is stored. * fix(thumbnails): a file that stops needing a thumbnail is no longer downloaded for one A file waiting its turn, or already downloading, was still read and its thumbnail stored after another tab had made one, or after the file was saved again as something the generator can't read. A queued file is now checked again before its download starts, and a change that makes the thumbnail unwanted drops the queued job and cancels the download. * fix(thumbnails): refreshing the folder on screen keeps its thumbnail downloads A refresh of the folder on screen (a sort, a view switch, an upload finishing, coming back to the tab) cancelled the downloads under way. The rows drawn right after were skipped, because their files still counted as being tried, so they stayed without a thumbnail until some later render. The rest were downloaded again from the start. A download is now cancelled only if its file's row isn't drawn again in the same task, and the new row takes it over. A row that comes back while a cancelled download is still ending is queued again. * fix(thumbnails): a stored thumbnail is recorded on the row's own entry The filler handed its callback a copy of the row's entry, so the thumbnail was written to an object nothing else reads, and the row's entry kept saying the file had none. It now passes the row's entry, and skips a row whose file was saved again while the thumbnail was being stored, which would otherwise show the older version's picture. * fix(thumbnails): the download budget counts the bytes that were downloaded A cancelled download gave its whole size back to the page's download budget, though the bytes it had received were already billed as egress. A file saved over and over while its row was on screen could be started again each time, well past the budget. A download the server refused kept its size charged with nothing downloaded. The file is now read as a stream and the budget is charged what arrived. Reading also stops as soon as a file turns out to be over the size cap, where before a file larger than its listed size was buffered whole. * fix(thumbnails): a thumbnail download that fails to connect is tried again A download that failed on the network counted as tried, so the file went without a thumbnail for the rest of the page load. A laptop waking before its Wi-Fi is back marked every row on screen that way. A failed connection now pauses the filler like a 429 does, and the file is tried again after the pause. * fix(thumbnails): a thumbnail that couldn't be stored yet is sent again, not made again When storing a thumbnail got a 429, the file was queued again and downloaded a second time after the pause. When the request failed to connect, the thumbnail was dropped and the file went without one. The thumbnail is now kept with the queued job and sent again after the pause, as long as the file is still at the version it shows. * fix(thumbnails): a file whose thumbnail the server refuses isn't downloaded again on every page load When the server answers 400 for a thumbnail, the file's version is now remembered like one that gave no thumbnail at all. It counted as tried for the page load only, so each later page load downloaded the file and sent the same image again. * fix(thumbnails): only pictures a browser can draw are downloaded for a thumbnail Any file typed image/ counted as one the generator reads, so TIFF scans, CAD drawings, DjVu books and the like were each downloaded in full, up to 20 MiB, to make a thumbnail no browser can draw. A file is now downloaded only when its type or name is one browsers decode. Uploads are unchanged: the generator still tries any image there, where the file is already local. * fix(thumbnails): missing thumbnails are downloaded one file at a time Each download holds one of the account's concurrent file reads until it ends. Two at a time left a temporary account, which has three, a single read for everything its apps do, so an app reading two files at once got a 429 while a folder's thumbnails were being filled in. The per-minute cap of 20 files already bounds how fast they're made. * fix(thumbnails): an update refreshes the icon of every item it matches An update can match the Files row and the same item in a file dialog open over the dashboard. The row updater set the new thumbnail on the first match only, where it used to set it on all of them. * perf(thumbnails): an update works out a row's icon again only when its thumbnail changed Every update event carries a thumbnail key, so the row updater worked out the icon on each one. For a .app file or a web link that reads the file, once per event. The icon is now refreshed only when the event's thumbnail differs from the one the row has. * perf(thumbnails): drawing a large folder doesn't rescan the thumbnail queue for every row Each row handed to the filler went through every row queued before it, looking for a job to start, so drawing a folder of files without thumbnails took the square of its length: about a second for 20,000 rows. A row that isn't on screen yet has nothing to start, so the queue is now only gone through when a row is reported on screen, a job ends, or a wait is over. * fix(thumbnails): one tab no longer drops the failed files another tab remembered Each tab read the list of files that gave no thumbnail once, then wrote its own copy back whole on every addition, which dropped whatever another tab had added in between. Those files were downloaded again on a later page load. The stored list is now read again and merged before each write. * perf(thumbnails): files downloaded for a thumbnail stay out of the browser's HTTP cache The download asked the cache to revalidate, which still writes each response to it, up to 100 MiB of originals per page load that nothing reads back. The read route doesn't answer conditional requests, so a cached copy could never save a download either. * bench(thumbnails): scenario for setting a file's thumbnail from the dashboard The dashboard calls the route for each file it fills in a thumbnail for, up to 20 a minute, so its round trips are measured from here on. * docs(thumbnails): list the picture formats downloaded for a missing thumbnail * perf(thumbnails): setting a thumbnail reads the entry again alongside the write, not after it The read that keeps the announced name and path current ran after the update, which added a serial round trip to the route. It now runs with the update. The window it closes is the upload before both. * feat(thumbnails): a file saved over keeps showing its old thumbnail until the new one is ready A save cleared the row to its type icon for the few seconds it takes to make the new thumbnail, so a file an app saves repeatedly flashed between the two. The row now keeps the old thumbnail while a new one is on its way. It goes back to the type icon at once when no thumbnail will be made (the file is too large, the download budget is spent, the filler is paused), as soon as the attempt fails, and after 10 seconds at most, counted from the first save, so an old picture can't stay on a file that keeps changing. * fix(thumbnails): a document gets its thumbnail when the view goes to the list and back while it's made A list row shows a document's type icon, so switching to the list gave up on the thumbnail being made for it. Switching back before that ended found the version already tried and queued nothing, and the row kept its type icon until the folder was drawn again. The row now takes the job back. * fix(thumbnails): a file being saved waits to settle whatever the computer's clock says The wait before a saved file is downloaded was measured from its modified time, which the server sets, against the browser's clock. On a computer whose clock runs a few seconds ahead the wait came out as zero, so every save of a file an app keeps saving started a download that the next save cancelled. A file an update just arrived for now waits at least two seconds, the least it waits when the clocks agree. * fix(thumbnails): an item in a file dialog gets a new thumbnail when its folder isn't the one on screen The row updater only set a thumbnail through the entry a Files row carries. An update for a file shown only in a file dialog, with another folder open in Files, matched an item that has no entry, and the item kept the picture it had. * refactor(thumbnails): the row observer asks for no margin around the screen The 200px margin never took effect. The rows scroll inside the listing's own pane, and a margin on the viewport doesn't widen what that pane clips, so a row was only ever reported once it was on screen. That's also what the download budget is written for, so the option goes rather than being made to work. * test(thumbnails): a version tried once, a hidden tab, and a browser saving data Three of the filler's cost guards had no test: a version whose thumbnail the server turned away isn't downloaded again in the page load, nothing starts while the tab is hidden, and nothing is downloaded when the browser asks to use less data. |
||
|
|
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. |
||
|
|
71d1c5ef88 | fix(gui): center app icons on their labels in the Open With menu | ||
|
|
e2b8f5acda |
fix(dashboard): preview SVG files from a data: URL (#4670)
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
The Files image preview now shows SVGs from a data: URL instead of a blob: URL. Other image types keep the typed blob: URL. A preview that a newer one supersedes while the SVG encodes is dropped. readFileAsDataUrl moves out of weblink.js into its own helper so both callers share it. |
||
|
|
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. |
||
|
|
68ee2b0b8b |
feat(gui): show thumbnails for uploaded HEIC photos and audio cover art (#4684)
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(gui): show the cover art of uploaded audio files as their thumbnail On upload, the desktop finds the cover an MP3, FLAC, M4A or M4B file keeps with its tags and passes it to the image thumbnail generator: an ID3v2 picture frame (versions 2.2 to 2.4), a FLAC picture block, or an MP4 `covr` atom. The picture marked as the front cover is preferred. Only the tags are read. The reader steps over other frames, blocks and the audio by their stated sizes, within 1 MiB of reads, and the cover is a slice of the file that is not read until it is decoded. Its type comes from its own first bytes. A file with no cover keeps its file icon. An album is many files that each hold the same cover, so an upload finds and scales one cover before it opens the next file, with 5 seconds for all of them. The budgets are published with the others. * feat(gui): show thumbnails for uploaded HEIC photos Safari decodes HEIC and HEIF photos itself, so the image thumbnail generator is given the file first. In other browsers the desktop reads the photo's index, takes the small copy of the photo that phones store beside it, or else the photo's own picture or grid of tiles, and hands the coded data to the browser's VideoDecoder, which uses the HEVC decoder the device has. The frames are drawn onto a small canvas, turned and mirrored as the photo's properties say. No decoder is shipped and nothing is decoded in script. Whether the device can decode the photo is asked before any of it is read, so a browser or device with no HEVC decoder costs one small read and the photo keeps its file icon. An upload decodes one photo at a time, with 10 seconds for all of them and 2 for each. The budgets are published with the others. The walk over a file's boxes that the audio reader had moves to isobmff.js, which both readers use. |
||
|
|
90d83ed0a3 |
feat(gui): show thumbnails for uploaded Office documents, Illustrator files, videos and scanned PDFs (#4682)
* feat(gui): show thumbnails for uploaded Word documents On upload, the desktop makes a first-page thumbnail for DOCX and DOC files and passes it to the image thumbnail generator, as it does for a PSD's preview. Templates and macro-enabled documents (.dotx, .docm, .dotm, .dot) work the same way. A DOCX that stores a first-page JPEG uses it. Otherwise the desktop reads the main part up to the first page break and draws the page on a small canvas: paragraphs with the size, weight, color, alignment, indent and spacing their styles and direct formatting give them, table cells side by side, and pictures at their stated size. Fonts, headers, footers, borders and floating positions are not drawn. A DOC is read through its compound file's sector chains to its text, which is drawn alone; the format's binary formatting is not read. Only the parts needed are read, within published budgets: 4 MiB of container data, 1 MiB of XML per part, 16,384 characters of text, and four pictures. An upload reads its Word documents one at a time and stops starting new ones 5 seconds after the first. Encrypted documents and documents with a blank first page keep their file icon. The buffered file reader moves out of psd.js so the three parsers share it. * feat(gui): show thumbnails for uploaded spreadsheets and videos Spreadsheets: an XLSX that stores a first-page JPEG uses it. Otherwise the desktop reads the first visible worksheet and draws the 480 points at its top-left corner: gridlines, column widths and row heights, each cell's fill, and each cell's text in its font size, weight, color and alignment, with colors resolved through the workbook's theme. Numbers are drawn as stored; number formats, merged cells, borders, charts and pictures are not drawn. Templates and macro-enabled workbooks (.xlsm, .xltx, .xltm) work the same way. Videos: an MP4, MOV, M4V or WebM file is loaded into a detached video element, which seeks a tenth of the way in, at most 10 seconds, and the frame is drawn to a small canvas. The browser's player reads only the parts of the file it needs. A video the browser can't play keeps its file icon. Both go to the image thumbnail generator like the other formats. An upload reads its Office documents one at a time and loads its videos one at a time, each kind under its own 5 second preparation deadline; a video gets 4 seconds. The budgets are published with the others. The ZIP and XML reading that DOCX and XLSX share moves from docx.js to ooxml.js, and the budgets they share are renamed from WORD_ to OFFICE_. * fix(gui): take a video's thumbnail frame only once the browser can paint it WebKit reports a seek as done before the frame it landed on can be drawn, so every MP4 and MOV uploaded from Safari got a black thumbnail. The reader now checks that the player has a frame when the seek ends, and otherwise waits for the next frame the player presents after it. Chromium has the frame at that point and presents no later one, so it still draws right away. * fix(gui): preload a video so Safari seeks to its thumbnail frame at once With only the metadata preloaded, WebKit holds each seek back for a second, so a video took over a second to thumbnail in Safari and an upload of a few videos ran into its preparation deadline. Preloading the video itself brings that to under 100 ms. Chromium takes 10 to 20 ms longer per video than before. * fix(gui): hold thumbnail preparation to its published deadline The deadline an upload gives its Office documents, and the one it gives its videos, was only checked when a file's turn came. A video that started just before it could run for its own 4 seconds more, and a document whose read never came back held the upload with no limit, so an upload could wait about 9 seconds where 5 are published. The queue now gives up on the file in progress when the deadline passes, as the PDF path does: the upload stops waiting, the video is released, and the readers are told to stop through their abort signal. * test(gui): cover a failing reader and a cancelled upload in the Office queue The test that claimed both passed without reaching either: its failing document made the reader return nothing instead of throwing, and its cancelled one was turned away before the queue. Two tests replace it, one with a document whose main part can't be inflated ahead of a good one, and one that cancels while documents are still queued. * fix(gui): bound the compressed data read from an Office archive entry Reading an entry stopped once it had inflated to its budget, so the amount of compressed data read still depended on the entry. The input is now cut off a little past the budget as well, and data that ends at the cut is treated as the end of the entry. The work done for an entry is bounded whatever its compressed size. * fix(gui): read spreadsheets whose elements carry a namespace prefix Writers built on the Open XML SDK put every spreadsheet element under a prefix such as x:, and some give the sheet's relationship id a prefix other than r:. The reader matched bare names, so those workbooks got no thumbnail. It now compares element names without their prefix, and finds the relationship id as the sheet's one prefixed attribute. * fix(gui): keep the default width of a spreadsheet column that states none A column definition can carry only a style. The reader took its missing width for zero, which drew the column, and every column after it in the same definition, a few points wide. * fix(gui): leave a spreadsheet's shared-string cell with no value empty A cell marked as a shared string with nothing in it was read as position zero, so it showed the workbook's first string. * fix(gui): find a spreadsheet's strings, styles and theme where the workbook says The reader looked for these parts under their usual names. A workbook that names them otherwise, such as SharedStrings.xml with a capital, lost the text of every shared-string cell and all its formatting. The parts are now taken from the workbook's relationships, with the usual names as the fallback. * fix(gui): draw spreadsheet colors given as positions in the standard palette Workbooks converted from the older format state their fills and font colors as positions in a fixed palette of 64 colors. The reader resolved only direct and theme colors, so those fills were not drawn and their text came out black. * fix(gui): lay a right-to-left spreadsheet out from the right edge A sheet set to run right to left has column A at the right, as sheets in Arabic, Persian and Hebrew usually do. The thumbnail drew every sheet left to right, so those came out mirrored. Columns, fills and gridlines are now counted from the right edge for such a sheet, its text starts at the right of its cell, and long text runs on toward the left. * fix(gui): hide a DOC field's instruction when it holds another field A field's instruction can contain a field of its own, as a mail merge condition does. The instruction was removed up to the inner field only, so the rest of it was drawn as text. Fields are now followed as they nest, and text is drawn when it is in no field's instruction. * docs(gui): describe the WebKit video handling and the spreadsheet layout rules The thumbnail service's README now says why a video is preloaded in full and drawn only once the player has a frame, that a deadline also ends the file in progress, and that sheets can run right to left and take colors from the standard palette. * fix(gui): find a DOCX's page size in one pass over its section properties The page size and margins were looked up with patterns that could scan the section properties again from every tag in them. Each lookup now searches for the tag and for its end once, so it takes time in proportion to the size of the part. * fix(gui): use the format's own size limit for a DOC's small streams Which streams count as small, and are read whole from the mini stream, was taken from the file's header. The format fixes that limit at 4096 bytes, which is now what the reader uses, so a stream read whole is never larger than that. * fix(gui): walk each sector chain of a DOC once Every read of a stream followed its chain of sectors again from the start. A document whose text is in many pieces far into a long stream spent its read budget on that and lost its text after the first hundred or so pieces, and the work grew with the number of pieces times the length of the chain. A chain is now kept as far as it has been walked and continued from there. * fix(gui): bound a DOCX picture by its pixels and decode it at page size A picture's limit was on its file size alone, and each one was decoded in full and kept until the page was drawn, so the memory used depended on the pixel size the image stated. The reader now takes the pixel size from the image's header, skips a picture over 16,777,216 pixels or of a size it can't tell, and has the browser scale a large one down to the page's size as it decodes it. The limit is published with the others. * fix(gui): apply the DOCX text budget inside a single piece of text The 16,384 character budget was checked after each piece of text was added, and one piece can be nearly the whole part. A piece is now cut at the budget, and a word that has to break between characters is measured only as far as the page goes, so the layout work is bounded by the budget. * fix(gui): measure DOCX text in its own run's font The font was set once per run, and drawing a finished line left the font of that line's last word in place. Text measured after a line break, or after a wrap, in a run of another size was spaced and wrapped for the wrong size: small text after a title was spread out, and large text after a note overlapped. The font is now set before each measurement. * fix(gui): end a DOCX's first page where a section or a style starts a new one The first page ended only at a page break, at the place Word last broke the page, or at a paragraph set to start a page. A document saved without Word's page marks ran its second section, or a chapter whose style starts a page, onto the first page's thumbnail. The page now also ends after the last paragraph of a section when the next section starts on a new page, and before a paragraph whose style asks for a page break. A section that continues on the same page does not end it. * fix(gui): leave unknown character references in Office text as written A reference was looked up by name in a plain object, so a name such as constructor found a built-in function and drew its source text. Only the five names XML defines are replaced now. * fix(gui): keep the DOCX text that follows a text box in the same run A text box sits inside a run and holds runs of its own. The first of those ended the run around it, so whatever text that run had after the text box was dropped. Runs now nest, and the outer one goes on when the inner ones are done. * fix(gui): do not indent a DOCX paragraph taken out of its list A paragraph with list number zero is not a list item: that is how a document removes one paragraph from the list its style belongs to. It was indented like the items around it. * fix(gui): leave hidden text out of a DOCX thumbnail Text marked as hidden, in a run or through a style, is not shown on the page, and was drawn on the thumbnail. * test(gui): make the Office archive budget tests fail when a budget is removed The test for an entry that inflates to more than it states checked only the size of the result, which is cut to the budget either way. It now counts what was pulled out of the inflater. A new test covers the read budget with an archive whose directory is larger than it. * feat(gui): thumbnail PDFs whose pages hold images of up to 16 megapixels A PDF with an image over 4,194,304 pixels got no thumbnail, which left out every page scanned at 300 dpi and every phone photo saved as a PDF. The limit on an embedded image is now 16,777,216 pixels, separate from the canvas budget, which stays where it was: PDF.js decodes the larger image and scales it down to the canvas budget to draw it. Such a PDF takes 0.55 to 0.8 seconds and a few hundred megabytes in its disposable worker, measured in Chromium and WebKit with an 8.4 megapixel scan and a 12 megapixel photo. Larger images are still turned away before they are decoded. The published limits are updated. * fix(gui): show a document's type icon in the Files tab's list rows A list row draws its icon at 18 pixels. A thumbnail of a PDF, a Word document or a spreadsheet is a picture of a page, which at that size is a near-blank white square, so those rows lost the icon that tells them apart. List rows now show the type icon for such a file, and the grid views keep showing its thumbnail. Images, videos and PSDs keep their thumbnails in every view. The names that make a file a document move to one module, shared by the thumbnail generator and the icon helper. * feat(gui): show thumbnails for uploaded Illustrator files Illustrator saves a PDF of the artwork at the start of its files unless told not to. An .ai file that starts as a PDF does now goes to the PDF thumbnail renderer, within the same budgets. One saved without it starts as PostScript and keeps its file icon, and the renderer is not loaded for it. An Illustrator thumbnail is artwork, so the Files tab shows it in list rows too, as it does an image's. * refactor(gui): share picture, theme and paragraph code between the Office readers Decoding a picture stored in an archive, reading a theme's colors by name and laying out a paragraph move to where a second reader can use them: the first two from the DOCX and XLSX readers into ooxml.js, the third out of the page painter's closure. A relationship target that climbs out of its part's folder is resolved, and a paragraph can carry a marker to draw before its first line. What the existing readers draw is unchanged. * feat(gui): show thumbnails for uploaded PowerPoint presentations A PPTX that stores a first-slide JPEG, as PowerPoint does by default, uses it. Otherwise the desktop finds the first slide the presentation lists, the layout it builds on, that layout's master and the master's theme, and draws the slide: its background, what the master and layout add to every slide, each shape's fill and text, and each picture. A placeholder that states no position takes its layout's or its master's, and its text takes its size, weight, color, alignment, indent and list marker from the same chain, down to the master's text styles. Theme colors go through the master's map of names, so a dark deck draws dark, and groups place their shapes through their own space. Gradients are drawn as their first color; lines, tables, charts, rotation and shapes other than boxes and ellipses are not drawn. Slide shows, templates and their macro-enabled forms work the same way. Presentations share the Office queue and its 5 second deadline, and the new budgets are published with the others: 256 shapes and 4,096 characters from each of the slide, its layout and its master, and 8 pictures. In the Files tab's list rows a presentation shows its type icon, as other documents do. |
||
|
|
84e71703f6 |
fix(gui): show thumbnails for PSD files saved without a preview
Editors other than Photoshop often save a PSD with no embedded preview, so those uploads kept their file icon. When a document has no usable preview, the desktop now scales down the merged image stored after the layers and passes it to the image thumbnail generator. PSB files work the same way. Only the rows the scaled image samples are read, so the cost follows the document's width rather than its size, within a 16 MiB read budget. Raw and RLE-compressed images are supported for RGB and grayscale documents at 8 or 16 bits per channel, and transparency is flattened onto white. Other documents keep their file icon. |
||
|
|
25e73898cf |
feat(gui): show thumbnails for uploaded PSD files (#4680)
Photoshop stores a small JPEG preview in a PSD's image resources. On upload, the desktop reads that preview and passes it to the image thumbnail generator, which scales it like any other image. PSB files work the same way. Only the resource headers are read, so the cost does not grow with the document: finding the preview takes at most 1 MiB of reads, and needs no worker or extra assets. A document saved without a preview keeps its file icon. The thumbnail service folder is renamed from pdfThumbnails to uploadThumbnails now that it handles two formats. The built asset path (/dist/pdf-thumbnails/) is unchanged. |
||
|
|
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 |
||
|
|
037ba9b214 |
refactor(gui): /action/change-username redirects to the dashboard's Account tab, and its desktop window is removed (#4665)
The desktop's change-username window was only reachable from /action/change-username, which nothing links to. The dashboard's Account tab has its own change-username dialog. Old links now redirect there. |
||
|
|
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>
|
||
|
|
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>
|
||
|
|
1c67f93726 |
refactor(gui): blocked people and the 2FA dialogs open as dashboard dialogs instead of windows (#4658)
* refactor(gui): blocked people opens as a dashboard dialog instead of a window * refactor(gui): enabling and disabling 2FA open as dashboard dialogs instead of windows * fix(gui): blocked people ignores a block list that arrives out of order A list answered after a newer one no longer replaces it, and a list requested before the refuse-everyone switch was changed no longer sets the switch back. * fix(gui): an unblocked person leaves the blocked people list once the server confirms The row no longer waits for the list to reload, so a reload that fails doesn't leave it behind with a disabled Unblock button. * fix(gui): the blocked people list stops reporting itself as loading when it fails to load * fix(gui): typing into a filled 2FA setup code box replaces its digit A box takes one digit, so a filled one ignored what was typed until it was cleared by hand. Focusing a box now selects its digit. * fix(gui): a 2FA setup code entered right after a refused one is kept After a refused code, focus returns to the first box at once instead of dropping to the page, and a code typed or pasted while the refused one is still showing replaces it instead of being cleared with it. * fix(gui): the 2FA setup Copy buttons say copied only when something was copied Without clipboard access (a plain-HTTP origin, or a refused permission) the secret and recovery-code buttons reported a copy that never happened. They now fall back to selecting the text for the legacy copy, through the helper the custom domain dialog already had, and stay as they are when that fails too. * fix(gui): blocked people gives keyboard focus back to the control that was used The switch and the Block and Unblock buttons are disabled while their request is out, which drops focus. It went to the card, so the next Tab started over from the close button; it now returns to the control. * fix(gui): the 2FA switch waits for a request still out when its dialog is closed Closing the enable or disable dialog while its request was out reported a failure at once, so the Security tab kept showing the old state after the server made the change. The dialogs now report the server's answer. |
||
|
|
222fadf432 |
refactor(gui): the emoji language is removed from the language list (#4657)
* refactor(gui): the emoji language is removed from the language list An account that saved it renders in English. * refactor(gui): translation keys no code reads are removed from every language Covers keys English no longer defines as well. Keys built at runtime (share link notes, permission lines, plan names) stay. * revert(gui): the unused translation keys are restored in every language |
||
|
|
6539c09a55 | feat(gui): usage details on the dashboard Usage tab are collapsible and start hidden | ||
|
|
7c6427b0e6 |
feat(auth): the authorization dialog and token label name where an MCP sign-in ends up (#4652)
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
The MCP connector puts the host of the client's redirect URI on its own callback URL (`forwards_to`) and completes a flow only when that exact value comes back with it. The authorization dialog reads that name off a redirect under the deployment's own domain and leads with it, with the relay named beneath. A name given by any other host, or by a page on the hosting domain, is ignored. The token minted for the grant is labelled with both hosts, destination first. |
||
|
|
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> |
||
|
|
490abccd6d |
fix(gui): password strength check counts any symbol, punctuation, or space as a special character
A password whose only special character was ~, a backtick, a space, or a non-ASCII symbol such as € was rejected as having none. |
||
|
|
1b5e588241 |
Bring back the dashboard's Open Desktop card, pointed at desktop.puter.com (#4648)
The Home tab's Open Desktop card returns with its markup, styles and strings, and links to https://desktop.puter.com instead of /desktop. A plain click opens the desktop the way the Apps tab opens an app in its own tab: the launch params (app instance id, app id, Puter origin, API origin, locale) go in the URL, and the app token is handed to the tab through the opener rather than placed in the URL. The token is requested by origin, so fetchUserAppTokenForLaunch accepts an origin and returns the app uid the server resolved. Without a token the tab still opens at the plain URL. A modified click, or a refused tab, stays a plain link. |
||
|
|
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`. |
||
|
|
3e11e7dc79 |
refactor: keep folder sort and layout in puter.kv, drop /set_sort_by and /set_layout (#4642)
Explorer saved each folder's sort and layout through POST /set_sort_by and
/set_layout, which wrote them onto the folder's fsentries row. stat only
returns `layout`, so a saved sort was never read back.
The GUI now keeps them in the user's key-value store, one key per folder
uid (`folder_view:<uid>` holding `{ sort_by, sort_order, layout }`), via
helpers/folderViewPrefs.js. A change to one preference keeps the others.
A folder with nothing stored falls back to the layout its fsentry still
carries, then to the defaults, so existing layouts carry over.
refresh_item_container reads the folder's view after stat and re-sorts
items that went in under the previous sort; a view for a folder the
window has left is ignored. update_window_path no longer applies sort and
layout itself, since the refresh it starts does.
With no callers left, DesktopController and its two routes are removed.
The fsentries columns and stat's `layout` field stay.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
b2eb8ed895 |
feat(auth): a first-party page served on its own origin signs in with a session of its own (#4635)
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
A deployment can list origins of its own pages in `first_party_session_origins`. When such a page asks the GUI to sign it in, the sign-in hands it a GUI token on a `web` session of its own, parented to the user's sign-in, instead of an app token. The session is minted by POST /auth/first-party-session, which only the GUI's own page script may call, and only as the user's sign-in itself: app tokens, access tokens and a session minted this way are refused. It never gets a session cookie, ends with the sign-in it was handed out under (revoking either takes the tokens minted under the page along), is not counted as a sign-in, and stays up with its sign-in when all other sessions are revoked. The sessions list shows it under its sign-in, titled with the page's host and badged as a site session. |
||
|
|
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 |
||
|
|
36e2d199c8 |
fix(fs): refuse instead of replacing an entry whose name differs only by an emoji or accent (#4589)
* fix(fs): refuse instead of replacing an entry whose name differs only by an emoji or accent MySQL compares fsentries names and paths under collations that also fold accents and most emoji, so a lookup for one name could return a sibling with another, and writes then overwrote and renamed it. Path lookups now return only an entry whose stored path matches the requested one after NFC normalization and lower-casing; case-only and NFC/NFD spellings still resolve as before. Name-collision checks opt in to the folded match and treat it as taken by a different entry: write, mkdir, touch, rename, shortcut, move and copy dedupe when asked and otherwise answer 409, and never replace or return that entry. * fix(fs): leave a sibling's subtree alone when a folder its path folds onto is renamed or moved The subtree rewrite matches descendants with `path LIKE 'old/%'`, and LIKE compares under the path collation (ASCII case on SQLite). With a sibling folder whose path differs only that way, renaming or moving one folder also rewrote the paths below the other. When another row sits at such a path, the rewrite now follows parent links down from the moved folder instead. Without one, the rewrite is unchanged, after one indexed lookup. * fix(fs): resolve an entry whose stored path is spelled unlike its names, and heal that path on the first read Older rows can store a `path` whose spelling differs from the names on their parent chain in ways the path collation ignores. A lookup that finds such a row by its real spelling now confirms it through the parent chain, writes the path from the stored names, and returns it, so overwriting, touching or copying over it by name works and the next read takes the single indexed query again. The lineage walk now writes a row's path only when it differs byte for byte from the one its names give, and drops only those rows' cache keys, so a walk over rows that are already right issues no writes. Whether an entry found at a name is a different, folded name is decided by its own name and its path after that walk, not by a stale path column. With `foldedNames`, a row only the path collation matches still counts as holding the name. * fix(fs): match entry names under full case mapping Names are compared after upper- then lower-casing, with a dotted capital I taken as I, so a request in another case finds the stored entry for Greek final sigma (`οδος.txt` for `ΟΔΟΣ.txt`), German sharp s (`STRASSE.txt` for `Straße.txt`) and Turkish dotted I (`istanbul.txt` for `İstanbul.txt`). Accent, emoji, kana and width differences still make two names different. * fix(fs): name the existing entry when a folded name is already taken, and show why a confirmed replace failed `item_with_same_name_exists` from write, move and copy now carries the existing entry's own name in `entry_name` when it differs from the requested one only by accents or emoji, so the prompt names the file the folder shows. In the GUI, a replace confirmed from that prompt that still fails is reported with its error message and counts as not written, instead of rejecting out of `handle_same_name_exists` and leaving the caller waiting. * fix(webdav): answer MKCOL with 405 and COPY or MOVE with Overwrite: F with 412 on a folded name The existence checks before MKCOL, COPY and MOVE now see an entry whose name differs from the target only by accents or emoji, so those requests answer as for an existing target instead of reaching the filesystem and coming back as 409. * docs(fs): list the errors write, move and copy return when a name is taken `puter.fs.write()` gets an Errors section with `item_with_same_name_exists`, `cannot_overwrite_a_directory` and `conflict`, the last for a name that differs from an existing one only by accents or emoji. The move and copy pages say how they reject in that case. * fix(fs): walk the parent chain on the primary when a path lookup reads hard A lookup that asks for a try-hard read (the checks after a create or move hits the unique key) now also runs its parent-chain walk on the primary, and falls back to the primary for the entry it finds. Before, the walk read a replica, so a name the replica had not seen yet came back as missing and the mkdir or move surfaced the duplicate-key error as a 500 instead of a 409. Lookups without a try-hard read are unchanged. A try-hard lookup issues the same number of queries; its walk reads the primary instead of a replica. * fix(fs): treat a folder only the collation matches as missing instead of naming a file in it A name-collision lookup lets only the last segment of the path match a differently spelled name. When a folder above it matches only under the collation (`😁dir` for `😀dir`), the lookup reports no occupant, so a write, mkdir or touch there fails as for a missing folder: 404, or with `createMissingParents` a 409 that names the folder. Before, it reported the file inside the other folder and answered 409 naming that file. A folder whose stored path is spelled that way still counts as the same folder, so lookups built from stored paths find what they did before. A rename onto a name the unique key already holds now answers 409 when the lookup before it missed the occupant, instead of a 500. * fix(fs): name the existing entry when a rename's name is folded, and leave a copy onto itself out of the copy docs A rename refused because the folder holds a name that differs only by accents or emoji now names that entry in its 409, as write, move and copy do. A copy onto a folded spelling of the source's own name answers as a copy onto itself (400 with `overwrite`), so the copy page's paragraph on folded names now covers only items other than the source. * fix(fs): walk the parent chain on the primary only when a hard read found another spelling of the path |
||
|
|
8616b00f7b |
fix(gui): save a URL from showSaveFilePicker, and always answer the app when the save dialog closes (#4587)
* fix(gui): save a URL from showSaveFilePicker and always answer the picker The save picker downloads an http(s) URL itself, without cookies or a referrer, up to 100 MiB, and writes it where the user chose, in apps and on websites. A failed download shows an error. In apps, a save dialog that closes without saving (failed download, failed write, close button) answers fileSaveCancelled once instead of leaving the call pending. * fix(gui): answer the save picker with the save's real outcome when it closes mid-save Closing the save dialog while a URL is downloading stops the download, writes nothing and answers fileSaveCancelled, in apps and on websites. In apps, closing it once a write has started leaves the answer to the write: fileSaved if it lands, fileSaveCancelled if it fails, never both. A save that throws shows an error and answers fileSaveCancelled instead of leaving the dialog stuck, and a second Enter during a save is ignored. On an https desktop only https URLs are accepted, with a message saying so, since the browser blocks http downloads there. * fix(gui): retry signing a saved file once, and say so when the app can't get it The app save picker signs the written file for the app with one retry. If both tries fail, the user is told the file was saved but couldn't be passed back, and the app gets fileSaveCancelled. The picker's one-answer state (answered, closed, saving, writing) lives in helpers/savePickerAnswer.js so the website picker can share it. * fix(gui): answer the website save picker once, with the save's real outcome The website save picker runs one save at a time, so a second Enter is ignored. Closing it while a URL downloads stops the download, writes nothing and answers fileSaveCancelled; closing it once the write has started leaves the answer to the write, so the page hears fileSaved or fileSaveCancelled, never both. A failed download shows an error, answers fileSaveCancelled and closes the picker, as in apps, and so does a save that throws. A saved file that can't be signed is reported to the user and answered as cancelled. * fix(gui): show apostrophes in the save picker's failure messages |
||
|
|
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>
|
||
|
|
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. |
||
|
|
f114b13306 |
perf(gui): boot keeps a same-session token and skips /get-gui-token when the page already answers it (#4591)
* perf(gui): keep the stored token when /get-gui-token returns one for the same session /get-gui-token signs a new string on every call, so every signed-in boot stored a token that differed from the one it held only in `iat` and passed it to puter.setAuthToken. That opened a second FS socket, re-sent /whoami and the cache timestamp, and every other open tab picked the new token up from storage and did the same. The boot now keeps the stored token when the returned one carries exactly the same claims apart from `iat`; any other difference replaces it as before. A kept token still starts the boot from an empty FS cache, as the swap did. A boot that keeps the persisted cache (no session cookie) now waits for the cache timestamp check before the first render, which it started before reading the user. * perf(gui): skip /get-gui-token at boot when the page already says what it would return Every signed-in boot waited on /get-gui-token before it read the user. The shell is rendered from the same session cookie that route reads, so it now carries `guiTokenDigest` in gui_params: a digest of the claims (minus `iat`) of the GUI token the cookie's session would get, or null when the request has no session cookie. A cookie that doesn't resolve to a user session leaves it out. The GUI skips the request when the digest matches its stored token (same session, user and token type), or when it is null (the route would refuse). It still asks when the parameter is missing, the digest names another session, nothing is stored, the page and the route are on different origins, or Navigation Timing doesn't show this page as freshly served for this load (a history navigation or restored tab can reuse a page rendered for an older cookie). |
||
|
|
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. |