Commit Graph
2210 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 9c65a78249 chore(agents): run event-schema-agent weekly task
- Implement `scripts/agent/validate-events.mjs` harness.
- Fix `buildWatchHistoryEvent` to default `monthIdentifier` if missing.
- Verified all builders produce valid events.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-13 05:14:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4059d52847 fix(ui): profile modal controller instantiation order
- Moved controller instantiation (DM, Relay, Hashtag) to after services setup in `ProfileModalController.js`.
- Fixed `ProfileHashtagController` usage of uninitialized services.
- Updated `profile-modal-controller.test.mjs` mock to include `uiReady/dataReady` flags and use correct service access pattern.
- Resolved CI failures in `profile-modal-controller.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-13 03:50:42 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1b68e3c5f2 [decompose] extract ProfileHashtagController from js/ui/profileModalController.js
Extracts all hashtag preference related logic into a new controller
`js/ui/profileModal/ProfileHashtagController.js` to reduce the size of `js/ui/profileModalController.js` and improve maintainability.

- Moves `normalizeHashtagTag`, `formatHashtagTag`, `getResolvedHashtagPreferences`, `setHashtagStatus`, `refreshHashtagBackgroundStatus`, `populateHashtagPreferences`, `renderHashtagList`, `sanitizeHashtagList`, `createHashtagListItem`, `persistHashtagPreferences`, `handleAddHashtagPreference`, `handleRemoveHashtagPreference`, `handleHashtagPreferencesChange`, `describeHashtagPreferencesError`.
- Updates `ProfileModalController` to delegate to `ProfileHashtagController`.
- Adds delegate getters/methods in `ProfileModalController` to maintain backward compatibility for tests.
- Reduces `js/ui/profileModalController.js` by ~600 lines.
- Updates file size baseline in `scripts/check-file-size.mjs`.

Passes `npm run lint` and `npm run test:unit`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-13 02:26:08 +00:00
google-labs-jules[bot]andPR0M3TH3AN 393c06c749 [decompose] extract ProfileHashtagController from js/ui/profileModalController.js
Extracts all hashtag preference related logic into a new controller
`js/ui/profileModal/ProfileHashtagController.js` to reduce the size of `js/ui/profileModalController.js` and improve maintainability.

- Moves `normalizeHashtagTag`, `formatHashtagTag`, `getResolvedHashtagPreferences`, `setHashtagStatus`, `refreshHashtagBackgroundStatus`, `populateHashtagPreferences`, `renderHashtagList`, `sanitizeHashtagList`, `createHashtagListItem`, `persistHashtagPreferences`, `handleAddHashtagPreference`, `handleRemoveHashtagPreference`, `handleHashtagPreferencesChange`, `describeHashtagPreferencesError`.
- Updates `ProfileModalController` to delegate to `ProfileHashtagController`.
- Adds delegate getters/methods in `ProfileModalController` to maintain backward compatibility for tests.
- Reduces `js/ui/profileModalController.js` by ~600 lines.
- Updates file size baseline in `scripts/check-file-size.mjs`.

Passes `npm run lint` and `npm run test:unit`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-13 02:06:08 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5f1edebea7 [decompose] extract ProfileHashtagController from js/ui/profileModalController.js
Extracts all hashtag preference related logic into a new controller
`js/ui/profileModal/ProfileHashtagController.js` to reduce the size of `js/ui/profileModalController.js` and improve maintainability.

- Moves `normalizeHashtagTag`, `formatHashtagTag`, `getResolvedHashtagPreferences`, `setHashtagStatus`, `refreshHashtagBackgroundStatus`, `populateHashtagPreferences`, `renderHashtagList`, `sanitizeHashtagList`, `createHashtagListItem`, `persistHashtagPreferences`, `handleAddHashtagPreference`, `handleRemoveHashtagPreference`, `handleHashtagPreferencesChange`, `describeHashtagPreferencesError`.
- Updates `ProfileModalController` to delegate to `ProfileHashtagController`.
- Reduces `js/ui/profileModalController.js` by ~600 lines.
- Updates file size baseline in `scripts/check-file-size.mjs`.

Passes `npm run lint` and `npm run test:unit`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-13 01:39:22 +00:00
google-labs-jules[bot]andPR0M3TH3AN f130fbc3cc chore(agents): run const-refactor-agent daily task — Refactored timeouts in UI controllers (reverted webtorrent fix)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 23:20:02 +00:00
google-labs-jules[bot]andPR0M3TH3AN a77e182ed1 chore(agents): run const-refactor-agent daily task — Refactored timeouts in UI controllers and webtorrent.js to use canonical constants
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 23:10:37 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7f97c3cece Fix NIP-07 login failure by removing non-standard permission strings
Removed `read_relays` and `write_relays` from `DEFAULT_NIP07_CORE_METHODS` in `js/nostr/nip07Permissions.js` as they are not standard NIP-07 or NIP-46 permission strings and were causing login failures with some extensions. Also ensured `jsdom` is installed for unit tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 17:40:10 +00:00
thePR0M3TH3AN b958cd03a3 Merge pull request #2392 from PR0M3TH3AN/perf/lazy-loading-images-5531542145161108085
⚡ Optimize image loading with lazy and async attributes
2026-02-12 12:06:35 -05:00
google-labs-jules[bot]andPR0M3TH3AN df62585106 perf: enable lazy loading for avatars and thumbnails
Added `loading="lazy"` and `decoding="async"` attributes to dynamically created `<img>` elements in:
- `js/historyView.js` (avatars)
- `js/ui/subscriptionHistoryController.js` (channel icons)
- `js/searchView.js` (added `decoding="async"`)
- `js/ui/profileModal/ProfileDirectMessageRenderer.js` (attachment previews, avatars)
- `js/ui/profileModalController.js` (attachment previews, saved profile avatars)

This reduces initial page load impact and bandwidth usage by deferring off-screen image loading.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 16:56:06 +00:00
google-labs-jules[bot]andPR0M3TH3AN 69c1528ac0 perf: bound concurrency in authService profile hydration
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 16:32:53 +00:00
google-labs-jules[bot]andPR0M3TH3AN a997120f42 chore(ai): doc js/nostr/client.js and videoEventBuffer.js
- Add JSDoc to exported methods in `js/nostr/client.js`
- Add JSDoc to `js/nostr/videoEventBuffer.js`
- Add in-code comments for complex algorithms (history hydration, soft/hard delete, buffering)
- Update `docs/nostr-client-overview.md` with invariants and pitfalls
- No functional changes

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 15:28:54 +00:00
thePR0M3TH3AN 45ab69ef78 Merge branch 'unstable' into perf/bound-comment-concurrency-6703856395977422565 2026-02-12 09:13:51 -05:00
thePR0M3TH3AN 2540eb3c09 Merge pull request #2377 from PR0M3TH3AN/unstable-4082822914869153269
[constants] Refactor duplicate numeric constants
2026-02-12 09:10:12 -05:00
google-labs-jules[bot]andPR0M3TH3AN 852bf51b0a refactor: extract CommentTargetNormalizer to fix file size violation
- Extracted `CommentTargetNormalizer` and related helpers to `js/nostr/commentTargetNormalizer.js`.
- Refactored `js/nostr/commentEvents.js` to import from the new module.
- Compacted helper functions in `js/nostr/commentTargetNormalizer.js` to ensure it stays under the 1000-line limit for new files.
- Verified with `npm run lint:file-size` and `tests/nostr/comment-events.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 13:49:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4d73092613 perf: bound comment relay concurrency and fix docs port
- Replace `Promise.all` with `pMap` in `js/nostr/commentEvents.js` to limit concurrent relay requests to `RELAY_BACKGROUND_CONCURRENCY` (3).
- Update `content/docs/guides/upload-content.md` to use port 3000 for CORS, matching `npm start` default.
- Update agent artifacts (`CONTEXT.md`, `TODO.md`, `DECISIONS.md`, `TEST_LOG.md`, `INITIAL_BASELINE.md`).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 13:39:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2aae4094e7 [constants] refactor duplicate numeric constants
- Add `UI_FEEDBACK_DELAY_MS`, `DEBOUNCE_DELAY_MS`, and `NETWORK_RETRY_DELAY_MS` to `js/constants.js`.
- Replace magic numbers (5000, 2000, 1500) with semantic constants in:
  - `js/ui/notificationController.js`
  - `js/ui/profileModal/ProfileDirectMessageActions.js`
  - `js/ui/urlHealthController.js`
  - `js/app/uiCoordinator.js`
  - `js/ui/components/VideoModal.js`
  - `js/ui/components/UploadModal.js`
  - `js/services/dmNostrService.js`
  - `js/services/hashtagPreferencesService.js`
  - `js/app/feedCoordinator.js`
  - `js/services/moderationService.js`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 03:43:03 +00:00
