Skip to content

docs: refresh app view screenshots and add manual capture workflow#41

Merged
Mehdi-Bl merged 3 commits into
mainfrom
docs/update-ui-screenshots
Feb 9, 2026
Merged

docs: refresh app view screenshots and add manual capture workflow#41
Mehdi-Bl merged 3 commits into
mainfrom
docs/update-ui-screenshots

Conversation

@Mehdi-Bl

@Mehdi-Bl Mehdi-Bl commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a tracked docs page for current app panels (docs/APP_VIEWS.md)
  • generate and commit up-to-date screenshots for Start, Select Files, and Processed Output panels
  • extend Playwright screenshot harness to capture Processed Output state
  • add reproducible manual docs screenshot workflow (npm run docs:screenshots, make docs-screenshots)
  • add manual test instructions in tests/manual/docs-ui-screenshots.md

Validation

  • npm run docs:screenshots
  • make docs-screenshots
  • npm run qa:screenshot
  • npm test

Notes

  • docs screenshots are tracked under docs/images/
  • project backlog item "Update the doc" moved to In progress

Summary by Sourcery

Add a reproducible workflow to generate and track up-to-date UI screenshots for key app panels in documentation.

New Features:

  • Introduce a docs screenshot generation script that reuses the Playwright UI capture harness to produce documentation-ready images.
  • Add an APP_VIEWS docs page that showcases current screenshots for the main application panels.
  • Provide a manual docs UI screenshot test guide to standardize verification of documentation imagery.

Enhancements:

  • Extend the UI screenshot capture flow to cover the Processed Output panel and simulate realistic processed content data.
  • Allow overriding the screenshot output directory via an environment variable with validation against the project root.
  • Wire new docs screenshot commands into npm, the script CLI, Makefile, and test catalog for consistent local workflows.

Tests:

  • Document a manual test procedure for regenerating and validating docs UI screenshots.

Summary by CodeRabbit

  • New Features

    • Automated documentation screenshot generation via a new command (docs:screenshots) and capture of the processed-output panel.
    • Added an export format selector offering Markdown or XML outputs.
  • Documentation

    • New UI views doc listing panels and refresh instructions.
    • Manual test and example output pages showing markdown and XML examples.
  • Chores

    • Added markdown linting command and integrated it into the lint workflow.

@sourcery-ai

sourcery-ai Bot commented Feb 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a documented, reproducible workflow for generating and tracking app UI screenshots, including a new docs screenshot generator script, updated Playwright capture logic to support the Processed Output panel and configurable output directories, and new docs/manual test entries describing usage.

Sequence diagram for the docs screenshots refresh workflow

