Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

only perform scrolling when really required

Jonas Jabari6107dcd158bc
diff --git a/frontend/src/app/core/turbo/turbo-requests.service.ts b/frontend/src/app/core/turbo/turbo-requests.service.ts
index 30d83c7dda9..f5dfb7364c0 100644
--- a/frontend/src/app/core/turbo/turbo-requests.service.ts
+++ b/frontend/src/app/core/turbo/turbo-requests.service.ts
@@ -19,7 +19,11 @@ export class TurboRequestsService {
return response.text();
})
- .then((html) => renderStreamMessage(html))
+ .then((html) => {
+ renderStreamMessage(html);
+
+ return html; // enable further processing wherever this is called
+ })
.catch((error) => this.toast.addError(error as string));
}
diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts
index 6367f76149b..302895dc2e8 100644
--- a/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts
@@ -131,8 +131,8 @@ export default class IndexController extends Controller {
const journalsContainerAtBottom = this.isJournalsContainerScrolledToBottom(this.journalsContainerTarget);
- void this.performUpdateStreamsRequest(this.prepareUpdateStreamsUrl()).then(() => {
- this.handleUpdateStreamsResponse(journalsContainerAtBottom);
+ void this.performUpdateStreamsRequest(this.prepareUpdateStreamsUrl()).then((html) => {
+ this.handleUpdateStreamsResponse(html as string, journalsContainerAtBottom);
}).catch((error) => {
console.error('Error updating activities list:', error);
}).finally(() => {
@@ -157,8 +157,12 @@ export default class IndexController extends Controller {
});
}
- private handleUpdateStreamsResponse(journalsContainerAtBottom:boolean) {
+ private handleUpdateStreamsResponse(html:string, journalsContainerAtBottom:boolean) {
this.setLastUpdateTimestamp();
+ // only process append and prepend actions
+ if (!(html.includes('action="append"') || html.includes('action="prepend"'))) {
+ return;
+ }
// the timeout is require in order to give the Turb.renderStream method enough time to render the new journals
setTimeout(() => {
if (this.sortingValue === 'asc' && journalsContainerAtBottom) {