google-labs-jules[bot]andPR0M3TH3AN fd9daef40b [security] Remove innerHTML usage from searchView.js
Refactored `js/searchView.js` to use safe DOM APIs (`document.createElement`, `replaceChildren`, `textContent`) instead of `innerHTML`.
This reduces the attack surface for XSS vulnerabilities.
Updated `scripts/check-innerhtml.mjs` baseline.
Verified with unit tests and a frontend verification script.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 03:41:34 +00:00
google-labs-jules[bot]andPR0M3TH3AN d3fa684e45 perf: bound relay background concurrency to 3
Replaces unbounded `Promise.all(relays.map(...))` calls with `pMap` using a concurrency limit of 3 for background operations like history hydration, metadata fetching, and DM sending.
This prevents network saturation and potential main-thread jank when many relays are configured.
Includes benchmark verification script `benchmarks/relay_concurrency_repro.mjs`.
Audited upload docs and confirmed accuracy.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 21:31:53 +00:00
thePR0M3TH3AN 0607367f1a Merge pull request #2368 from PR0M3TH3AN/decompose-profile-modal-controller-1637476114002717833
Decompose ProfileModalController
2026-02-11 16:17:07 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7300977a6d [decompose] extract DM and Relay controllers from ProfileModalController
Extracted ProfileDirectMessageController (split into Controller, Actions, Renderer, Helper) and ProfileRelayController from ProfileModalController to reduce file size and improve maintainability.

