Skip to content

Merge features: manual rewrite, local storage, and workspace updates#24

Open
Davbp24 wants to merge 7 commits into
mainfrom
features
Open

Merge features: manual rewrite, local storage, and workspace updates#24
Davbp24 wants to merge 7 commits into
mainfrom
features

Conversation

@Davbp24

@Davbp24 Davbp24 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Manual rewrite (extension pill): Restored and fixed the manual text-replacement flow — dedicated manualRewrites.ts module, hover popover, double-click to restore original text, and DOM replay on page reload.
  • Annotation storage model (two paths):
    • Not signed in: Annotations (manual rewrites, highlights, sticky notes, etc.) are saved to chrome.storage.local on that browser install/profile only. Nothing is written to Supabase. Data stays on the device and is not shared with other users.
    • Signed in (dashboard auth synced): Saves go to Supabase via POST /api/annotations, with a local browser copy as cache/fallback if the backend is unreachable.
  • Manual rewrite bug fixes: Fixed a race where scheduled annotation reloads overwrote in-memory edits and removed DOM marks before saves completed; sync now merges local session with remote data and tracks in-flight saves.
  • Backend: manualRewrites feature key support in AnnotationsAPI (notes mirror, tags, shape for History).
  • Web app (from features branch): Study plans, knowledge cards, analytics insights chat, AI feedback, dashboard onboarding, document/chat UI improvements, formatted AI text, CI workflow, and related migrations.

Known follow-up (signed-in Supabase isolation)

The annotations table is currently upserted on page_url only (onConflict: page_url), not per user_id. Two signed-in users on the same URL could theoretically read/overwrite the same row. Unsigned users are not affected — they never hit Supabase. The mirrored notes rows are already scoped by user_id. A follow-up migration should add a unique index on (user_id, page_url) plus RLS and update the API to filter by authenticated user.

Test plan

  • Load extension from inlineExtension/dist, reload a test page
  • Unsigned: Create a manual rewrite → reload page → edit persists; check chrome.storage.local for inlineLocalAnnotations:*
  • Unsigned: Double-click manual edit → original text restored, entry removed from local storage
  • Signed in: Open Inline dashboard to sync auth → manual rewrite saves → visible in Supabase annotations.elements.manualRewrites and History
  • Highlights / sticky notes still save locally when unsigned
  • Web: smoke-test study plan, analytics insights, and document chat routes

ryanlyn29 and others added 7 commits June 25, 2026 22:08
… development experience

- Revised README to clarify project structure and core features, including updates to the web app description and core functionalities.
- Modified AnnotationsAPI.js to dynamically set the NEXT_APP_URL based on the environment, improving deployment flexibility.
- Enhanced ESLint configuration to include a warning for only-export-components rule, promoting better coding practices.
- Updated Vite configuration files to ensure proper handling of environment variables and asset copying during builds.
- Improved local development setup by adjusting package.json scripts for better build processes and manifest handling.
- Refactored content and background scripts to streamline asset management and improve overall extension performance.
- Enhanced various components in the inline extension for better UI consistency and functionality, including updates to the FormattedAiText and content scripts.
…oved performance

- Downgraded TypeScript dependency from 6.0.2 to 5.9.3 in package.json and package-lock.json for compatibility.
- Updated background.js and content.js files to streamline functionality and improve performance.
- Modified index.html to reference the latest built JavaScript file for better asset management.
- Refined manifest.json to restrict host permissions to the production URL, enhancing security.
- Removed outdated JavaScript file to clean up the distribution directory and reduce clutter.
- Enhanced document page components to improve UI consistency and functionality, including the addition of new components for better user interaction.
…and UI consistency

- Introduced the FormattedAiText component to render AI output with enhanced formatting options, including support for bold, italic, underline, and lists.
- Updated CropOverlay, SmartOverlay, and various document components to utilize FormattedAiText for better presentation of AI-generated content.
- Refactored the AssistantMessageContent and InsightsSummary components to leverage new formatting capabilities, improving readability and user experience.
- Enhanced the Search component to strip markdown from text snippets, ensuring cleaner display in search results.
- Improved styling and structure in multiple components for a more cohesive UI across the extension.
…d changed. PR will be set up to merge with main soon.
Unsigned users save annotations to chrome.storage.local per browser profile;
signed-in users sync to Supabase with a local cache fallback. Manual rewrites
use merge-based sync so background reloads no longer wipe in-flight edits.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Davbp24 Davbp24 requested a review from ryanlyn29 June 26, 2026 10:15
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inline Ready Ready Preview, Comment Jun 26, 2026 10:15am

@ryanlyn29 ryanlyn29 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verification summary

Tested against features @ 994d592.

Passed

  • Builds: web lint + build, inlineExtension lint + build, backend build all succeed.
  • Web (local + Vercel preview): Marketing/login routes load (200). Workspace routes correctly require auth.
  • Extension: build:dev succeeds; manualRewrites.ts is wired through ContentShellrestoreManualRewrites(). Unsigned path correctly uses chrome.storage.local (inlineLocalAnnotations:*, AES-GCM encrypted) when no JWT/workspace is present.
  • Manual rewrite logic: Double-click restore, pendingSaveIds race guard, and local/remote merge look correct in code.

Partial / not fully verified in automation

  • Authenticated dashboard, study plans, knowledge cards, analytics chat, and document chat need a signed-in browser pass.
  • Chrome extension unsigned/signed manual rewrite flows should be confirmed manually (select → replace → refresh → double-click restore → refresh).

Blocker — signed-in Supabase isolation

Confirmed in backend/src/apiBranch/AnnotationsAPI.ts: fetch and upsert use page_url only (onConflict: "page_url"), not (user_id, page_url).

Repro: two saves to the same page_url overwrite the prior elements.manualRewrites blob. Two signed-in users on the same URL can read/overwrite the same row. Mirrored notes are scoped by user_id, so History may look fine while the shared blob is wrong.

Request: Fix before merge to production:

  1. Migration — unique index on (user_id, page_url) for annotations
  2. RLS scoped per authenticated user
  3. Update fetch + upsert to filter/conflict on (user_id, page_url)

Recommendation

  • Guest/local-only usage: OK to merge for testing.
  • Production with signed-in sync: Do not merge until the annotations isolation fix lands.

Happy to re-review once the migration + API changes are in.

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.

2 participants