Skip to content

feat: polish community cloud interactions#422

Open
imantsk wants to merge 14 commits into
fix/166-ui-review-fixesfrom
feat/community-cloud-polish
Open

feat: polish community cloud interactions#422
imantsk wants to merge 14 commits into
fix/166-ui-review-fixesfrom
feat/community-cloud-polish

Conversation

@imantsk

@imantsk imantsk commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

  • show page-level loading and error notices for Community Cloud requests
  • add download or edit actions to cloud snippet previews
  • align the preview type badge with the modal title

Verification

  • npm run lint
  • npm run build
  • tests/e2e/code-snippets-community-featured.spec.ts — 16/16 Playwright checks

Comment thread src/css/common/_modal.scss Outdated
inset-block-start: 18px;
inset-block-start: 35px;
inset-inline-end: 56px;
transform: translateY(-50%);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be abetter solution imo

@imantsk imantsk Jul 24, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the absolute positioning and magic offsets are gone. The badge now renders as the first row of the modal content, aligned to the inline end under the title, plain flex flow (f740d76). Placement is covered by the geometry assertions in the preview spec.

@code-snippets-bot

Copy link
Copy Markdown
Contributor
  • Medium — tests/e2e/code-snippets-community-featured.spec.ts:106: The new loading test does not type-check because releaseRequest is inferred as () => undefined and cannot receive the Promise resolver. Give it an explicit () => void type and assign a zero-argument wrapper around resolve.

  • Medium — src/js/components/common/LoadingStatusNotices.tsx:21: Loading and error updates are inserted as plain region landmarks, so assistive technology is not notified when either state changes. Reuse the existing Notice component with status/polite semantics for loading and alert/assertive semantics for errors, then update the E2E roles.

  • Medium — src/js/components/common/cloud/CloudSnippetPreviewModal.tsx:20: The preview and card/table mount independent download-button state, so downloading in the preview leaves the underlying action as Download and a second click creates another local copy. Share the resolved local snippet ID with sibling actions or refresh cloud results after success.

@imantsk

imantsk commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

Addressed all three findings: the loading and error notices now use live-region semantics (role="status" polite / role="alert") so state changes are announced; downloading from the preview refreshes the shared cloud results, so every action for that snippet flips to Edit and repeat downloads are prevented, with e2e coverage; and releaseRequest is explicitly typed () => void with a zero-argument resolver wrapper. Verified with lint, PHPUnit (single and multisite), the build, and the featured + preview Playwright suites.

@code-snippets-bot

Copy link
Copy Markdown
Contributor
  • Medium — src/js/components/common/cloud/CloudSnippetDownloadButton.tsx:28: Each button still owns its downloaded ID, while onDownloaded only starts an asynchronous refresh; closing the preview before that refresh completes—or after it fails—leaves the sibling Download action enabled and permits another download POST. Lift the resolved ID and pending state to the row/card and share them between both buttons, with a delayed/failed-refresh test.

@imantsk

imantsk commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

Download state is now owned by a shared per-snippet provider rather than each button: card, table, and preview actions read the same pending/downloaded record, so a download in the preview immediately flips every sibling action and repeat downloads are prevented even before the results refresh completes or if it fails. Covered by e2e cases for the delayed-refresh and failed-refresh paths. Verified with lint, PHPUnit (single and multisite), the build, and the featured + preview Playwright suites.

@imantsk imantsk added the build Adding this label will trigger the zip build action label Jul 24, 2026
@imantsk imantsk self-assigned this Jul 24, 2026
@imantsk
imantsk marked this pull request as ready for review July 24, 2026 15:34
@code-snippets-bot

code-snippets-bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Download and install

📦 code-snippets.4.0.0-beta.2.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Adding this label will trigger the zip build action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants