feat: Rename to Toju and add translation
Some checks failed
Build Android APK / build-android-apk (push) Has been cancelled
Deploy Web Apps / deploy (push) Has been cancelled
Queue Release Build / prepare (push) Has been cancelled
Queue Release Build / build-linux (push) Has been cancelled
Queue Release Build / build-windows (push) Has been cancelled
Queue Release Build / finalize (push) Has been cancelled

This commit is contained in:
2026-06-05 17:13:03 +02:00
parent 8ecfc9a1fe
commit 85eef74bf7
301 changed files with 8245 additions and 2218 deletions

View File

@@ -14,38 +14,26 @@ describe('resolveAutoScrollBehavior', () => {
it('jumps instantly for the local user own send regardless of grace', () => {
expect(resolveAutoScrollBehavior({ ...base, forceLocalSend: true })).toBe('instant');
expect(
resolveAutoScrollBehavior({ ...base, forceLocalSend: true, withinInitialGrace: true })
).toBe('instant');
expect(resolveAutoScrollBehavior({ ...base, forceLocalSend: true, withinInitialGrace: true })).toBe('instant');
});
it('jumps instantly when near bottom while settling after a channel switch', () => {
expect(
resolveAutoScrollBehavior({ ...base, distanceFromBottom: 40, withinInitialGrace: true })
).toBe('instant');
expect(resolveAutoScrollBehavior({ ...base, distanceFromBottom: 40, withinInitialGrace: true })).toBe('instant');
});
it('animates smoothly for live messages once settled and near bottom', () => {
expect(
resolveAutoScrollBehavior({ ...base, distanceFromBottom: 40, withinInitialGrace: false })
).toBe('smooth');
expect(resolveAutoScrollBehavior({ ...base, distanceFromBottom: 40, withinInitialGrace: false })).toBe('smooth');
});
it('shows the indicator (no scroll) when far from the bottom', () => {
expect(resolveAutoScrollBehavior({ ...base, distanceFromBottom: 800 })).toBe('none');
expect(
resolveAutoScrollBehavior({ ...base, distanceFromBottom: 800, withinInitialGrace: true })
).toBe('none');
expect(resolveAutoScrollBehavior({ ...base, distanceFromBottom: 800, withinInitialGrace: true })).toBe('none');
});
it('honours a custom sticky threshold', () => {
expect(
resolveAutoScrollBehavior({ ...base, distanceFromBottom: 150, stickyThreshold: 100 })
).toBe('none');
expect(resolveAutoScrollBehavior({ ...base, distanceFromBottom: 150, stickyThreshold: 100 })).toBe('none');
expect(
resolveAutoScrollBehavior({ ...base, distanceFromBottom: 80, stickyThreshold: 100 })
).toBe('smooth');
expect(resolveAutoScrollBehavior({ ...base, distanceFromBottom: 80, stickyThreshold: 100 })).toBe('smooth');
});
});