mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-30 16:39:33 +01:00
fix(web): announce only the truncation notice from the history bar (#814)
- _renderHistoryTruncationBanner sets aria-live to polite for the truncation notice and off for a reload-only bar, which re-renders on nearly every scroll-up in a busy tab; its button stays reachable with Tab. - docs: comma in the Reload eligibility list, and the live-region rule in the invariants paragraph.
This commit is contained in:
1 parent
6f5b3aca23
commit
7794f74282
3 files changed
+18
-1
No files matched your search
@@ -1295,6 +1295,18 @@ describe('manual history banner action', () => {
|
||||
if (visible) expect(button()?.textContent).toBe('Reload history');
|
||||
});
|
||||
|
||||
it('announces the truncation notice but keeps a reload-only bar silent', () => {
|
||||
const { app, bar, button } = fixture();
|
||||
app._syncHistoryReloadAction();
|
||||
expect(button()!.textContent).toBe('Reload history');
|
||||
expect(bar.setAttribute).toHaveBeenLastCalledWith('aria-live', 'off');
|
||||
// Revealing the truncation notice in the same bar makes it news again.
|
||||
app._historyNoticeRevealedFor = 's1';
|
||||
app._setHistoryTruncation('s1', { ...TAIL_CUT, truncationReason: 'tail' });
|
||||
expect(button()!.textContent).toBe('Load full history');
|
||||
expect(bar.setAttribute).toHaveBeenLastCalledWith('aria-live', 'polite');
|
||||
});
|
||||
|
||||
it('stands aside while a drop-recovery refresh fetches, then offers Reload again', async () => {
|
||||
const { app, bar, button } = fixture();
|
||||
app._syncHistoryReloadAction();
|
||||
|
||||
Reference in new issue
Block a user