ProfileModalController.js size reduced from ~12000 lines to ~8750 lines.
Updated unit tests to reflect the new structure.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 21:15:06 +00:00
thePR0M3TH3AN 244f5f80a8 Merge pull request #2367 from PR0M3TH3AN/claude/fix-sync-and-dm-issues-NMShC
Fix NIP-07 adapter support and improve signer resolution
2026-02-11 15:01:35 -05:00
Claude 53b8a2609c fix: recognize NIP-07 signer type for extension permission pre-granting
The NIP-07 adapter uses type "nip07" but all permission pre-granting
checks only matched type "extension", causing NIP-07 browser extension
users to fail decryption for block/mute lists, subscriptions, DMs, and
watch history. Hashtag preferences appeared to work because their read
path had a separate fix, masking the systemic issue.

Changes:
- shouldRequestExtensionPermissions() now matches both "extension" and
  "nip07" signer types (central fix affecting DM signals, comments,
  publish helpers, and watch history fetch)
- buildDmDecryptContext() pre-grants extension permissions for NIP-07
- userBlocks.js: remove capabilities-gated decryptor check that failed
  with lazy NIP-07 module injection (same fix already in subscriptions.js);
  always resolve signer regardless of allowPermissionPrompt; increase
  fast-path relay timeout from 6s to 10s
- watchHistoryService: recognize NIP-07 type and always resolve signer
- All publish paths (blocks, subscriptions, hashtags, relays, uploads,
  sharing, moderation) now pre-grant permissions for NIP-07 signers

https://claude.ai/code/session_01PipsdaTQmw7wBTJ1LmJjkk
2026-02-11 19:41:53 +00:00
google-labs-jules[bot]andPR0M3TH3AN 99e904d7c1 Optimize explore data worker transfer with lightweight video objects
- Implements `toLightweightVideo` helper in `js/services/exploreDataService.js` to strip large fields (content, signatures, etc.) from video objects before sending to the worker.
- Updates `buildWatchHistoryTagCounts` and `buildTagIdf` to use lightweight objects.
- Adds `tests/services/exploreDataService.optimization.test.mjs` to verify correctness.
- Adds `benchmarks/worker_transfer_lightweight_bench.js` demonstrating ~40% improvement in transfer time.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 17:15:25 +00:00
thePR0M3TH3AN d07bf6308f Merge pull request #2360 from PR0M3TH3AN/ai/doc-events-cache-20250209-13537943595919351490
chore(ai): document js/nostr/managers/EventsCacheStore.js
2026-02-11 10:33:26 -05:00
google-labs-jules[bot]andPR0M3TH3AN 676f41d76d chore(ai): doc js/nostr/managers/EventsCacheStore.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 15:30:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 78e53a8a1d refactor: simplify comment target normalization logic
Introduces `CommentTargetNormalizer` class to decompose the complex `normalizeCommentTarget` function into smaller, state-managed methods. This improves readability and maintainability without changing the external API or behavior.

- Extracted logic into `extractPointers`, `resolveEventsAndTags`, `extractInitialValues`, `enrichFromTags`, and `applyDefaults`.
- Preserved all fallback logic and tag parsing rules.
- Ensured strict string normalization in `extractInitialValues` to match original behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 15:23:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3078c46b89 feat(tests): add S3UploadService tests and refactor for testability
- Refactor `S3UploadService` to accept dependencies in constructor
- Move `resolveUploadIdentifier` to class method for mocking
- Add comprehensive unit tests for `S3UploadService` covering event emitter, validation, and upload logic
- Ensure `WebTorrent` dependency is mocked or polyfilled in test environment

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 14:42:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN e62cb15c0e perf: parallelize timestamp resolution in feed engine
Replaces sequential await loop with Promise.any to resolve video timestamps in parallel.
This significantly reduces latency when multiple resolvers are present, especially if the first one is slow.

