aboutsummaryrefslogtreecommitdiffstats
path: root/frontend-vanilla/src/main.test.ts
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-16 10:53:59 -0800
committerAdam Mathes <adam@trenchant.org>2026-02-16 10:57:38 -0800
commit5cf8275540d7162cd4936a7c0e76dbfe7f66b62c (patch)
treefdb3c47560f1b1556f7c203f72d50d13f171c95a /frontend-vanilla/src/main.test.ts
parent96e78c5fdfada73d37644083c7580a1d444ed748 (diff)
downloadneko-5cf8275540d7162cd4936a7c0e76dbfe7f66b62c.tar.gz
neko-5cf8275540d7162cd4936a7c0e76dbfe7f66b62c.tar.bz2
neko-5cf8275540d7162cd4936a7c0e76dbfe7f66b62c.zip
V3 UI Polish: Improved keyboard navigation, fixed logo position, and updated branding
- Fix V3 keyboard navigation delay (resolved NK-wjats7) - Update V3 document title to 'neko' (resolved NK-4p3s91) - Fix V3 neko logo/button position to be top-left fixed (resolved NK-89za3s) - Improve FeedItems (React) stability with ref-based index tracking and robust tests - Sync V3 styling and selection feedback with V2 patterns - Rebuild production assets
Diffstat (limited to 'frontend-vanilla/src/main.test.ts')
-rw-r--r--frontend-vanilla/src/main.test.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/frontend-vanilla/src/main.test.ts b/frontend-vanilla/src/main.test.ts
index c9d0e0c..5bf9fe0 100644
--- a/frontend-vanilla/src/main.test.ts
+++ b/frontend-vanilla/src/main.test.ts
@@ -347,4 +347,25 @@ describe('main application logic', () => {
expect(manageSection?.innerHTML).toContain('My Feed');
expect(document.querySelector('.feed-tag-input')).not.toBeNull();
});
+
+ it('should navigate items with j/k keys', () => {
+ store.setItems([
+ { _id: 101, title: 'Item 1', publish_date: '2023-01-01', read: false } as any,
+ { _id: 102, title: 'Item 2', publish_date: '2023-01-02', read: false } as any
+ ]);
+ renderLayout();
+ renderItems();
+
+ // 1st press 'j' -> index 0
+ window.dispatchEvent(new KeyboardEvent('keydown', { key: 'j' }));
+ expect(document.querySelector('.feed-item[data-id="101"]')?.classList.contains('selected')).toBe(true);
+
+ // 2nd press 'j' -> index 1
+ window.dispatchEvent(new KeyboardEvent('keydown', { key: 'j' }));
+ expect(document.querySelector('.feed-item[data-id="102"]')?.classList.contains('selected')).toBe(true);
+
+ // Press 'k' -> back to index 0
+ window.dispatchEvent(new KeyboardEvent('keydown', { key: 'k' }));
+ expect(document.querySelector('.feed-item[data-id="101"]')?.classList.contains('selected')).toBe(true);
+ });
});