forgejo/routers/web
Mathieu Fenniak a082555c04 fix: prevent initial 'blank' display of action logs view, remove unnecessary API calls (#9099)
When you access Actions logs, there is a momentary render of a partially blank screen such as this:
![actions-log-blank](/attachments/6cd7d97d-edf6-453b-8fe4-2ed7f4339ac4)
This is caused by the `RepoActionView` Vue component having no data.  It then performs a fetch to two APIs in parallel (shown here as `/0` and `/artifacts`) to retrieve the steps and artifacts for the action run, and then it renders the page.

And then, even if the job is complete and the user hasn't yet interacted to expand any logs, it performs the same API calls a second time.
![actions-logs-network-completed-task](/attachments/58044542-eb89-453b-a3f6-d02c9079db44)

This PR fixes both problems by:
- Injecting the initial data for the Action's steps & Artifacts into the initial page render, and using that data into the `RepoActionView` to serve as its initial data load.
- No longer unconditionally starting a second invocation of `loadJob` 1 second later, as the initial data can be used to determine whether the job is still running and requires an interval refresh.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

**WIP**
- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [x] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9099): <!--number 9099 --><!--line 0 --><!--description cHJldmVudCBpbml0aWFsICdibGFuaycgZGlzcGxheSBvZiBhY3Rpb24gbG9ncyB2aWV3LCByZW1vdmUgdW5uZWNlc3NhcnkgQVBJIGNhbGxz-->prevent initial 'blank' display of action logs view, remove unnecessary API calls<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9099
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-09-05 06:55:32 +02:00
..
admin chore: add email blocklist unit test 2025-08-30 09:45:19 +02:00
auth fix: email comments are removed from email addresses (#9074) 2025-08-30 13:15:30 +02:00
devtest chore(ui): clean up hashbox CSS, small design changes (#7822) 2025-05-25 12:51:27 +02:00
events chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
explore fix(code-search): fix broken pagination. (#9000) 2025-08-23 13:06:41 +02:00
feed fix: correct release link in feed (#8802) 2025-08-06 17:51:36 +02:00
healthcheck chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
misc feat: bump the minimum required Git version from 2.0.0 to 2.34.1 (#8328) 2025-06-29 00:44:18 +02:00
moderation feat!: Abusive content reporting (#6977) 2025-05-18 08:05:16 +00:00
org feat: allow any README for .profile (#8798) 2025-09-01 13:58:00 +02:00
repo fix: prevent initial 'blank' display of action logs view, remove unnecessary API calls (#9099) 2025-09-05 06:55:32 +02:00
shared feat: allow any README for .profile (#8798) 2025-09-01 13:58:00 +02:00
user feat: allow any README for .profile (#8798) 2025-09-01 13:58:00 +02:00
base.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
githttp.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
goget.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
home.go feat: Global 2FA enforcement (#8753) 2025-08-15 10:56:45 +02:00
metrics.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
nodeinfo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
swagger_json.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
web.go feat: ability to view previous logs for Actions runs that have been retried (#9017) 2025-09-04 22:46:22 +02:00
webfinger.go fix: trim trailing slash in WebFinger OIDC issuer link (#8794) 2025-08-06 14:50:51 +02:00