- Uses Promise.any to take the first valid finite timestamp.
- Wraps resolvers to reject on invalid values.
- Preserves error logging for genuine resolver errors.
- Benchmarks showed improvement from ~100ms to ~11ms in simulated slow scenarios.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 12:38:20 +00:00
google-labs-jules[bot]andPR0M3TH3AN b28e62963f perf: Batch video timestamp resolution to reduce N+1 network requests
- Implemented `hydrateVideoHistoryBatch` in `NostrClient` to fetch missing root events and sparse histories in a single `pool.list` request.
- Refactored `hydrateVideoHistory` to use shared helper methods `getLocalVideoHistory` and `_processAndCacheEvent`.
- Added `resolveVideoPostedAtBatch` to `PlaybackCoordinator` which delegates to the batched client method.
- Updated `VideoListView` to collect videos needing timestamp resolution and call the batch method, falling back to individual calls if necessary.
- Added regression test `tests/performance/resolvePostedAt.test.mjs` to verify reduced network calls.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 12:01:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8027ec9b2b Refactor sendDirectMessage to use strategy pattern for NIP-04/17
Extracted NIP-17 and NIP-04 logic into separate private methods `_sendNip17DirectMessage` and `_sendNip04DirectMessage` to reduce complexity and improve readability of `sendDirectMessage`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 10:46:17 +00:00
thePR0M3TH3AN 90fad893bf Merge pull request #2341 from PR0M3TH3AN/refactor-events-cache-store-7678386515103062591
🧹 Refactor persistSnapshot in EventsCacheStore
2026-02-11 05:28:34 -05:00
thePR0M3TH3AN 96f1938004 Merge pull request #2337 from PR0M3TH3AN/fix/security-remove-unsafe-logging-997674150393261615
🔒 Remove vulnerable unused logging function
2026-02-11 05:27:52 -05:00
google-labs-jules[bot]andPR0M3TH3AN e697d89946 Refactor persistSnapshot to use generic diffAndStore helper
Extracts the duplicate logic for diffing and persisting events and tombstones in `EventsCacheStore` into a private `_diffAndStore` helper method. This improves maintainability and reduces code duplication.

Also adds a new test file `tests/nostr/eventsCacheStore.test.mjs` to verify the functionality of `EventsCacheStore` using `fake-indexeddb`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 04:27:35 +00:00
google-labs-jules[bot]andPR0M3TH3AN 58fc143c66 Refactor editVideo into validation, prep, and publish steps
Split the long `editVideo` method in `js/nostr/client.js` into three
distinct parts:
1. `_validateEditPrerequisites`: Handles input validation and state checks.
2. `prepareVideoEditPayload`: Existing helper for payload construction.
3. `_signAndPublishEdit`: Handles signing and network operations.

This improves maintainability and readability by separating concerns.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 04:13:50 +00:00
thePR0M3TH3AN b1f06695a6 Merge pull request #2339 from PR0M3TH3AN/suppress-nip17-relay-warning-3701543430430345832
Add config to suppress NIP-17 relay warnings
2026-02-10 23:06:50 -05:00
google-labs-jules[bot]andPR0M3TH3AN 5ca378bb96 Add ENABLE_NIP17_RELAY_WARNING config to suppress privacy warnings
Added a new configuration variable `ENABLE_NIP17_RELAY_WARNING` to `config/instance-config.js` (defaulting to `false`) to control the display of NIP-17 relay fallback warnings. Updated `js/ui/profileModalController.js` and `js/app.js` to respect this setting.

