Skip to content

refactor: extract shared utils and fix availability endpoint - #24

Open
sdass1918 wants to merge 51 commits into
mainfrom
refactor/extract-shared-utils
Open

refactor: extract shared utils and fix availability endpoint#24
sdass1918 wants to merge 51 commits into
mainfrom
refactor/extract-shared-utils

Conversation

@sdass1918

@sdass1918 sdass1918 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Moves shared helpers (sleep, isPlaybackPage, formatDate) into utils/helpers.js and switches getAvailability to use the CDX API instead of archive.org.

sdass1918 and others added 30 commits May 25, 2026 16:05
The context-menu click handler must be async because subsequent logic awaits asynchronous checks (e.g. AI availability) before continuing. Without an async listener, await cannot be used and the workflow fails.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
checkAIAvailability() is async, but it's currently used as a boolean without await, so the Promise is always truthy and this guard never blocks when AI is unavailable.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
The parent context menu was registered for all pages, causing it to appear outside web.archive.org playback URLs. Clicking the menu on unsupported pages failed because no content script was injected there ("Receiving end does not exist"). Restrict the menu to Wayback playback URLs to prevent invalid usage.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
sdass1918 added 21 commits June 23, 2026 10:44
…fix screenshot capture timing and append format
…ntent for quality analysis

The quality analysis feature was broken because append() followed by
promptStreaming() does not reliably ground image data with Gemini Nano.
The model could not see the screenshot even though it was added to the
session history.

Fix: pass the image and text prompt together as a single structured
message array directly to promptStreaming() instead of using append().

Also removed page content from the quality prompt since it is not needed
for quality analysis and only wastes context window space. The content
extraction step is also skipped for quality actions to save time.
…ips, new insights schema, remove branching diagram from readme, skip timings for summarize
- Add getTimelineData() CDX API to fetch per-month status data
- Render timeline heatmap grid showing 12 months per year
- Color-coded cells: green (2xx), orange (3xx), red (4xx/5xx), grey (unrecorded)
- Clickable cells open Wayback Machine playback for that snapshot
- Add disclaimer explaining monthly collapse behavior
- Consistent grey/underlined style for timeline refresh links
- Popup UI refinements: narrower width, 3-column grid, compact spacing
- Reduce health cache TTL to 1 day and storage sweep to 1 day
- Move sleep(), isPlaybackPage(), formatDate() to utils/helpers.js
- Import from helpers in api/cdx.js, background.js, and popup/popup.js
- Remove duplicated isPlaybackPage definitions
- Remove local formatTimestamp / sleep / formatDate duplicates
- Reimplement getAvailability() using CDX API instead of
  archive.org/wayback/available (avoids cross-origin fetch issues)
- Replace empty pageLoader.js stub with proper waitForPageLoad() export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant