Skip to content

refactor(renderer): isolate generated outputs from src tree#128

Merged
Mehdi-Bl merged 3 commits into
mainfrom
feat/renderer-build-output-isolation
Feb 14, 2026
Merged

refactor(renderer): isolate generated outputs from src tree#128
Mehdi-Bl merged 3 commits into
mainfrom
feat/renderer-build-output-isolation

Conversation

@Mehdi-Bl

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

Copy link
Copy Markdown
Contributor

Summary

  • move renderer generated assets (bundle.js, sourcemap, license output, output.css) from src/renderer to dist/renderer
  • update webpack/tailwind/dev/QA/release pipelines to build and consume assets from dist/renderer
  • remove tracked generated artifact src/renderer/index.js.LICENSE.txt
  • keep packaging functional by including dist/renderer/**/* in electron-builder files
  • clean stale generated-file exclusions in Sonar/CodeQL configs

Backlog

  • Item: P0 Renderer cleanup 1/4: isolate build artifacts from src tree
  • Project item id: PVTI_lADODAMERs4A0Spmzgld4wk

Validation

  • npm run lint
  • npm test -- --runInBand
  • npm run qa:screenshot
  • make sonar

All passed locally.

Summary by Sourcery

Isolate renderer build artifacts under dist/renderer and update tooling, packaging, and analysis configs to consume assets from the new location.

Enhancements:

  • Serve renderer assets from dist/renderer instead of src/renderer across dev scripts, webpack config, and HTML entrypoint.
  • Ensure renderer output directories exist prior to CSS/webpack builds and adjust clean-up scripts to target dist-based assets.
  • Include dist/renderer assets in the packaged application so Electron builds remain functional.
  • Simplify static analysis configuration by relying on broad dist/** exclusions instead of per-file renderer bundle ignores.
  • Improve QA screenshot reliability by routing requests for built renderer assets correctly and adding a resilient checkbox state helper in Playwright scripts.

Summary by CodeRabbit

  • Chores
    • Reorganized build output structure to separate compiled artifacts from source files.
    • Enhanced code quality analysis coverage to include additional asset files.
    • Added CSS compilation step to the release build process for all platforms.
    • Updated build automation to ensure proper directory structure and asset cleanup.
    • Improved test screenshot capture robustness with enhanced UI state verification.

@sourcery-ai

sourcery-ai Bot commented Feb 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

Refactors the renderer build pipeline so that all generated JS/CSS assets live in dist/renderer instead of src/renderer, updates dev/QA/release tooling to build and serve from the new location, keeps packaging working, and simplifies static-analysis exclusions; also hardens a QA screenshot flow by making checkbox toggling more robust.

Sequence diagram for robust checkbox toggling in QA screenshot flow

sequenceDiagram
  actor QA_Job
  participant Script as capture_ui_screenshot_js
  participant Page
  participant Checkbox as Secret_and_Suspicious_Toggles

  QA_Job->>Script: npm run qa:screenshot
  Script->>Page: open renderer UI

  Script->>Page: click config tab
  Script->>Page: waitForSelector(secretScanningToggle)

  loop for each toggle
    Script->>Page: setCheckboxState(selector, false)
    activate Page
      Page->>Checkbox: locator(selector).first()
      Page-->>Script: waitFor visible
      loop up to 3 attempts
        Script->>Page: isChecked()
        Page-->>Script: currentState
        alt currentState != false
          Script->>Page: uncheck()
          Script->>Page: waitForTimeout(75ms)
        else currentState == false
          Script-->>Page: return
          Script-->>Page: break
        end
      end
      alt still not false after attempts
        Page-->>Script: throw Error("Unable to set checkbox")
      end
    deactivate Page
  end

  Script->>Page: waitForFunction(both toggles unchecked in DOM)
  Script->>Page: click Save config button
  Page-->>Script: config persisted (localStorage)
  Script-->>QA_Job: screenshots captured successfully
Loading

File-Level Changes

Change Details Files
Renderer build outputs are relocated from src/renderer to dist/renderer and all paths are updated accordingly.
  • Webpack now writes bundle.js and related assets to dist/renderer instead of src/renderer.
  • Renderer index.html now references CSS/JS from ../../dist/renderer rather than local files.
  • Dev helper scripts (dev startup, clean-dev-assets, ensure-build-dirs, generic build cleanup) now read/write/remove assets under dist/renderer.
  • The npm clear-assets script and Tailwind build/watch scripts target dist/renderer/output.css and bundle outputs.
webpack.config.js
src/renderer/index.html
scripts/lib/dev.js
scripts/clean-dev-assets.js
scripts/ensure-build-dirs.js
scripts/lib/utils.js
package.json
CI/CD and packaging flows are updated to build and ship renderer assets from dist/renderer while keeping Electron packaging functional.
  • Release GitHub Actions jobs explicitly build CSS before webpack so dist/renderer assets exist in release builds.
  • Electron builder configuration includes dist/renderer/**/* in packaged files.
  • QA screenshot pre-step now builds TypeScript, CSS, and webpack so dist/renderer is populated before Playwright runs.