This change allows instance operators to disable "Privacy warning: direct messages are using your default relays because no NIP-17 relay list is available" and related notifications.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 04:05:36 +00:00
google-labs-jules[bot]andPR0M3TH3AN 99fbe96f5c security: Remove unused vulnerable logging function in NostrClient
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:57:24 +00:00
thePR0M3TH3AN ca57f9caaf Merge pull request #2336 from PR0M3TH3AN/decompose-profile-modal-controller-5857031998313460612
Decompose ProfileModalController: Extract Wallet and Storage Controllers
2026-02-10 22:57:11 -05:00
thePR0M3TH3AN 2fd63b39e5 Merge pull request #2335 from PR0M3TH3AN/refactor-numeric-constants-unstable-17302506405327886541
Refactor numeric constants to centralized module
2026-02-10 22:56:45 -05:00
google-labs-jules[bot]andPR0M3TH3AN 48d33f45eb [decompose] Extract Wallet and Storage controllers from ProfileModalController
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:30:40 +00:00
google-labs-jules[bot]andPR0M3TH3AN c47392aba6 Refactor numeric constants to centralized module
- Introduce `js/constants.js` with semantic time constants (e.g., `ONE_MINUTE_MS`, `STANDARD_TIMEOUT_MS`) and feature-specific TTLs.
- Export `KIND_MUTE_LIST` from `js/nostrEventSchemas.js` to standardize NIP-51 mute list kind usage.
- Refactor `js/state/cache.js`, `js/nostr/cachePolicies.js`, `js/channelProfile.js`, and various services to use centralized constants instead of hardcoded magic numbers.
- Update `js/nostr/relayConstants.js` to derive values from the shared time constants.
- Replace duplicate definitions of timeouts and retry delays across the codebase.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:27:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8ca4a71240 [security] Migrate innerHTML in profileModalController.js
Replaced 26 instances of `innerHTML` assignment with safe DOM APIs (`textContent`, `replaceChildren`, `document.createElement`) in `js/ui/profileModalController.js`.
Updated the `scripts/check-innerhtml.mjs` baseline to reflect the reduction (from 27 to 1). The remaining instance loads a static HTML template.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:11:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6f49a05302 feat(perf): Optimize feed tag extraction with caching
- Extracted `getVideoTags` to `js/feedEngine/utils.js` with `WeakMap` caching.
- Updated `js/feedEngine/stages.js` and `js/feedEngine/kidsScoring.js` to use the cached utility.
- Removed redundant `collectVideoTags` and `normalizeTagSetFromVideo` functions.
- Added `benchmarks/feed_tags.mjs` to measure performance (approx 25x speedup in tight loops).
- Updated `hasDisinterestedTag` in `utils.js` to use the new utility.

This reduces object allocation and repeated string normalization during feed processing.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 19:44:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN f954bf3d89 Optimize feed engine normalization with array marking
- Introduced `NORMALIZED_ARRAY_MARKER` in `js/feedEngine/utils.js` to tag arrays that are already normalized.
- Updated `normalizeItems` in `js/feedEngine/engine.js` to skip O(N) verification if the input array is marked.
- Updated built-in stages and sorters to mark their output arrays using `markAsNormalized` when they safely construct new arrays from normalized inputs.
- This avoids redundant O(N) scans after each stage, improving pipeline performance by ~10% end-to-end and eliminating overhead for trusted stages.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 17:00:52 +00:00
thePR0M3TH3AN f1c7c5755d Merge pull request #2313 from PR0M3TH3AN/ai/doc-client-js-20250212-11570413463835939766
chore(ai): document js/nostr/client.js
2026-02-10 10:16:09 -05:00
google-labs-jules[bot]andPR0M3TH3AN 8df741f525 chore(ai): doc js/nostr/client.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 15:10:49 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0b35e2639b Refactor subscribeVideos buffering logic to VideoEventBuffer class
Separated the complex event buffering and flushing logic from `NostrClient.subscribeVideos` into a dedicated `VideoEventBuffer` utility class. This improves readability and maintainability of the `client.js` file.

- Created `js/nostr/videoEventBuffer.js`
- Updated `js/nostr/client.js` to use `VideoEventBuffer`
- Added unit tests in `tests/nostr/videoEventBuffer.test.mjs`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 14:37:02 +00:00
google-labs-jules[bot]andPR0M3TH3AN f148653c39 Refactor AuthService login logic
Extracted complex logic from `AuthService.login` into private helper methods (`_validateAndNormalizeLoginInputs`, `_checkAccessControl`, `_updateGlobalState`, `_updateSavedProfiles`, `_initiatePostLogin`) to improve readability and maintainability.

Moved `SimpleEventEmitter` to `js/utils/simpleEventEmitter.js` and auth constants/normalization helpers to `js/services/authUtils.js` to reduce file size and coupling.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 13:53:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN 023664847e Fix flaky popover E2E test by enforcing layout constraints and optimizing popover engine
- Updated `js/ui/overlay/popoverEngine.js` to use `fallbackStrategy: "bestFit"` in `flip` middleware, ensuring popovers choose the most visible placement when space is constrained.
- Updated `tests/e2e/popover.spec.ts` to enforce a tall body with top padding and scroll the trigger to the bottom of the viewport, creating a deterministic environment for testing popover flipping.
- Unskipped the "keeps the bottom-right grid menu inside the viewport" test case.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 13:13:53 +00:00