Skip to content

Establish foundational documentation and enhance extension infrastructure#1

Open
paulpv wants to merge 15 commits into
mainfrom
0.0.2
Open

Establish foundational documentation and enhance extension infrastructure#1
paulpv wants to merge 15 commits into
mainfrom
0.0.2

Conversation

@paulpv

@paulpv paulpv commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces comprehensive documentation and build system improvements for the ContextScribe Chrome Extension, alongside updates to project metadata and permissions. The changes clarify contributor guidelines, enforce architectural constraints, and enhance the build process for better maintainability and onboarding.

Documentation & Contributor Guidelines

  • Added detailed agent and contributor instructions in AGENTS.md, .cursorrules, and .github/copilot-instructions.md, specifying architectural patterns, code quality rules, directory structure, and documentation synchronization requirements. [1] [2] [3]
  • Expanded the README.md with a project overview, installation steps, usage instructions, feature highlights, and architecture summary, improving onboarding for new developers and users.

Build System & Project Metadata

  • Introduced a custom build.js script to orchestrate Vite builds for extension pages, background scripts, and content scripts, ensuring correct output formats and directory structure. Updated the build script in package.json to use this new build process. [1] [2]
  • Updated package.json and manifest version numbers to 0.0.1 for consistency across the project. [1] [2]
  • Added jsdom as a development dependency to support DOM-related testing or tooling.

Permissions & Manifest

  • Changed extension permissions in documentation to use <all_urls> for host permissions, reflecting broader capture capabilities.

These updates collectively establish a strong foundation for maintainable development, clear onboarding, and robust build practices.

paulpv added 4 commits June 2, 2026 00:44
Introduce foundational documentation covering architectural patterns, Manifest V3 constraints, coding conventions, and documentation maintenance. These guides aim to onboard developers and AI assistants, ensuring consistent practices and adherence to project requirements.
…nifest.

This commit establishes the foundational infrastructure for the ContextScribe extension.
It introduces a custom `build.js` script using Vite to correctly bundle different extension script types (ES modules for background/popup/options, IIFE for content scripts).
A comprehensive `README.md` is added to guide users and developers on project setup, features, and usage.
Extension permissions are expanded to `<all_urls>` and `clipboardWrite` in `manifest.json` to enable core functionality across all webpages.
Default settings for AI providers are centralized in `constants.ts`, and minor UI/UX enhancements are made to the options and popup pages.
The project version is standardized to `0.0.1` across all relevant files, marking the first functional state.
This commit includes the following changes:

- toast.css: UI styles for the bottom progress badge with glassmorphism, expansion animations, stop actions, and textarea preview.
- adapters.ts / lenses.ts / recipes.ts: Add no-op fallback adapters/lenses/recipes ('none') to retain raw extracted content structures.
- types.ts: Add 'logFullPrompts' setting field to the main settings interface.
- chromeAI.ts / index.ts: Wire 'logFullPrompts' setting value into ChromeAIProvider.
… preview

This commit completes the implementation of background task lifecycle improvements, including:

- Task Aborting: Added support for canceling active runs via a stop/abort button on the progress UI, using AbortController inside background & content scripts.
- Popup Locking: Disabled the extension popup interactive elements during active background tasks via local storage sync.
- Stream Preview: Bottom-aligned glassmorphic toast/progress badge with expand button revealing a live-updating markdown preview textarea.
- DOM Extractions & Fixes: Target-based recursive DOM subtree extraction on GitHub PR comments and outdated threads, and improved selection highlighting.
- Log Settings: Toggleable verbose logs for full system/user prompts.
Comment thread src/content/index.ts Fixed
paulpv and others added 3 commits June 2, 2026 01:16
…ring sanitization'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR expands ContextScribe’s extension infrastructure and user-facing capture pipeline by adding a custom build orchestrator, richer extraction progress/streaming UX, new cancellation/task-state plumbing, and foundational repo documentation for contributors/agents.

Changes:

  • Added a two-phase Vite build (build.js) to produce MV3-compatible outputs (extension pages + SW as ESM, content script as IIFE) and updated package metadata.
  • Implemented live progress + streaming preview UI in the content script, plus background task state tracking and abort support wired through shared message types/settings.
  • Added/updated project documentation (README, agent/copilot/cursor rules) and expanded GitHub PR parsing/highlighting/expander behavior.

