Conversation
Activity
|
||||||||||||||||||||||||||||
| Project |
Activity
|
| Branch Review |
feat/405/auto-load-new-activities
|
| Run status |
|
| Run duration | 02m 00s |
| Commit |
|
| Committer | Anna |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
1
|
|
|
0
|
|
|
9
|
| View all changes introduced in this branch ↗︎ | |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
d9cdd6b to
4bbbbed
Compare
4bbbbed to
a4995e1
Compare
a4995e1 to
98fe59d
Compare
98fe59d to
ab0f2af
Compare
ab0f2af to
37693eb
Compare
37693eb to
7fdaa98
Compare
7fdaa98 to
3d0d63e
Compare
3d0d63e to
ebd2050
Compare
ebd2050 to
9ebdf54
Compare
|
/compile amend |
Fix #405 Signed-off-by: Anna Larch <anna@nextcloud.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
9ebdf54 to
57f432c
Compare
| const response = await ncAxios.get(generateOcsUrl('apps/activity/api/v2/activity/{filter}?format=json&previews=true&since={since}', { filter: props.filter, since })) | ||
| allActivities.value.push(...response.data.ocs.data.map((raw) => new ActivityModel(raw))) | ||
| const response = await ncAxios.get(generateOcsUrl('apps/activity/api/v2/activity/{filter}?format=json&previews=true&since={since}', { filter: props.filter, since }), { signal }) | ||
| if (signal.aborted) { |
There was a problem hiding this comment.
Aborted signal should throw an error, I'm not sure it's gonna reach this code even. Please try to check whenever happening
| }) | ||
| } catch (error) { | ||
| if (axios.isCancel(error)) { | ||
| return |
There was a problem hiding this comment.
This should be the correct handling for AbortController
| allActivities.value.unshift(...newActivities) | ||
| } else { | ||
| // Queue for the indicator so reading position is not disrupted | ||
| pendingNewActivities.value.unshift(...newActivities) |
There was a problem hiding this comment.
If we're not at the top, prepending should not break the rendering, i think? so scroll position should remain the same
| * Prepend all queued activities and scroll back to the top | ||
| */ | ||
| function loadPendingActivities() { | ||
| allActivities.value.unshift(...pendingNewActivities.value) |
There was a problem hiding this comment.
So button can just scroll to the top
| allActivities.value.unshift(...pendingNewActivities.value) |
| class="activity-app__new-activities-indicator" | ||
| type="button" | ||
| @click="loadPendingActivities"> | ||
| {{ n('activity', 'Load {count} new activity', 'Load {count} new activities', pendingNewActivities.length, { count: pendingNewActivities.length }) }} |
There was a problem hiding this comment.
It's loaded already, just not shown, until you click. Maybe just:
| {{ n('activity', 'Load {count} new activity', 'Load {count} new activities', pendingNewActivities.length, { count: pendingNewActivities.length }) }} | |
| {{ t('activity', 'New activities') }} |
| </template> | ||
| </NcEmptyContent> | ||
| <div ref="container" class="activity-app__container"> | ||
| <button |
There was a problem hiding this comment.
| <button | |
| <NcButton |
| @@ -26,6 +26,13 @@ | |||
| </template> | |||
| </NcEmptyContent> | |||
| <div ref="container" class="activity-app__container"> | |||
There was a problem hiding this comment.
this can listen for @scroll event with a debounce and do this perhaps to hide the button?
const isNearTop = !container.value || container.value.scrollTop < 50
if (isNearTop && pendingNewActivities.value.length !== 0) {
pendingNewActivities.value = []
}
Fix #405
Screencast.from.2026-03-12.14-34-11.webm