mirror of
https://github.com/penpot/penpot.git
synced 2026-11-26 21:00:32 +00:00
12 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
936939fd75
|
✨ Compare a branch with main on the canvas (#13201)
* ✨ Add per-profile review marks to branch comparisons A reviewer goes through the changes of a branch one by one, and the comparison has to remember which ones they have already seen. Add the `file_branch_change_review` table and two RPC methods, `get-branch-change-reviews` and `set-branch-change-review`. A mark belongs to a branch, a profile, a direction and a change, and keeps the fingerprint of the change at the time it was marked, so the client can ask for a new review when the change moves again. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * ✨ Compare a branch with main on the canvas The comparison and the conflicts of a branch opened in two modals, away from the design they talk about. Move both to a compare mode on the canvas of the branch itself. The left sidebar lists the changes, in either direction, and the right one shows the change chosen. The canvas marks every change where it is, or only the one chosen, and a bar goes through them one at a time. The conflicts of a merge or an update are resolved in the same mode, with a popover beside the layer in conflict. The file is never touched: the workspace is read-only while the mode lasts, and what the canvas shows that the branch does not hold (the update, the choices made, main itself) is drawn by the WASM render alone. Main is put together from the changes of both directions, and can be seen beside the branch or by holding M. Each direction keeps its own selection of changes, and the changes marked as reviewed are stored per profile. The marks and the bar of the design reviews become shared components. That bar and the bar of the review now center on the canvas the rulers leave, as the bar of the branch does. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * ✨ Add end-to-end tests for the compare mode Cover entering and leaving the mode, a merge with a change left out, an update from main and the three kinds of conflict. The tests of the reviews and of the merged branches follow the comparison to the canvas. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * 💄 Move the WebGL rendering label to the bottom of the canvas The top right corner of the canvas now holds the name of the branch while it is compared with main, and the label was drawn under it. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * ✨ Make the canvas answer for the changes in the compare mode While a branch is compared with main both sidebars talk about changes, not about layers, yet the canvas still selected any layer. Make it answer for the layers with a change or a conflict alone. The pointer on such a layer marks it and shows its row in the list, a click chooses it and a double click zooms to it. A click anywhere else lets the choice go, and the canvas marks every change again. The row under the pointer marks its layer too. No layer is selected, outlined or dragged over; pan and zoom stay as they are, and a commenting tool takes the canvas back while it is in use. The bar that goes through the changes shows with a change chosen only. The canvas no longer draws its projection again on every render, only when what it shows changes. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * 💄 Keep the compare navigator grey outside a design review The bar that goes through the changes of a comparison had the blue border of a design review even with no review open. Give it the grey of the bar at the bottom of the canvas, and keep the blue inside a review. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * ✨ Line main up with the change chosen in the side by side view Main beside the branch showed the same spot of the page, so a layer the branch moved fell out of the half of main once the canvas went to it. The side by side view now has two modes: linked, as it was, and aligned to the change, where main is moved by how far the layer chosen moved, so both versions sit at the middle of their halves. Zoom and pan stay linked, and main slides to the next change as it is chosen. The mode is picked in a submenu of the view, or with the A key, and the browser keeps the last one for the next comparison. The note on the canvas says how far main is moved. Main put a moved group, path or boolean at the place the branch has: the diff leaves out the box of a layer, and it was only built again for the layers whose box is their position and size. Their mark in main now stands where they are. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * 💄 Name the side by side view alone in the view menu The control of the view said "Side by side - aligned" with main lined up with the change chosen, which the note under the toolbar already says. It names the view alone now, in both modes. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * 🐛 Fit the whole page in both halves of the side by side view Fitting the whole page, and zooming from the menu or to 100%, took the middle of the canvas as the middle of the page, but beside main that is the divider: both halves showed the page cut on the left, out of its middle. While main is beside the branch these zooms now work in the half of the branch: the page fits in it and stands at its middle, and a zoom with no pointer turns on that middle. Fitting the whole page takes in main too, which can reach further than the branch. Fitting the change chosen goes through the same fit, which every fit of the workspace now shares. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * 🐛 Zoom the canvas with the wheel over the marks of the changes The wheel with ctrl or cmd held only zoomed the canvas over the canvas itself or over the comments. Over the tags of the changes, which take the pointer, the browser zoomed the whole page instead. It zooms the canvas over anything drawn on top of it now: marks, tags and bars. The note that says how main stands beside the branch takes the look of the other notes of the canvas, in the primary colour. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * 🐛 Fix the layers, bars and badges of the compare and review modes - The comments go over the marks of the changes, so a thread or a task opened from a bubble is no longer covered by them. - How far the review of a comparison is reads at the size of the rest of its bar, in Spanish too. - The way out of a comparison, back from its conflicts and out of a review are icon buttons, with what they do in a tooltip. - Beside the branch, main keeps the frame of the canvas, rounded corners included: its half covered it. - The tab of the other direction counts its changes as soon as the comparison opens: they come with every diff, but only the tab shown was counted. - The read-only badge is a quiet grey one with a lock, in the pages panel and over the changes of a comparison. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * 🌐 Translate branching and design reviews into Spanish The Spanish catalog lacked 418 keys, nearly all of them of branching, comparing, conflicts, merges and design reviews, so those buttons, menus, messages and tooltips showed in English. Add them all, with the terms the catalog already uses. Drop 61 keys of both catalogs that nothing reads any more, left over from screens that are gone, and spell "colors" as the rest of the English catalog does. The Spanish word list takes the valid words the glued-word check flagged. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * 🐛 Find the way out of a review by its name in the e2e test The test looked for "Exit review" in the menu of the review bar, but the way out sits on the bar itself, and it is an icon button now, with its name in a tooltip. Click it on the bar, by its name. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * ✨ Rework the detail of a change in the compare mode The property changes and the buttons of a change stand on the background the inspect tab gives its blocks, over the whole width of the sidebar and as one block when they follow each other. The buttons go one over the other, as wide as the sidebar. Under a change or a conflict, the comments that wait for an answer and the tasks still open on its layer give its context, inside a design review and outside it. They replace the tab of the comments of the review the detail had inside one. The bar of a design review says "In review", on one line: a long title is cut short, whole on hover. The arrows of the bar that goes through the changes hold the place in the list between them, with no gap. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * ♻️ Bring the branching styles in line with the design system Review every stylesheet of branching and design reviews against the design system rules. None of them depends on the deprecated styles; a few details did not follow the rules: - colors that change with a state go through a local custom property (the branch counts, the caption of a preview card, the actions of the branch switcher and the next step of a task); - the alias of the canvas frame border resolves to its DS token; - the panels of the compare mode scroll with overflow-y, as overflow-block is not well supported yet; - unused imports are gone, and a z-index and a variable that are not DS tokens say so in a TODO. The generated CSS stays the same, except the overflow and two backgrounds that render as before. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> * ♻️ Reuse the design system components in the branching UI Where the branching and design review UI built its own control, it uses the one of the design system, keeping what the screens look like: - the multi-line fields use the DS text area, as high as before, and their labels name them; - renaming a branch uses the DS input; - the filter of comments and tasks is a DS menu, as wide as its button; - the read-only badge is a DS tag, and its own component is gone. The design system had nothing for a floating panel that is not a menu, so it gets a popover: it only closes on a click out of it or on Escape and gives the focus back, and the caller draws the panel. The branch switcher and the branches of a dashboard card use it instead of the legacy dropdown, unchanged on screen. The verdicts of a review and its reviewers read as radios and as checkboxes. The preview card of the design system, unused since the old conflicts dialog went away, is deleted. Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> --------- Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com> |
||
|
|
61bf66342b |
✨ Tell repairs, damaged data and other files apart in save notices
The notice of a rejected save always said the same thing. It did not name the file when the user had moved to another one, gave no hint when the page held data that was already invalid, and replaced the notice of a backend repair still on screen, since the store holds one toast. The backend flags a rejection whose first commit touches pages or components that failed validation before it (:preexisting-damage). The rejection notice names a file other than the open one, says when the data was damaged before, and folds into a repair notice still on screen; a later repair notice folds a rejection notice in the same way. The notice says that the latest changes were undone, no longer that the rest of the work is saved. |
||
|
|
cb26e8a39b |
✨ Keep autosave and the workspace alive when saves fail
- A save that failed on a short platform failure (a lost or refused database connection, lack of resources, a server shutting down, a serialization failure or deadlock, a socket or HTTP timeout, a host that did not resolve, an interruption) answered 500, which stops autosave. It now answers 503, which the frontend retries. Other I/O and database errors keep answering 500, timeouts 504. - A save answered not-found no longer replaces the workspace with the access page. It is a terminal save error: the workspace stays open with the failed save notice, report and reload link. When edit rights are lost, the notice says how many changes could not be saved. - A library sync marked the library synced three seconds later, whatever happened to its save. A rejected sync was undone but stayed marked: copies stayed out of date and the "updates available" notice never came back. The mark now waits for the save, a rollback of the sync brings the notice back, and a failed mark (e.g. the user just became a viewer) is logged instead of leaving the workspace. - While saves fail the workspace is read-only. The view-mode banner says editing is disabled because changes can't be saved, with the Inspect banner's size and bold lead and no Done button. Users can still switch pages, pan, zoom and inspect. The lock lifts when a save lands and brings back the mode the user had or picked meanwhile; the WebGL context lock keeps the workspace read-only if it lasts longer. The lock lives in app.main.data.persistence.lock. - A viewer is never locked. A role change that leaves the user a viewer keeps the edits that lost permission, queued and on screen, and shows the count notice again. The role change that brings edit rights back releases them and rolls them back on screen, as a rejected save would. Any other terminal failure is released by the next role change or file opened. The debug faults `io` (socket timeout, 503) and `eof` (500) cover both sides of the I/O rule. |
||
|
|
a8e8a54a2b | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
68ecfb1234
|
🐛 Fix default shortcuts that fail on some layouts and browsers (#12506)
Fixes the problems found after #12326 and listed in #12327. Mousetrap now tries several names for each key press, in order, and fires the first one with a binding: letters and digits by keyCode when a modifier is held, punctuation by position (layout map, or a US table when the browser has none), the typed glyph, and the typed glyph without the Shift it needed. With AltGr the typed glyph comes before the position. The shortcut recorder asks Mousetrap for the key it stores, so a recorded shortcut always fires. This makes "?" and "+" work on every layout, Shift and Ctrl+Shift with punctuation work in Firefox and Safari, Option+letter work on macOS, and AltGr+º hide the UI on Linux with a Spanish layout. Chrome on Linux returns the map of the first configured layout, not the active one. Mousetrap now drops the map when an unmodified punctuation key types something else. The layout twins are no longer needed and are removed: "shift+'" made "?" zoom to the selection on Spanish layouts. The Add node shortcut is removed too: on US layouts its key is the "+" zoom key, and on Firefox with a Spanish layout it cannot fire. The Firefox and Safari warning in the shortcuts settings is gone, since those shortcuts now work there. The user guide and translations follow these changes. AI-assisted-by: claude-opus-5-5 |
||
|
|
fffc3ee222 | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
38a6961ff1
|
✨ Make keyboard shortcuts layout-independent (#12326)
* Revert "🐛 Fix shortcuts with modifiers on letters and digits (#12292)" This reverts commit 21ecfb67b70ac2d6f4defb05a543f0fc18d692a2. * 🐛 Migrate mousetrap to key with sane modifiers Finish the half-done mousetrap migration from code/keyCode to key: canonical lowercase tokens on both bind and event sides so modifiers match again, US-only shift remap and keypress legacy removed, and AltGr phantom ctrl filtered on Windows. Record punctuation positionally through getLayoutMap (American fallback) so Shift+Period stores shift+. on every layout, while letters and digits stay glyph-based for AZERTY. Drop dead 219 aliases and revert the stray CamelCase escape command. AI-assisted-by: muse-spark-1.3-contributor * ♻️ Rewrite mousetrap as ESM class without behavior changes Turn the 2012 constructor-plus-prototype shape into a class with underscore-private methods, const tables and arrow listeners. Drop dead _belongsTo, fold one-line prevent/stop helpers into _fireCallback, and let handleKey absorb the old _handleKey indirection. Public API and matching logic stay identical; verified by existing tests plus a runtime smoke. AI-assisted-by: muse-spark-1.3-contributor * 🎉 Add node:test suite for mousetrap shortcuts Cover canonical key normalization, modifiers with AltGr, bind arrays plus aliases keyup reset overwrite, sequences with fake timers, and the full stopCallback matrix, all through isolated instances and synthetic events. Hook the zero-dependency suite into frontend/scripts/test for CI. AI-assisted-by: muse-spark-1.3-contributor * 🐛 Record shortcuts by glyph instead of position Drop the getLayoutMap positional layer and the American fallback: punctuation now records event.key lowercased, the same token Mousetrap dispatches, so Shift combos match with and without a layout map. Keeps the Numpad numN branch both sides share. Updates the pinned positional tests and adds the Spanish Shift-plus regression. AI-assisted-by: muse-spark-1.3-contributor * 🐛 Resolve shifted digits to the digit itself Shift+DigitN now resolves to the digit on every layout, so shift+0 fires on QWERTY ()) as well as AZERTY (0), like the old keyCode behavior. Applies in the recorder and Mousetrap; unshifted digits and numpad are untouched. Also stages the layout-map suite left untracked. AI-assisted-by: muse-spark-1.3-contributor * 🐛 Cover punctuation defaults with layout twins Some defaults only fired where their glyph is unshifted (+ dead on US layouts, shift++ dead outside ES/DE, \ dead where it needs AltGr). Bind the twin token per layout family and freeze the display with :show-command. No tooltip or translation changes. AI-assisted-by: muse-spark-1.3-contributor * ✨ Warn when the keyboard layout API is missing Shows a warning on the shortcuts settings page in browsers without navigator.keyboard.getLayoutMap, where Shift with punctuation may not fire. Uses a synchronous probe, English and Spanish strings, and documents the layout limitations in the user guide. AI-assisted-by: muse-spark-1.3-contributor * 🐛 Fix hide-ui twins and qualify layout docs The ctrl+alt+\ twin could never fire (the AltGr filter drops Ctrl), so it goes away; alt+º covers Chrome on Spanish layouts where AltGr+º resolves to º. The user guide now states which claims need the layout map and which hold everywhere. AI-assisted-by: muse-spark-1.3-contributor --------- Signed-off-by: Eva Marco <eva.marco@kaleidos.net> Co-authored-by: Eva Marco <eva.marco@kaleidos.net> |
||
|
|
286a6d5c9a
|
✨ Add new dashboard methods to the API (#12169)
* ✨ Add new dashboard methods to the API * 🐛 Fix some issues with the new methods * 🐛 Fix problem with mcp test |
||
|
|
4023642acb
|
🌐 Complete Russian translations to 100% (#11956)
Complete ru.po from 1460 to 2275 keys (100%), add words.ru.txt catalog, fix two dropped %s placeholders and normalize board/layout/shortcut terms. Documents Russian conventions in the translations memory. AI-assisted-by: muse-spark-1.3-contributor |
||
|
|
b5fbc4fd8c
|
✨ Add size limits to profile props and plugin registry (#11596)
* ✨ Add size limits to profile props and plugin registry Bound the total serialized size of profile settings to 2 MiB (:profile-props-max-size), checked on the merged result before persisting, with a controlled :props-too-large error. Profiles that already exceed the limit can still shrink but cannot grow. Cap plugin registry entries in the shared schema (code 1 MiB, 50 plugins max, bounded name/host/description/icon) and restore rate limiting on the plugin RPCs (profile-mutations bucket, one write at a time per profile). The plugin manager now asks for confirmation before removal and ignores repeated clicks while a persist request is in flight. Closes #11592 AI-assisted-by: muse-spark-1.3-contributor * 🐛 Enforce plugin count cap, byte sizes and removal guard Enforce the declared 50-plugin cap in add-profile-plugin with a specific :too-many-plugins error (updates of existing entries still pass); the cap lives in a shared max-plugins constant. Measure profile props size in UTF-8 bytes instead of chars so multibyte content cannot slip past the limit. Cover install/remove persist logic with mocked-RPC frontend tests (release semantics, in-flight dedupe, validation vs rollback split) and add the missing boundary tests in common. Expose the in-flight persist set from the plugin registry and disable the remove button of entries being saved. Closes #11592 AI-assisted-by: muse-spark-1.3-contributor * 🐛 Fix rollback loops and restore paths in plugin registry Restore the previous plugin version instead of dropping the entry when a validation error rejects an update of an installed plugin. Make compensating writes one-shot with terminal callbacks so a persistent failure cannot ping-pong between install and remove. Restores keep the original list position; the unused public plugin-persisting? predicate is removed. Pin count-before-size precedence with a dedicated test and fix translation source refs to their canonical lines. Closes #11592 AI-assisted-by: muse-spark-1.3-contributor * 🐛 Guard notifications write and fix restore ordering Route update-profile-notifications through check-props-size! so oversized profiles cannot grow through that path; document the exempt system writers. Remove the duplicated stale entries in en.po, keeping the canonical translation refs. Restore rejected plugin updates at their original list position instead of leaving the optimistic move in place. Closes #11592 AI-assisted-by: muse-spark-1.3-contributor * 🐛 Skip no-op plugin removal and clarify size comments Return early from remove-profile-plugin when the id is absent: no wasted write, no size check, and no manufactured :plugins key that could spuriously fail on oversized profiles. Clarify that per-field string caps count chars while the byte budget is enforced by profile-props-max-size. Closes #11592 AI-assisted-by: muse-spark-1.3-contributor * 📎 Fix formatting in rlimit.edn for profile operations Signed-off-by: Andrey Antukh <niwi@niwi.nz> * 📎 Fix formatting of import-binfile/global entry Signed-off-by: Andrey Antukh <niwi@niwi.nz> * ♻️ Simplify props size check and tighten plugin entry caps Measure props with transit bytes directly instead of the PGobject string roundtrip. Rename check-props-size! to check-props-size: single hard limit on the merged props, no growth comparison, and return props so writers thread the check into the update. Move the 2 MiB default into default-props-max-size on the profile namespace, still overridable with the optional :profile-props-max-size config entry. Tighten registry-entry :code and :icon to 500 chars: they hold manifest paths, not content. Closes #11592 AI-assisted-by: muse-spark-1.3-contributor * 🐛 Fix compatibility problems --------- Signed-off-by: Andrey Antukh <niwi@niwi.nz> Co-authored-by: alonso.torres <alonso.torres@kaleidos.net> |
||
|
|
4b978767ea
|
🌐 Clean up en translations (#11853)
Drop 277 keys nothing references from en.po (verified against frontend/src and common/src) and let sync propagate the deletions to every locale. Clear all 10 fuzzy entries: fill the 5 empty translations, keep the 4 valid ones, and drop the duplicated max-quote-reached in favor of max-quota-reached (the backend code stays, the UI maps it to the quota text). Recover 22 used-but-missing keys with translations: the 19 shortcuts section/subsection labels plus connected-to, pixel-grid-color and tokens.add-set. Make the rest statically visible to rehash instead: :label fns on shortcut commands, sections and subsections (one debug-only and one colorpicker-local id exempt); case branches in place of dm/str-built keys (export modal, text decoration and transform, undo history with raw-key fallback); hoist conditionals out of tr calls; pre-translate modal props and role labels; replace the lone (i18n/tr ...) site with tr. Turn static :error/code data into eager :error/fn calls in the common schemas and the auth/password forms. Rename the two keys containing spaces and point team leave at max-quota-reached. Backend-driven keys stay dynamic by design, declared with (tr ...) comments: the five weak-password details, team and organization notifications. Tooling: rehash also scans common/src and no longer treats a missing -l as no locale; new clj-kondo tr-dynamic warning flags non-literal tr args (lint scripts use --fail-level error so it never fails CI); tr docstring states the literal-only rule. Tests cover the shortcut label wiring, the undo-history fallback and the :error/fn schemas. Translations memory rewritten to match; es check word list gains three entries. Rebased onto develop: adopt the register field-error UX (the weak-password declarations move onto the :options code), keep develop's newer keys (connection-error, account-locked, save-retrying, tokens-source strings) with fresh references, and reword the shortcuts.cljs prose comment so rehash does not invent a "literal" key. AI-assisted-by: muse-spark-1.3-contributor |
||
|
|
bc3cb4bddf
|
🌐 Complete Catalan translations in frontend (#11741)
* 🌐 Complete Catalan translations in frontend Complete the Catalan (ca.po) locale to 100% coverage against en.po, using es.po as support reference. Adds the 1439 missing entries across workspace, dashboard, labels, shortcuts, subscription, errors, modals and onboarding, keeping vosaltres treatment and IEC/Termcat terminology consistent with the existing strings. Normalizes placeholders and plural forms, drops the 14 stale obsolete entries and canonicalizes the file with the repo translations script. Closes #11739 AI-assisted-by: muse-spark-1.3-contributor * 📚 Add frontend translations memory with Catalan criteria Record the PO workflow, the sync fuzzy-flag gotcha and the Catalan glossary and tone agreed upon while completing ca.po, and link the new memory from the frontend core routing. AI-assisted-by: muse-spark-1.3-contributor * 🔧 Add gettext to devenv image Provide msgfmt and msgattrib in the dev environment for checking PO translation files. AI-assisted-by: muse-spark-1.3-contributor * 🌐 Fix Catalan translations and add PO checker Review of the missing-whitespace pattern found ~90 glued words across 75 entries, plus 4 lost plural forms and 2 placeholder mismatches verified against tr call sites. All fixed in ca.po. Adds frontend/scripts/check-translations.js (vocabulary-free PO QA: glued words, punctuation, placeholders, plurals) with --self-test, wired as pnpm run check-translations and documented in mem:frontend/translations. AI-assisted-by: muse-spark-1.3-contributor * 🌐 Multi-locale PO checker with word catalogs Split the checker engine from its word lists: ca/es catalogs now live in scripts/check-translations/words.<locale>.txt and all messages are in English. Adds an es seed (calibrated to zero errors) and fixes 7 typos it found in es.po. Universal checks (placeholders, plurals, punctuation) run without a catalog. AI-assisted-by: muse-spark-1.3-contributor * 🌐 Merge PO checker into translations.js Fold check-translations.js into translations.js as a check subcommand reusing its locale helpers; word lists stay in scripts/check-translations/words.<locale>.txt. Also fixes the getopts stopEarly bug that made -l useless after the command (sync -l ca synced every locale), drops dead lodash import and code, unifies help and exit codes. Removes the check-translations package alias; use translations.js check -l <locale> with explicit -l. AI-assisted-by: muse-spark-1.3-contributor * 🌐 Keep unused placeholders out of the gate Reverts the %s-stripping on unused auth.terms-privacy-agreement: the links mirror its markdown sibling and a reactivation may need them. Placeholder mismatches on #, unused keys now warn instead of failing, and the rule is recorded in mem:frontend/translations. AI-assisted-by: muse-spark-1.3-contributor |