.github/workflows/release.yml
package.json
SonarCloud and CodeQL configurations are simplified now that dist/** is globally excluded and per-file renderer bundle exclusions are no longer necessary.
  • Removed explicit exclusions of individual generated renderer files from CodeQL config.
  • Simplified SonarCloud sonar.exclusions to drop per-file renderer bundle paths while still excluding dist/** and renderer styles source.
.github/codeql/codeql-config.yml
.github/workflows/sonarcloud.yml
sonar-project.properties
QA screenshot script is updated to serve assets correctly from the new build location and to make checkbox state setting more robust.
  • Local HTTP file resolver now distinguishes between src/renderer and dist/renderer paths, routing /dist/renderer/* to the build output while keeping / and /index.html served from source.
  • Introduced a setCheckboxState helper with retries and explicit verification to reliably check/uncheck Playwright locators.
  • Capture-app-state flow now uses setCheckboxState and an additional waitForFunction to assert config toggles are truly off before saving.
scripts/capture-ui-screenshot.js
Tracked generated artifact src/renderer/index.js.LICENSE.txt is removed from the repository and ignored going forward.
  • Deleted the committed LICENSE bundle artifact from src/renderer.
  • Adjusted ignore/cleanup behavior so future generated bundles and license files live only under dist/renderer.
src/renderer/index.js.LICENSE.txt
.gitignore

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

Isolate renderer build artifacts from source tree

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Move renderer build outputs from src/renderer to dist/renderer
• Update webpack, tailwind, and build pipelines to consume assets from new location
• Remove tracked generated artifact src/renderer/index.js.LICENSE.txt
• Clean stale generated-file exclusions from Sonar and CodeQL configs
• Improve screenshot capture script with robust checkbox state handling
Diagram
flowchart LR
  A["Renderer Source<br/>src/renderer"] -->|"Webpack builds"| B["Renderer Build Output<br/>dist/renderer"]
  C["Build Scripts<br/>webpack, tailwind, dev"] -->|"Updated paths"| B
  D["Config Files<br/>Sonar, CodeQL"] -->|"Cleaned exclusions"| E["Simplified Config"]
  F["HTML Entry Point<br/>index.html"] -->|"Updated links"| B
Loading

Grey Divider

File Changes

1. scripts/capture-ui-screenshot.js ✨ Enhancement +57/-6

Update screenshot script for new build output paths

scripts/capture-ui-screenshot.js


2. scripts/clean-dev-assets.js ⚙️ Configuration changes +4/-4

Update asset cleanup paths to dist directory

scripts/clean-dev-assets.js


3. scripts/ensure-build-dirs.js ⚙️ Configuration changes +5/-3

Create dist/renderer directory for build outputs

scripts/ensure-build-dirs.js


View more (10)
4. scripts/lib/dev.js ⚙️ Configuration changes +9/-6

Update dev environment to use dist/renderer paths

scripts/lib/dev.js


5. scripts/lib/utils.js ⚙️ Configuration changes +3/-3

Update build artifact cleanup paths

scripts/lib/utils.js


6. webpack.config.js ⚙️ Configuration changes +5/-5

Configure webpack output to dist/renderer

webpack.config.js


7. src/renderer/index.html ⚙️ Configuration changes +2/-2

Update asset references to dist/renderer location

src/renderer/index.html


8. .github/codeql/codeql-config.yml ⚙️ Configuration changes +0/-4

Remove stale generated artifact exclusions

.github/codeql/codeql-config.yml


9. .github/workflows/release.yml ⚙️ Configuration changes +9/-0

Add CSS build step to release workflows

.github/workflows/release.yml


10. .github/workflows/sonarcloud.yml ⚙️ Configuration changes +1/-1

Clean generated artifact exclusions from Sonar config

.github/workflows/sonarcloud.yml


11. package.json ⚙️ Configuration changes +7/-4

Update build scripts and asset paths

package.json


12. sonar-project.properties ⚙️ Configuration changes +1/-1

Remove generated artifact exclusions from Sonar

sonar-project.properties


13. src/renderer/index.js.LICENSE.txt 🐞 Bug fix +0/-41

Remove tracked generated license file

src/renderer/index.js.LICENSE.txt


Grey Divider

Qodo Logo

@coderabbitai

coderabbitai Bot commented Feb 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Mehdi-Bl has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

This PR reorganizes the build output structure by migrating compiled renderer assets from src/renderer/ to dist/renderer/, updating webpack, CSS build targets, and all related scripts accordingly. Additionally, it adds CSS building to the release workflow, narrows quality analysis exclusions, and enhances screenshot capture robustness with checkbox state management.

Changes

Cohort / File(s) Summary
Build Configuration
webpack.config.js, package.json
Updated webpack output and CSS build targets to write to dist/renderer/ instead of src/renderer/. Updated build scripts (build:css, watch:css, clear-assets) and added prewatch:css and prebuild:css lifecycle scripts. Added dist/renderer/\\ to package files manifest.
Build Scripts and Utilities
scripts/ensure-build-dirs.js, scripts/lib/dev.js, scripts/lib/utils.js, scripts/clean-dev-assets.js
Updated directory paths and cleanup targets from src/renderer/ to dist/renderer/ for CSS output, webpack bundle, and asset cleanup operations.
CI/CD Workflows
.github/workflows/release.yml, .github/workflows/sonarcloud.yml
Added Build CSS step to release workflow for Windows, Linux, and macOS. Narrowed SonarQube exclusions by removing previously excluded renderer bundles and CSS files to expand analysis coverage.
Quality and Analysis Tools
.github/codeql/codeql-config.yml, sonar-project.properties
Removed renderer bundle and CSS files from CodeQL paths-ignore list. Updated sonar.exclusions and added sonar.test.inclusions and sonar.cpd.exclusions with test patterns and node core import style ignore rules.
Repository Configuration
.gitignore
Removed ignore patterns for build artifacts under src/renderer (index.js, output.css, bundle files and maps) to allow git tracking of build outputs.
Screenshot Capture and Asset References
scripts/capture-ui-screenshot.js, src/renderer/index.html, src/renderer/index.js.LICENSE.txt
Enhanced capture-ui-screenshot.js with dual renderer directory support (RENDERER_SOURCE_DIR and RENDERER_BUILD_DIR), added setCheckboxState helper for robust checkbox state management with retry logic. Updated index.html to reference dist paths for CSS and JS bundles. Removed license file content from index.js.LICENSE.txt.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Bundles hop from src to dist with care,
Screenshots check their boxes without despair,
Quality scanners now see the light,
Build workflows dance through day and night,
Assets organized, configs aligned right!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective: moving generated renderer outputs from src tree to dist directory to isolate build artifacts.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/renderer-build-output-isolation

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.

@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 refactors the project's build output strategy by isolating all generated renderer assets into a dedicated dist/renderer directory. This change enhances project cleanliness by separating source code from build artifacts, streamlines development workflows by updating various scripts and configurations to reflect the new paths, and improves maintainability by centralizing build outputs.

Highlights

  • Renderer Artifact Relocation: Renderer build artifacts, including bundle.js, sourcemaps, license output, and output.css, have been moved from src/renderer to a new dist/renderer directory.
  • Build Pipeline Updates: Webpack, Tailwind CSS, development, QA, and release pipelines have been updated to build and consume assets exclusively from the dist/renderer directory.
  • Configuration Streamlining: Configuration files such as .gitignore, CodeQL, and SonarQube have been cleaned up by removing stale exclusions for src/renderer artifacts, now covered by broader dist/** exclusions.
  • Packaging and QA Enhancements: Electron-builder configuration was updated to include dist/renderer/**/* for proper packaging, and a new setCheckboxState helper function was added to Playwright QA scripts for more reliable checkbox interactions.