sequenceDiagram
  actor Developer
  participant Make as make
  participant Npm as npm_cli
  participant ScriptsIndex as scripts_index_js
  participant Utils as utils_js
  participant DocsScript as generate_doc_screenshots_js
  participant CaptureScript as capture_ui_screenshot_js
  participant Playwright as Playwright_chromium
  participant App as Electron_app_renderer

  Developer->>Make: make docs-screenshots
  Make->>ScriptsIndex: node scripts/index.js docs-screenshots
  ScriptsIndex->>Utils: runNpmScript docs:screenshots
  Utils->>Npm: npm run docs:screenshots
  Npm->>DocsScript: node scripts/generate-doc-screenshots.js

  DocsScript->>CaptureScript: spawnSync with UI_SCREENSHOT_DIR and UI_SCREENSHOT_NAME
  CaptureScript->>Playwright: launch chromium
  Playwright->>App: open app at UI_SCREENSHOT_PORT

  CaptureScript->>App: navigate and setup mockElectronApi
  CaptureScript->>App: capture config and source panel screenshots
  CaptureScript->>App: waitFor processSelectedFilesButton enabled
  CaptureScript->>App: click processSelectedFilesButton
  CaptureScript->>App: waitFor processedTabActive and processedContent
  CaptureScript->>App: capture processedTab screenshot
  CaptureScript-->>DocsScript: screenshots in dist/docs/screenshots

  DocsScript->>DocsScript: verify expected screenshots exist
  DocsScript->>DocsScript: copy to docs/images/*.png
  DocsScript-->>Developer: Docs screenshots refreshed successfully
Loading

Flow diagram for configurable screenshot capture and docs image generation

flowchart LR
  subgraph CaptureFlow[UI screenshot capture]
    A[Start capture_ui_screenshot_js] --> B[Resolve ROOT_DIR]
    B --> C[Resolve UI_SCREENSHOT_DIR via resolveOutputDirectory]
    C --> D[Validate directory is inside ROOT_DIR]
    D --> E[Build SCREENSHOTS paths including processedTab]
    E --> F[Launch Playwright chromium]
    F --> G[Load app at UI_SCREENSHOT_PORT]
    G --> H[Setup mockElectronApi
analyzeRepository
processRepository]
    H --> I[Capture config and source panel screenshots]
    I --> J[Set viewport to desktop size]
    J --> K[Wait for processSelectedFilesButton enabled]
    K --> L[Click processSelectedFilesButton]
    L --> M[Wait for processedTabActive and processedContent]
    M --> N[Capture processedTab screenshot]
    N --> O[Write files to UI_SCREENSHOT_DIR]
  end

  subgraph DocsGeneration[Docs screenshot generation]
    P[Start generate_doc_screenshots_js] --> Q[Set TEMP_SCREENSHOT_DIR]
    Q --> R[Spawn capture_ui_screenshot_js
with UI_SCREENSHOT_DIR and UI_SCREENSHOT_NAME]
    R --> S[Ensure capture exited with status 0]
    S --> T[Ensure docs/images exists]
    T --> U[For each mapping
from temporary name
to docs image name]
    U --> V{Source screenshot exists?}
    V -- No --> W[Fail with error]
    V -- Yes --> X[Copy file to docs/images]
    X --> U
    W --> Y[Exit with failure]
    X --> Z[All screenshots updated]
  end

  O --> R
  Z --> AA[Docs images ready for APP_VIEWS_md]
Loading

File-Level Changes

Change Details Files
Make UI screenshot capture output directory configurable and extend capture flow to include the Processed Output panel.
  • Introduce resolveOutputDirectory helper to derive a safe, repo-relative screenshot directory from UI_SCREENSHOT_DIR or a default path.
  • Replace hardcoded SCREENSHOT_DIR with a resolved directory and update resolveOutputPath safety checks accordingly.
  • Extend mocked analyzeRepository and processRepository implementations to return realistic file/token data and generated content for processed state rendering.
  • Add selectors and steps to drive processing, wait for processed UI, and capture a new processed-tab screenshot.
scripts/capture-ui-screenshot.js
Introduce a dedicated docs screenshot generation script and wire it into npm, Make, and CLI workflows.
  • Add scripts/generate-doc-screenshots.js to call the capture script with a docs-specific temp directory/name and copy outputs into docs/images with stable filenames.
  • Expose docs:screenshots npm script (with build prerequisites) and corresponding Make target and command-line entry via scripts/index.js and scripts/lib/utils.js.
  • Document the docs screenshots command in the test catalog and development docs, including a manual test entry.
scripts/generate-doc-screenshots.js
package.json
Makefile
scripts/index.js
scripts/lib/utils.js
tests/catalog.md
docs/DEVELOPMENT.md
tests/manual/docs-ui-screenshots.md
Add and reference tracked documentation for main app panels with updated screenshots.
  • Create docs/APP_VIEWS.md to show Start, Select Files (various states), and Processed Output panels and describe how to refresh screenshots.
  • Reference the new app views docs from the main README and ensure screenshots are stored under docs/images with the expected filenames.
docs/APP_VIEWS.md
README.md
docs/images/app-config-panel.png
docs/images/app-select-panel.png
docs/images/app-select-panel-selected.png
docs/images/app-select-panel-resized.png
docs/images/app-processed-panel.png

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Review Summary by Qodo

Add reproducible UI screenshot capture workflow for documentation
✨ Enhancement 📝 Documentation

Grey Divider

Walkthroughs

Description
• Add reproducible workflow to capture and refresh UI panel screenshots
• Extend screenshot capture to include Processed Output panel state
• Create new docs/APP_VIEWS.md page with tracked UI screenshots
• Add npm run docs:screenshots command for automated screenshot generation
• Enhance mock Electron API to support file analysis and processing workflows
Diagram
flowchart LR
  A["npm run docs:screenshots"] --> B["generate-doc-screenshots.js"]
  B --> C["capture-ui-screenshot.js"]
  C --> D["Playwright Browser"]
  D --> E["Mock Electron API"]
  E --> F["Temp Screenshots"]
  F --> G["docs/images/"]
  G --> H["docs/APP_VIEWS.md"]
Loading

Grey Divider

File Changes

1. scripts/capture-ui-screenshot.js ✨ Enhancement +105/-14

Add configurable output directory and Processed panel capture

scripts/capture-ui-screenshot.js


2. scripts/generate-doc-screenshots.js ✨ Enhancement +62/-0

New script to generate and organize docs screenshots

scripts/generate-doc-screenshots.js


3. scripts/index.js ✨ Enhancement +6/-0

Add docs-screenshots command routing

scripts/index.js


View more (8)
4. scripts/lib/utils.js 📝 Documentation +1/-0

Document docs-screenshots command in help text

scripts/lib/utils.js


5. Makefile ✨ Enhancement +4/-1

Add docs-screenshots phony target

Makefile


6. README.md 📝 Documentation +1/-0

Reference new APP_VIEWS documentation page

README.md


7. docs/APP_VIEWS.md 📝 Documentation +31/-0

New tracked documentation page with UI screenshots

docs/APP_VIEWS.md


8. docs/DEVELOPMENT.md 📝 Documentation +1/-0

Add docs-screenshots command to development guide

docs/DEVELOPMENT.md


9. package.json ✨ Enhancement +2/-0

Add docs:screenshots npm script with build dependencies

package.json


10. tests/catalog.md 📝 Documentation +9/-3

Document docs screenshots testing and visual regression

tests/catalog.md


11. tests/manual/docs-ui-screenshots.md 📝 Documentation +29/-0

New manual test instructions for screenshot generation

tests/manual/docs-ui-screenshots.md


Grey Divider

Qodo Logo

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @Mehdi-Bl, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's documentation by creating a new page dedicated to application UI screenshots. It establishes a robust, automated system for generating and maintaining these screenshots, ensuring they accurately reflect the current state of the user interface. This improvement streamlines the documentation update process and provides clear visual references for users and developers.

Highlights

  • New Documentation Page: Introduced a dedicated documentation page (docs/APP_VIEWS.md) to showcase up-to-date screenshots of the application's main UI panels.
  • Automated Screenshot Generation: Implemented an automated workflow using Playwright to generate and commit current screenshots for the Start, Select Files, and Processed Output panels.
  • Extended Playwright Harness: Extended the Playwright screenshot harness to accurately capture the 'Processed Output' state, including mock data generation for realistic content.
  • New Screenshot Commands: Provided new npm run docs:screenshots and make docs-screenshots commands, establishing a reproducible manual workflow for updating documentation screenshots.
  • Manual Test Instructions: Added detailed manual test instructions (tests/manual/docs-ui-screenshots.md) to guide verification of the generated documentation screenshots.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Makefile
    • Added docs-screenshots to the list of phony targets.
    • Defined the docs-screenshots target to execute node scripts/index.js docs-screenshots.
  • README.md
    • Updated the feature list to include "UI panel screenshots: docs/APP_VIEWS.md".
  • docs/APP_VIEWS.md
    • Added: A new markdown file containing up-to-date screenshots for the Start, Select Files, and Processed Output panels, along with instructions to refresh them.
  • docs/DEVELOPMENT.md
    • Added make docs-screenshots to the list of development commands.
  • package.json
    • Added predocs:screenshots script to build TypeScript and Webpack before generating screenshots.
    • Added docs:screenshots script to run node scripts/generate-doc-screenshots.js.
  • scripts/capture-ui-screenshot.js
    • Modified SCREENSHOT_DIR to be configurable via UI_SCREENSHOT_DIR environment variable, defaulting to dist/qa/screenshots.
    • Introduced resolveOutputDirectory function for safe resolution of screenshot output paths.
    • Extended SCREENSHOTS object to include processedTab output path.
    • Added processedTabActive and processedContent to UI_SELECTORS.
    • Enhanced mock analyzeRepository and processRepository functions to generate more realistic data for the 'Processed Output' panel.
    • Added new steps in captureAppStateScreenshots to simulate processing files and capture a screenshot of the 'Processed Output' panel.
  • scripts/generate-doc-screenshots.js
    • Added: A new script responsible for running the capture-ui-screenshot.js script with specific environment variables to generate temporary screenshots, then copying and renaming them to the docs/images/ directory.
  • scripts/index.js
    • Added a case for docs-screenshots and docs:screenshots to execute the docs:screenshots npm script.
  • scripts/lib/utils.js
    • Added docs-screenshots to the help output description.
  • tests/catalog.md
    • Added Docs screenshots: npm run docs:screenshots to the list of commands.
    • Added a new table row for npm run docs:screenshots under "Visual Regression Signal".
    • Added a new section "Manual UI Doc Test" referencing tests/manual/docs-ui-screenshots.md.
  • tests/manual/docs-ui-screenshots.md
    • Added: A new markdown file detailing manual test steps, expected outputs, and a verification checklist for the documentation UI screenshots.
Activity
  • The project backlog item "Update the doc" has been moved to "In progress".
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai

coderabbitai Bot commented Feb 9, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds automated documentation screenshot generation: new Make and npm targets, scripts to capture UI screenshots (including processed-tab), a generator to copy images into docs, markdown lint tooling, and related docs/tests updates.

Changes

Cohort / File(s) Summary
Build & Scripts
Makefile, package.json
Add lint-md and docs-screenshots Make targets; add lint:md, predocs:screenshots, and docs:screenshots npm scripts; update lint to run markdown lint.
Screenshot Capture & Orchestration
scripts/capture-ui-screenshot.js, scripts/generate-doc-screenshots.js
Introduce UI capture enhancements: configurable output dir, processed-tab capture flow, richer mock Electron API, and generator script that runs capture then copies images into docs/images/.
CLI Dispatch & Help
scripts/index.js, scripts/lib/utils.js
Add aliases/commands for lint:md/lint-md and docs-screenshots/docs:screenshots; add help text entries.
Markdown Linting Tool
scripts/lint-markdown-links.js
Add new markdown link/image linter that validates local targets, reports missing assets, and exits non-zero on errors.
Documentation & Examples
docs/APP_VIEWS.md, docs/DEVELOPMENT.md, README.md, docs/examples/*
Add APP_VIEWS doc with screenshot guidance, update development/readme to list new commands, and include example output files (Markdown/XML).
Tests & Manual Procedures
tests/catalog.md, tests/manual/docs-ui-screenshots.md
Document new manual test and catalog entries for regenerating and verifying UI screenshots.

Sequence Diagram

sequenceDiagram
    participant User
    participant Build as "npm/Make"
    participant Gen as "generate-doc-screenshots.js"
    participant Capture as "capture-ui-screenshot.js"
    participant MockE as "Mock Electron API"
    participant FS as "File System"

    User->>Build: npm run docs:screenshots
    Build->>Gen: spawn with env (UI_SCREENSHOT_DIR, NAME, PORT)
    Gen->>Capture: run capture script
    Capture->>MockE: analyzeRepository(selectedFiles)
    MockE-->>Capture: filesInfo (paths, tokens, isBinary)
    Capture->>MockE: processRepository(filesInfo, exportFormat)
    MockE-->>Capture: processed content + metadata
    Capture->>FS: write screenshots to temp dir
    Capture-->>Gen: exit status
    Gen->>FS: copy temp screenshots -> docs/images/
    Gen-->>User: log completion
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hop, hop, I click and run the lights,

I paint the panels, capture bits and bytes,
From start to processed, images align,
Docs gleam bright — a rabbit's small design. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically summarizes the main change: adding documentation for app view screenshots and establishing a manual workflow to capture them.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/update-ui-screenshots

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
scripts/lib/utils.js (1)

229-229: Nit: dash is misaligned by one space.

The lint:md description dash sits at column 22 while all other entries align at column 23. One extra space before the dash would keep the help output visually consistent.

Proposed fix
-  console.log('  lint:md             - Validate markdown links, image paths, and no decorative icons');
+  console.log('  lint:md              - Validate markdown links, image paths, and no decorative icons');
scripts/lint-markdown-links.js (3)

76-92: extractTargetsFromLine — consider reference-style links.

The current regexes handle inline markdown links ([text](url)) and HTML <img> tags, but reference-style links ([text][ref] / [text]: url) and HTML <a href="..."> tags are not detected. This is fine if your docs only use inline syntax, but worth noting as a known gap.


94-156: Decorative-icon check flags any line with an emoji — may be noisy.

DECORATIVE_ICON_PATTERN uses \p{Extended_Pictographic}, which matches a very broad set of characters (including ✅, ⚠️, etc.). If any markdown file legitimately uses emoji in prose or tables, every such line will be reported as an error, causing the lint to fail. Consider either downgrading this to a warning or providing an inline-disable mechanism (e.g., <!-- lint-disable decorative-icon -->) if this becomes noisy over time.


158-193: Double file read and inconsistent link count.

Each file is read once in lintMarkdownFile (Line 95) and then read again here (Line 167) just to count targets. This second pass also doesn't skip fenced code blocks, so the reported linkCount may include targets inside code fences that weren't actually linted.

You can fix both by having lintMarkdownFile return the link count alongside errors:

♻️ Proposed refactor to eliminate double read and fix count consistency

In lintMarkdownFile, track and return the count:

 function lintMarkdownFile(markdownFilePath) {
   const content = fs.readFileSync(markdownFilePath, 'utf8');
   const lines = content.split(/\r?\n/);
   const errors = [];
+  let linkCount = 0;

   let inFenceBlock = false;
   let fenceMarker = '';
   // ... existing loop ...
+    // after fenceBlock filtering:
     const rawTargets = extractTargetsFromLine(line);
+    linkCount += rawTargets.length;
     for (const rawTarget of rawTargets) {
       // ... existing logic ...
     }
   }

-  return errors;
+  return { errors, linkCount };
 }

Then in run():

   for (const markdownFilePath of markdownFiles) {
-    const fileErrors = lintMarkdownFile(markdownFilePath);
-    allErrors.push(...fileErrors);
-
-    const content = fs.readFileSync(markdownFilePath, 'utf8');
-    const lines = content.split(/\r?\n/);
-    for (const line of lines) {
-      linkCount += extractTargetsFromLine(line).length;
-    }
+    const result = lintMarkdownFile(markdownFilePath);
+    allErrors.push(...result.errors);
+    linkCount += result.linkCount;
   }

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `scripts/capture-ui-screenshot.js:380-387` </location>
<code_context>
-          stats: {
-            totalFiles: 0,
-            totalTokens: 0,
+        analyzeRepository: async (options = {}) => {
+          const selectedFilePaths = Array.isArray(options?.selectedFiles) ? options.selectedFiles : [];
+          const filesInfo = selectedFilePaths.map((filePath, index) => {
+            const normalizedPath = String(filePath);
+            const relativePath = normalizedPath.startsWith(`${mockRootPath}/`)
+              ? normalizedPath.slice(mockRootPath.length + 1)
+              : normalizedPath;
+            return {
+              path: relativePath,
+              tokens: 120 * (index + 1),
</code_context>

<issue_to_address>
**issue (bug_risk):** Path prefix stripping in `analyzeRepository` is not Windows-safe.

Using `normalizedPath.startsWith(`${mockRootPath}/`)` bakes in a forward slash and will fail when `mockRootPath` contains backslashes on Windows. Instead, derive the relative path with `path.relative(mockRootPath, normalizedPath)` and use that (e.g., rejecting results that start with `'..'` or are absolute), so this logic stays path-separator agnostic and works on all platforms, including for QA/docs screenshot generation on Windows.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +380 to +387
analyzeRepository: async (options = {}) => {
const selectedFilePaths = Array.isArray(options?.selectedFiles) ? options.selectedFiles : [];
const filesInfo = selectedFilePaths.map((filePath, index) => {
const normalizedPath = String(filePath);
const relativePath = normalizedPath.startsWith(`${mockRootPath}/`)
? normalizedPath.slice(mockRootPath.length + 1)
: normalizedPath;
return {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Path prefix stripping in analyzeRepository is not Windows-safe.

Using normalizedPath.startsWith(${mockRootPath}/) bakes in a forward slash and will fail when mockRootPath contains backslashes on Windows. Instead, derive the relative path with path.relative(mockRootPath, normalizedPath) and use that (e.g., rejecting results that start with '..' or are absolute), so this logic stays path-separator agnostic and works on all platforms, including for QA/docs screenshot generation on Windows.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request is a great addition, introducing a reproducible workflow for generating and updating documentation screenshots. The new scripts are well-structured, and the extension of the Playwright harness to cover more UI states is a valuable improvement. I have one minor suggestion to improve the formatting of mock data generation.

'# Repository Analysis',
'',
...filesInfo.map(
(file) => `## ${file.path}\n\n\`\`\`ts\n// Preview for ${file.path}\n\`\`\`\nTokens: ${file.tokens}\n`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The mock data generation for the markdown format includes a trailing newline (\n) at the end of each file's section. When these sections are joined by \n, it results in an extra blank line between each file's output in the final mock content. Removing the trailing newline will produce a more cleanly formatted output.

Suggested change
(file) => `## ${file.path}\n\n\`\`\`ts\n// Preview for ${file.path}\n\`\`\`\nTokens: ${file.tokens}\n`
(file) => `## ${file.path}\n\n\`\`\`ts\n// Preview for ${file.path}\n\`\`\`\nTokens: ${file.tokens}`

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (2) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Docs screenshots miss CSS build 🐞 Bug ⛯ Reliability
Description
predocs:screenshots builds TS + webpack, but does not build src/renderer/output.css even
  though the renderer HTML always loads it.
• On a clean checkout or after CSS changes, npm run docs:screenshots can generate
  unstyled/misleading screenshots (or stale styling), undermining the purpose of the docs images.
Code

package.json[R36-37]

+    "predocs:screenshots": "npm run build:ts && npm run build:webpack",
+    "docs:screenshots": "node scripts/generate-doc-screenshots.js",
Evidence
The docs screenshot command runs the Playwright capture against src/renderer/index.html, which
explicitly loads output.css. The PR’s predocs:screenshots hook does not run the Tailwind build
step, even though the repo’s dev workflow treats CSS generation as a separate required step.

src/renderer/index.html[6-8]
package.json[29-37]
scripts/lib/dev.js[31-54]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`npm run docs:screenshots` can run without producing/updating `src/renderer/output.css`, even though the renderer HTML depends on it. This can yield unstyled or stale UI screenshots.

### Issue Context
`src/renderer/index.html` loads `output.css`, and the dev workflow treats CSS generation as a separate step.

### Fix Focus Areas
- package.json[29-37]
- scripts/generate-doc-screenshots.js[26-43]

### Suggested change
Update `predocs:screenshots` to include CSS build, e.g.
- `&quot;predocs:screenshots&quot;: &quot;npm run build:ts &amp;&amp; npm run build:css &amp;&amp; npm run build:webpack&quot;`

(Alternatively/additionally) have `generate-doc-screenshots.js` call `npm run build:css` before spawning the capture script.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Errors expose internal paths 📘 Rule violation ⛨ Security
Description
• The screenshot tooling throws/prints errors that include raw directory/path values (e.g., `Invalid
  screenshot directory: ${rawDir} and missing screenshot ${sourcePath}`).
• When surfaced to users/CI output, these messages can reveal internal filesystem layout and
  environment-specific details.
• This violates the requirement that user-facing errors remain generic, with detailed diagnostics
  kept to internal logs.
Code

scripts/capture-ui-screenshot.js[R62-72]

+function resolveOutputDirectory(dirCandidate) {
+  const rawDir =
+    typeof dirCandidate === 'string' && dirCandidate.trim()
+      ? dirCandidate.trim()
+      : DEFAULT_SCREENSHOT_DIR;
+  const absoluteDir = path.resolve(ROOT_DIR, rawDir);
+  const relativeToRoot = path.relative(ROOT_DIR, absoluteDir);
+
+  if (relativeToRoot.startsWith('..') || path.isAbsolute(relativeToRoot)) {
+    throw new Error(`Invalid screenshot directory: ${rawDir}`);
+  }
Evidence
PR Compliance ID 4 requires generic user-facing errors and prohibits exposing internal
implementation details. The new/updated screenshot scripts include raw path values directly in
thrown errors and stderr output.

Rule 4: Generic: Secure Error Handling
scripts/capture-ui-screenshot.js[62-72]
scripts/generate-doc-screenshots.js[21-24]
scripts/generate-doc-screenshots.js[52-54]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Errors emitted by the screenshot tooling include raw directory/path strings, which can leak internal filesystem details in user-facing output.

## Issue Context
Compliance requires user-facing errors to be generic and to avoid exposing internal implementation details; detailed context should be restricted to secure/internal logs or explicit debug mode.

## Fix Focus Areas
- scripts/capture-ui-screenshot.js[62-72]
- scripts/generate-doc-screenshots.js[21-24]
- scripts/generate-doc-screenshots.js[52-54]

Suggested direction:
- Replace messages like `Invalid screenshot directory: ${rawDir}` with a generic message (e.g., `Invalid screenshot output directory (must be within repo)`), and log the raw value only when a debug flag is enabled.
- For missing screenshots, report only the expected screenshot key/filename (e.g., `${from}`) rather than the absolute `sourcePath`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. spawnSync errors lack context 📘 Rule violation ⛯ Reliability
Description
runCaptureScript() only checks result.status and reports a generic failure message without
  including the underlying spawn error (result.error) or termination signal.
• When the capture script fails to spawn or is terminated, the resulting output is less actionable
  and can obscure the real root cause.
• This falls short of the requirement to provide meaningful error context and handle failure modes
  explicitly.
Code

scripts/generate-doc-screenshots.js[R34-42]

+  const result = spawnSync(process.execPath, [CAPTURE_SCRIPT_PATH], {
+    cwd: ROOT_DIR,
+    env: captureEnv,
+    stdio: 'inherit',
+  });
+
+  if (result.status !== 0) {
+    fail(`capture script exited with code ${result.status}`);
+  }
Evidence
PR Compliance ID 3 requires robust error handling with actionable context. The new docs screenshot
generator does not surface spawn failure details (e.g., result.error), reducing diagnosability for
common edge cases like missing executables or signal termination.

Rule 3: Generic: Robust Error Handling and Edge Case Management
scripts/generate-doc-screenshots.js[34-42]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`spawnSync` failures are reported only via `result.status`, which can be `null` for spawn errors; the underlying error (`result.error`) and termination signal are not reported.

## Issue Context
Robust error handling should surface the actual failure mode (spawn error vs non-zero exit vs signal) so developers can quickly diagnose why docs screenshot generation failed.

## Fix Focus Areas
- scripts/generate-doc-screenshots.js[26-43]

Suggested direction:
- If `result.error` is set, call `fail` with a message that includes `result.error.message` (optionally gated by debug for sensitive details).
- If `result.signal` is set, call `fail` noting termination by signal.
- Otherwise, keep the non-zero exit code message, but consider adding a hint to check the capture script output.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Analyze mock contract drift 🐞 Bug ⛯ Reliability
Description
• The Playwright mock for window.electronAPI.analyzeRepository returns `{ totalFiles, totalTokens,
  filesInfo } and omits skippedBinaryFiles`, which the real IPC contract defines and the main
  process returns.
• This contract drift can cause screenshot generation to break when renderer logic starts relying on
  skippedBinaryFiles (or other exact-shape assumptions), and reduces confidence that docs/QA
  screenshots reflect real app behavior.
Code

scripts/capture-ui-screenshot.js[R394-398]

+          return {
+            totalFiles: filesInfo.length,
+            totalTokens: filesInfo.reduce((sum, file) => sum + file.tokens, 0),
+            filesInfo,
+          };
Evidence
The repo’s IPC type and main-process handler define AnalyzeRepositoryResult with
skippedBinaryFiles. The screenshot capture mock returns a different shape, so the renderer under
Playwright is not exercising the real contract.

scripts/capture-ui-screenshot.js[380-399]
src/types/ipc.ts[42-46]
src/main/index.ts[385-389]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Playwright screenshot harness mocks `window.electronAPI.analyzeRepository`, but the returned object does not match the app’s IPC type/real implementation: it omits `skippedBinaryFiles` and adds `totalFiles`.

### Issue Context
Keeping the mock aligned with the real IPC contract avoids flaky screenshot runs and ensures the screenshot flow exercises realistic renderer logic.

### Fix Focus Areas
- scripts/capture-ui-screenshot.js[380-399]

### Suggested change
Adjust the mock return object to match `AnalyzeRepositoryResult`, e.g.:
- return `{ filesInfo, totalTokens: ..., skippedBinaryFiles: 0 }`
- remove `totalFiles` (or only keep it if the renderer uses it).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread package.json
Comment on lines +36 to +37
"predocs:screenshots": "npm run build:ts && npm run build:webpack",
"docs:screenshots": "node scripts/generate-doc-screenshots.js",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Docs screenshots miss css build 🐞 Bug ⛯ Reliability

predocs:screenshots builds TS + webpack, but does not build src/renderer/output.css even
  though the renderer HTML always loads it.
• On a clean checkout or after CSS changes, npm run docs:screenshots can generate
  unstyled/misleading screenshots (or stale styling), undermining the purpose of the docs images.
Agent Prompt
### Issue description
`npm run docs:screenshots` can run without producing/updating `src/renderer/output.css`, even though the renderer HTML depends on it. This can yield unstyled or stale UI screenshots.

### Issue Context
`src/renderer/index.html` loads `output.css`, and the dev workflow treats CSS generation as a separate step.

### Fix Focus Areas
- package.json[29-37]
- scripts/generate-doc-screenshots.js[26-43]

### Suggested change
Update `predocs:screenshots` to include CSS build, e.g.
- `"predocs:screenshots": "npm run build:ts && npm run build:css && npm run build:webpack"`

(Alternatively/additionally) have `generate-doc-screenshots.js` call `npm run build:css` before spawning the capture script.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@github-actions

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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