Reviewed changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/shared/utils.ts Adds progress-log message normalization for UI.
src/shared/types.ts Extends settings and message protocol; adds abort/stream actions and task state type.
src/shared/serializer.ts Enhances comment serialization to include severity and prefer structured children.
src/shared/constants.ts Introduces shared defaults for Ollama/LM Studio endpoints/models.
src/shared/config/recipes.ts Adds “No Recipe” dummy passthrough and ID handling.
src/shared/config/lenses.ts Adds “No Lens” dummy passthrough and ID handling.
src/shared/config/adapters.ts Adds “Raw Markdown” dummy adapter and ID handling.
src/popup/popup.ts Reads background task state and disables options while running; reacts to storage changes.
src/popup/popup.html UI styling update (Inter font, running indicator, disabled button styles).
src/options/options.ts Adds logFullPrompts setting and uses shared endpoint/model defaults.
src/options/options.html Adds logFullPrompts checkbox and updates displayed version; Inter font import.
src/content/toast.ts Adds progress badge with cancel/expand/copy and stream/status updates.
src/content/toast.css New stylesheet for toast/progress badge UI.
src/content/index.ts Adds progress lifecycle, streaming updates, improved clipboard copy robustness, and GitHub expand-before-extract behavior.
src/content/extractor/index.ts Threads formProtection through extraction routing.
src/content/extractor/highlight.ts Adds visual highlight overlay for extraction targets.
src/content/extractor/github.ts Major expansion of GitHub PR thread parsing (severity, suggestions, collapsed threads, code context).
src/content/extractor/generic.ts Adds whitespace folding, form-safety expansion, optional collapsed parsing, and highlight integration.
src/content/dom/githubExpander.ts Makes thread toggling async, scoped to target review/thread, with loading waits.
src/background/settings.ts Adds logFullPrompts default and shared constants for default provider config.
src/background/inference/ollama.ts Adds cached availability, streaming generation, and abort support.
src/background/inference/lmStudio.ts Adds cached availability, streaming generation, and abort support.
src/background/inference/index.ts Passes logFullPrompts into Chrome AI provider.
src/background/inference/deterministic.ts Adds streaming callback and abort support.
src/background/inference/chromeAI.ts Adds richer API detection, streaming, timeout/abort handling, and optional full prompt logging.
src/background/index.ts Adds task-state storage, context menu enable/disable sync, progress logging to tab, streaming relay, and abort controller wiring.
src/background/contextMenus.ts Makes menu setup awaitable to support state syncing.
public/manifest.json Broadens host permissions, adds clipboard permission, and injects content CSS.
package.json Updates version, adds jsdom, and switches build to node build.js.
package-lock.json Locks updated deps including jsdom and its Node engine requirements.
docs/initial_implementation_plan.md Updates permission/version guidance (but currently inconsistent vs manifest).
build.js New build orchestrator for multi-entry extension output formats.
README.md Adds full project overview, structure, setup, and usage documentation.
AGENTS.md Adds detailed contributor/agent guidance and architectural constraints.
.gitignore Normalizes ignore patterns and adds common ignores.
.github/copilot-instructions.md Adds repo-specific Copilot guidance.
.cursorrules Adds Cursor-specific repo conventions and constraints.

Comment thread README.md
Comment thread src/popup/popup.html Outdated
Comment thread src/options/options.html Outdated
Comment thread src/content/toast.css Outdated
Comment thread src/background/index.ts
Comment thread docs/initial_implementation_plan.md
Comment thread public/manifest.json
paulpv added 4 commits June 3, 2026 03:05
This change enhances the Chrome extension to extract complete and structured GFM markdown for GitHub PR review pages:

- Automatically expands the 'Show a summary per file' details section before element extraction.
- Implements recursive inline serialization to preserve style tags (links, bold, code, strike, br) inside text containers.
- Maps details elements to a new 'details' IR block type, which compiles back to HTML details elements in markdown.
- Broadens overview comment filters to preserve lists, tables, details, and code.
- Merges inline-only containers into a single paragraph block to avoid split metadata lines.
- README.md: Update Node.js recommendation to v20.19.0+ to match jsdom.
- popup.html & options.html: Remove external Google Fonts links to comply with extension CSP.
- toast.css: Remove remote font @import to avoid page CSP violations.
- background/index.ts & content/index.ts: Propagate abort/cancellation notifications to content script progress badge.
- docs/initial_implementation_plan.md: Sync initial plan version (0.0.2), permissions (clipboardWrite), and host permissions.
- AGENTS.md: Add documentation for fixtures/tests directory structure and parser testing rules.
Comment thread tests/exploratory/verify_loss_analysis.ts Fixed
@paulpv paulpv requested a review from Copilot June 3, 2026 11:20
@paulpv paulpv self-assigned this Jun 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

paulpv added 3 commits June 6, 2026 07:50
Resolves relative and root-relative href attributes for A tags and src attributes for IMG tags to fully qualified URLs using window.location.href in the serializeInline helper.

- Ensures that extracted Markdown is fully self-sufficient on another machine
- Leaves local repo file paths relative to the repository root unmodified
- Updates AGENTS.md instructions to document this new behavior
- Adds output verification snapshots to exploratory tests
- Format file paths as clickable relative Markdown links by default.
- Dedent code blocks and diff blocks to standardize indentation baseline.
- Avoid nesting code and diff blocks inside blockquotes.
- Add unit tests for formatting and dedenting logic.
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.

3 participants