🧠 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
  • .github/codeql/codeql-config.yml
    • Removed specific exclusions for src/renderer build artifacts, relying on the broader dist/** exclusion.
  • .gitignore
    • Removed entries for src/renderer build artifacts.
  • package.json
    • Modified clear-assets script to target dist/renderer.
    • Added prewatch:css and prebuild:css scripts to ensure build directories exist.
    • Updated watch:css and build:css commands to output to dist/renderer.
    • Updated preqa:screenshot to include CSS and Webpack builds.
    • Added dist/renderer/**/* to files for electron-builder.
  • scripts/capture-ui-screenshot.js
    • Updated path constants to distinguish between renderer source and build directories.
    • Revised resolveFilePath to correctly serve assets from dist/renderer or src/renderer based on the request.
    • Introduced a setCheckboxState helper for reliable Playwright checkbox interactions.
  • scripts/clean-dev-assets.js
    • Updated the list of asset paths to be cleaned to point to the dist/renderer directory.
  • scripts/ensure-build-dirs.js
    • Modified to create dist and dist/renderer directories, aligning with the new output structure.
  • scripts/lib/dev.js
    • Updated the paths for checking and building CSS and Webpack output to dist/renderer.
  • scripts/lib/utils.js
    • Adjusted cleanBuildArtifacts to remove generated files from the dist/renderer directory.
  • sonar-project.properties
    • Removed explicit exclusions for src/renderer build artifacts, now covered by the dist/** exclusion.
  • src/renderer/index.html
    • Updated the link tag for output.css and the script tag for bundle.js to reference their new locations within ../../dist/renderer/.
  • src/renderer/index.js.LICENSE.txt
    • Removed the generated license file.
  • webpack.config.js
    • Configured Webpack to output bundle.js to the dist/renderer directory.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/release.yml
    • .github/workflows/sonarcloud.yml
Activity
  • No specific activity (comments, reviews, progress) was provided in the context for this pull request.
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.

@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 left some high level feedback:

  • The renderer asset path dist/renderer is now hard-coded in multiple places (scripts, package.json, webpack config); consider centralizing this in a single config/constant to avoid future drift if the path changes again.
  • In src/renderer/index.html, the ../../dist/renderer/... URLs are somewhat brittle; switching to root-relative paths like /dist/renderer/output.css and /dist/renderer/bundle.js would be easier to reason about and less sensitive to where the HTML is served from.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The renderer asset path `dist/renderer` is now hard-coded in multiple places (scripts, package.json, webpack config); consider centralizing this in a single config/constant to avoid future drift if the path changes again.
- In `src/renderer/index.html`, the `../../dist/renderer/...` URLs are somewhat brittle; switching to root-relative paths like `/dist/renderer/output.css` and `/dist/renderer/bundle.js` would be easier to reason about and less sensitive to where the HTML is served from.

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.

@github-actions

github-actions Bot commented Feb 14, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@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 effectively refactors the project to isolate generated renderer assets into the dist/renderer directory, which is a good step for improving the project structure and maintainability. All related build and development scripts have been updated accordingly. Additionally, the QA scripts have been improved for better reliability. My review includes one suggestion to simplify a cleanup script by removing redundant path definitions.

Comment thread scripts/lib/utils.js Outdated
Comment on lines +108 to +111
path.join(ROOT_DIR, 'dist', 'renderer', 'bundle.js'),
path.join(ROOT_DIR, 'dist', 'renderer', 'bundle.js.map'),
path.join(ROOT_DIR, 'build', 'ts'),
path.join(ROOT_DIR, 'src', 'renderer', 'output.css'),
path.join(ROOT_DIR, 'dist', 'renderer', 'output.css'),

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 pathsToRemove array contains redundant paths. Since path.join(ROOT_DIR, 'dist') is already being removed recursively on line 107, explicitly listing files within the dist/renderer directory is not necessary. You can simplify this array to make the code cleaner and easier to maintain.

Suggested change
path.join(ROOT_DIR, 'dist', 'renderer', 'bundle.js'),
path.join(ROOT_DIR, 'dist', 'renderer', 'bundle.js.map'),
path.join(ROOT_DIR, 'build', 'ts'),
path.join(ROOT_DIR, 'src', 'renderer', 'output.css'),
path.join(ROOT_DIR, 'dist', 'renderer', 'output.css'),
path.join(ROOT_DIR, 'build', 'ts'),

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

50-50: ⚠️ Potential issue | 🟠 Major

predocs:screenshots is missing build:css, unlike preqa:screenshot and pree2e:playwright.

CSS output is built to dist/renderer/output.css, and without explicitly building it, doc screenshots will render without styles. Both preqa:screenshot (line 44) and pree2e:playwright (line 46) include build:css in their pre-scripts, but predocs:screenshots (line 50) does not.

🐛 Proposed fix
-    "predocs:screenshots": "npm run build:ts && npm run build:webpack",
+    "predocs:screenshots": "npm run build:ts && npm run build:css && npm run build:webpack",
🤖 Fix all issues with AI agents
In `@scripts/lib/dev.js`:
- Around line 32-45: The tailwind execSync call can fail if the dist/renderer
directory is missing; before running execSync (the code that references execSync
and cssFile), ensure the output directory exists by calling
utils.ensureDir(path.join(utils.ROOT_DIR, 'dist', 'renderer')) or, preferably,
replace the direct execSync invocation with utils.runNpmScript('build:css') so
the prebuild hook that creates build dirs runs; update the branch that logs
"Running tailwindcss directly..." and use the chosen approach (ensureDir or
runNpmScript) to guarantee the directory exists before invoking tailwind.
🧹 Nitpick comments (1)
scripts/lib/utils.js (1)

106-112: Redundant entries: individual files under dist/ are already removed by the dist directory deletion.

Line 107 removes the entire dist directory recursively. Lines 108–109 and 111 then attempt to delete individual files within dist/renderer/, but they will never exist at that point. Consider removing the redundant entries for clarity.

♻️ Suggested cleanup
   const pathsToRemove = [
     path.join(ROOT_DIR, 'dist'),
-    path.join(ROOT_DIR, 'dist', 'renderer', 'bundle.js'),
-    path.join(ROOT_DIR, 'dist', 'renderer', 'bundle.js.map'),
     path.join(ROOT_DIR, 'build', 'ts'),
-    path.join(ROOT_DIR, 'dist', 'renderer', 'output.css'),
   ];

Comment thread scripts/lib/dev.js Outdated
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Feb 14, 2026

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. dev.js missing dist directory 📘 Rule violation ⛯ Reliability
Description
scripts/lib/dev.js now writes Tailwind output to dist/renderer/output.css but does not ensure
dist/renderer exists first, which can cause dev startup to fail on a clean checkout. This is an
unhandled dependency/edge case for a key dev workflow.
Code

scripts/lib/dev.js[R32-45]

+    const cssFile = path.join(utils.ROOT_DIR, 'dist', 'renderer', 'output.css');
  if (!fs.existsSync(cssFile)) {
    log('CSS not found, building...', colors.yellow);
    try {
      // Try direct command execution first
      const { execSync } = require('child_process');
      log('Running tailwindcss directly...', colors.blue);
-        execSync('npx tailwindcss -i ./src/renderer/styles.css -o ./src/renderer/output.css', {
-          stdio: 'inherit',
-          cwd: utils.ROOT_DIR,
-        });
+        execSync(
+          'npx @tailwindcss/cli -i ./src/renderer/styles.css -o ./dist/renderer/output.css',
+          {
+            stdio: 'inherit',
+            cwd: utils.ROOT_DIR,
+          }
+        );
Evidence
The robustness checklist requires handling failure points and edge cases; the updated dev flow
writes build output under dist/renderer but dist is ignored (not guaranteed to exist) and this
code path does not create the directory or invoke the existing directory-creation pre-script, making
failures likely when the folder is absent.

Rule 3: Generic: Robust Error Handling and Edge Case Management
scripts/lib/dev.js[32-45]
.gitignore[11-15]
package.json[37-40]

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

## Issue description
`scripts/lib/dev.js` builds Tailwind output into `dist/renderer/output.css` via a direct CLI call, but it does not ensure `dist/renderer` exists first. Since `dist` is gitignored and may not exist on clean checkouts, the Tailwind write can fail and prevent `npm run dev` from starting.
## Issue Context
The repo already has `scripts/ensure-build-dirs.js` and wiring via `prebuild:css`/`prewatch:css`, but `dev.js` bypasses that by calling Tailwind directly.
## Fix Focus Areas
- scripts/lib/dev.js[32-45]
- package.json[37-40]

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



Remediation recommended

2. Docs screenshots miss CSS build 🐞 Bug ⛯ Reliability
Description
docs:screenshots runs capture-ui-screenshot, which serves src/renderer/index.html; that HTML now
links to dist/renderer/output.css. But predocs:screenshots doesn’t run build:css, so docs
screenshots can be captured without CSS (404), producing incorrect/un-styled images.
Code

src/renderer/index.html[7]

+    <link rel="stylesheet" href="../../dist/renderer/output.css" />
Evidence
index.html now depends on dist/renderer/output.css. The docs screenshots pre-hook does not build CSS
(only TS + webpack), and the capture server returns 404 when a file is missing—so output.css can be
absent while screenshot capture still proceeds, yielding wrong screenshots.

src/renderer/index.html[6-8]
package.json[50-51]
scripts/generate-doc-screenshots.js[26-38]
scripts/capture-ui-screenshot.js[141-145]

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

## Issue description
`docs:screenshots` ultimately loads `src/renderer/index.html`, which now references `dist/renderer/output.css`. However, `predocs:screenshots` doesn’t build CSS, so screenshots may be taken without styling.
### Issue Context
`capture-ui-screenshot.js` serves missing assets as 404, which may not fail the run but will change rendered output.
### Fix Focus Areas
- package.json[50-51]
- src/renderer/index.html[6-8]
- scripts/generate-doc-screenshots.js[26-43]
### Suggested approach
- Update `predocs:screenshots` to: `npm run build:ts &amp;amp;amp;&amp;amp;amp; npm run build:css &amp;amp;amp;&amp;amp;amp; npm run build:webpack`.
- (Optional hardening) In `generate-doc-screenshots.js`, verify `dist/renderer/output.css` exists and run `npm run build:css` if it doesn’t.

ⓘ 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 scripts/lib/dev.js Outdated
Comment on lines +32 to +45
const cssFile = path.join(utils.ROOT_DIR, 'dist', 'renderer', 'output.css');
if (!fs.existsSync(cssFile)) {
log('CSS not found, building...', colors.yellow);
try {
// Try direct command execution first
const { execSync } = require('child_process');
log('Running tailwindcss directly...', colors.blue);
execSync('npx tailwindcss -i ./src/renderer/styles.css -o ./src/renderer/output.css', {
stdio: 'inherit',
cwd: utils.ROOT_DIR,
});
execSync(
'npx @tailwindcss/cli -i ./src/renderer/styles.css -o ./dist/renderer/output.css',
{
stdio: 'inherit',
cwd: utils.ROOT_DIR,
}
);

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. dev.js missing dist directory 📘 Rule violation ⛯ Reliability

scripts/lib/dev.js now writes Tailwind output to dist/renderer/output.css but does not ensure
dist/renderer exists first, which can cause dev startup to fail on a clean checkout. This is an
unhandled dependency/edge case for a key dev workflow.
Agent Prompt
## Issue description
`scripts/lib/dev.js` builds Tailwind output into `dist/renderer/output.css` via a direct CLI call, but it does not ensure `dist/renderer` exists first. Since `dist` is gitignored and may not exist on clean checkouts, the Tailwind write can fail and prevent `npm run dev` from starting.

## Issue Context
The repo already has `scripts/ensure-build-dirs.js` and wiring via `prebuild:css`/`prewatch:css`, but `dev.js` bypasses that by calling Tailwind directly.

## Fix Focus Areas
- scripts/lib/dev.js[32-45]
- package.json[37-40]

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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d4b28ce46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lib/dev.js Outdated
Comment on lines +39 to +40
execSync(
'npx @tailwindcss/cli -i ./src/renderer/styles.css -o ./dist/renderer/output.css',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Run CSS build through prebuild hook in dev startup

The dev bootstrap now executes Tailwind directly to ./dist/renderer/output.css, but this bypasses the new prebuild:css setup that creates dist/renderer first. In a clean workspace (or after removing dist), npm run dev can fail before watchers start because this write target may not exist yet; using npm run build:css here (or explicitly ensuring the directory) would keep startup consistent with the rest of the build pipeline.

Useful? React with 👍 / 👎.

@sonarqubecloud

Copy link
Copy Markdown

@Mehdi-Bl Mehdi-Bl enabled auto-merge (squash) February 14, 2026 21:08
@Mehdi-Bl Mehdi-Bl merged commit 28d87d6 into main Feb 14, 2026
25 checks passed
@Mehdi-Bl Mehdi-Bl deleted the feat/renderer-build-output-isolation branch February 14, 2026 21:09
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