Skip to content

Publish feature/update already published static site - #2922

Merged
code4candy merged 19 commits into
feature/collectives-publishfrom
publish-feature/update-already-published-static-site
Nov 16, 2026
Merged

code4candy merged 19 commits into
feature/collectives-publishfrom
publish-feature/update-already-published-static-site

Conversation

@code4candy

@code4candy code4candy commented Nov 7, 2026 •

Copy link
Copy Markdown

📝 Summary

Description

Currently the frontend only calls createStaticSite in POST (src/components/Nav/CollectivePublishModal.vue:237).
If a record with the same static-site-id and slug already exists, having the status "published". The static site should call updateStaticSite
The endpoint already exists: PUT .../static-sites/{id} → StaticSiteService::update but is not used by the frontend yet.
Currently, if you call createStaticSite a second time aou get the error "slug already in use" because of a unique-constraint.

  • List all static sites - as simple as possible - just repeat existing banner
  • show last published slug & selection as default

(GUI - Design will be addressed in other issue)

Acceptance Criteria

  • 1. Changing an existing, published static site is possible (update)
  • 2. No error toast on updating an existing static site.
  • 3. Allow multiple static sites with different slug
  • 4. List all published static sites in publish modal

Dev Notes:

Some refactorings were necessary:

  • the build-status-callback from the external publish service is now answered with an empty body (instead of the static site object), due to information hiding
  • API responses do not contain the staticSiteId anymore, also due to information hiding
  • status "published" without a valid publish_url results now to 400

New:

  • Static Site Model has now two new fields lastError und publishedAt - to be able to keep the information of an existing publishing error and not to loose the information about an former successful publication. Also shown in the publish modal.
event status last_error published_at / published_url
Update startet pending → provided to null unchanged
Callback published published null updated
Callback failed / SSG declines request failed error message unchanged

🖼️ Screenshots

Update failed previously - old version still online:
Bildschirmfoto vom 2026-11-07 23-56-05

Update successfull:
Bildschirmfoto vom 2026-11-07 23-56-37

Klick on "New Website":
Bildschirmfoto vom 2026-11-07 23-58-04

Successfully created new website:
Bildschirmfoto vom 2026-11-07 23-59-08

🚧 TODO

  • ...

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@code4candy
code4candy requested a review from kjoscha November 7, 2026 23:07
@kjoscha

kjoscha commented Nov 9, 2026

Copy link
Copy Markdown

Nice! I think this is actually a good moment to introduce multiple views within the publish modal, since now there are different domains served in it now, a kind of index + a creation dialogue. So my proposal was: Modal opens and shows the list, there is only the "New website" button, that leads to the creation form (title/slug/tree). Would also be okay to make this improvment in another PR, but nthan please add some space and/or dividing headers between the two domains, like here:

image

@kjoscha

kjoscha commented Nov 10, 2026 •

Copy link
Copy Markdown

Futher ideas / questions

  1. The 15-minute timeout lives twice (PHP PENDING_TIMEOUT, JS staticSitePublicationTimeout) and the JS one compares server timestamps against the browser clock. Simpler: let jsonSerialize() ship an isInProgress boolean

  2. Only one publication is watched at a time. watchPublication() calls stopWatching() first — publishing site B kills the toast for site A. That matters now that several sites exist

  3. Two different sort orders. Mapper sorts by created_at, the store re-sorts by updatedAt. While polling, the publishing site jumps to the top of the list under the user’s cursor. Suggest sorting by createdAt and only preselecting by updatedAt.

  4. A rejected update still saves the new title and page selection while the old version stays online — so the list shows the new title next to old content. Intentional?

    • yes it's intentional
    • title & selection belong to the last update trial - if it fails the previous changes are still stored and shown in the modal, retry is easier for users
  5. The modal never refreshes. If nothing is polling, a site that finished publishing elsewhere keeps showing “Publishing” until the modal is reopened. -> We gonna fix this with a follow-up PR, when we re-design the whole feedback process

@kjoscha

kjoscha commented Nov 10, 2026 •

Copy link
Copy Markdown

Nits

  • - Use NcCheckboxRadioSwitch type="radio" (or role="radiogroup") instead of aria-pressed buttons — it’s single-select, and you’d get the a11y and NC styling for free. (CollectivePublishModal.vue:34)
    • no
    • Only one website can be selected at a time, so semantically this is a radio group. However, the cards contain a title, slug, status, link, and error message, which doesn't fit particularly well into NcCheckboxRadioSwitch.
    • Using role="radiogroup" also means that screen reader users expect arrow-key navigation, which would need to be implemented manually.
  • - formatTimestamp uses format('LLL'); everywhere else in this repo the pattern is fromNow() in the text and LLL in the title tooltip (LastUserBubble.vue:56, PageTrash.vue:160).
  • - updateStatusPublished/updateStatusFailed return a StaticSite nobody uses → make them void.
    • Since the review comment about the race condition, both methods return a boolean, and the service uses the returned value.
  • - Psalm type mismatch: controller says publish_url?: non-empty-string, service says string.
    • Since invalid URLs are now stored with a failed status, an empty string is also a valid input value. It is treated as invalid and no longer rejected with a 400 response.
    • Therefore, non-empty-string would impose a constraint that no longer applies.
    • In the spec, this also means removing minLength: 1. The description ("required for status published … otherwise stored as failed") explains the behavior.
  • - word-break: break-all on the whole list item breaks titles mid-word — scope it to the URL link.
  • - cursor: pointer isn’t reset when the select button is disabled.
  • - PUBLISHED_URL_MAX_LENGTH = 255 silently mirrors the column length — a comment pointing at the column would help.
  • - The title field stays editable while a publication is in progress, even though submitting is blocked.

Comment thread lib/Service/StaticSiteService.php Resolved
Comment thread lib/Db/StaticSiteMapper.php Resolved
@kjoscha
kjoscha force-pushed the feature/collectives-publish branch 3 times, most recently from 00b6e60 to bf49ba6 Compare November 10, 2026 16:29
@code4candy
code4candy force-pushed the publish-feature/update-already-published-static-site branch from bcab0de to ab3ac3f Compare November 15, 2026 15:34
@code4candy
code4candy marked this pull request as ready for review November 15, 2026 15:54
@kjoscha
kjoscha force-pushed the feature/collectives-publish branch from b76dbe1 to a3ed6a6 Compare November 16, 2026 10:31
Melpo added 15 commits November 16, 2026 13:36
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
…keep failing

Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
…lish URL

Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
… progress

The frontend duplicated the pending timeout and compared server timestamps against the browser clock. An aborted publication now shows an error toast.

Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
…e in publication toast

Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
…field

Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Melpo added 4 commits November 16, 2026 13:36
…as failed

Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
- show webistes in alphabetic order instead of updated_at
- preselect last updated site

Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Melpo <melpomene@posteo.net>
Assisted-by: ClaudeCode:claude-opus-5-5
@code4candy
code4candy force-pushed the publish-feature/update-already-published-static-site branch from ab3ac3f to 5025033 Compare November 16, 2026 12:37
@code4candy
code4candy merged commit ae73cef into feature/collectives-publish Nov 16, 2026
53 checks passed
@code4candy
code4candy deleted the publish-feature/update-already-published-static-site branch November 16, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants