Conversation
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.
…ring sanitization' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
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. |
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
AGENTS.md,.cursorrules, and.github/copilot-instructions.md, specifying architectural patterns, code quality rules, directory structure, and documentation synchronization requirements. [1] [2] [3]README.mdwith a project overview, installation steps, usage instructions, feature highlights, and architecture summary, improving onboarding for new developers and users.Build System & Project Metadata
build.jsscript to orchestrate Vite builds for extension pages, background scripts, and content scripts, ensuring correct output formats and directory structure. Updated thebuildscript inpackage.jsonto use this new build process. [1] [2]package.jsonand manifest version numbers to0.0.1for consistency across the project. [1] [2]jsdomas a development dependency to support DOM-related testing or tooling.Permissions & Manifest
<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.