Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ npm run build:linux
npm run build:mac
```

## Renderer Structure

- `src/renderer/public/`: static HTML shell (`index.html`)
- `src/renderer/styles/`: renderer stylesheet sources
- `src/renderer/components/`, `context/`, `i18n/`: runtime renderer code
- `src/assets/`: canonical app icons and static media assets

## Dev Container

This repo includes `.devcontainer/` for a reproducible local environment.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"test:patterns": "jest --config jest.config.js --testMatch=\"**/tests/**/*pattern*.test.{js,ts}\" --verbose",
"test:lint": "npm run test && npm run lint:tests",
"prewatch:css": "node scripts/ensure-build-dirs.js",
"watch:css": "npx @tailwindcss/cli -i ./src/renderer/styles.css -o ./dist/renderer/output.css --watch",
"watch:css": "npx @tailwindcss/cli -i ./src/renderer/styles/styles.css -o ./dist/renderer/output.css --watch",
"prebuild:css": "node scripts/ensure-build-dirs.js",
"build:css": "npx @tailwindcss/cli -i ./src/renderer/styles.css -o ./dist/renderer/output.css",
"build:css": "npx @tailwindcss/cli -i ./src/renderer/styles/styles.css -o ./dist/renderer/output.css",
"prepare": "husky install",
"sonar": "node scripts/sonar-scan.js",
"qa": "node scripts/index.js qa",
Expand Down
5 changes: 3 additions & 2 deletions scripts/capture-ui-screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const { chromium } = require('playwright');
const ROOT_DIR = path.join(__dirname, '..');
const ASSETS_DIR = path.join(ROOT_DIR, 'src', 'assets');
const RENDERER_SOURCE_DIR = path.join(ROOT_DIR, 'src', 'renderer');
const RENDERER_PUBLIC_DIR = path.join(RENDERER_SOURCE_DIR, 'public');
const RENDERER_BUILD_DIR = path.join(ROOT_DIR, 'dist', 'renderer');
const DEFAULT_SCREENSHOT_DIR = path.join('dist', 'qa', 'screenshots');
const SCREENSHOT_DIR = resolveOutputDirectory(process.env.UI_SCREENSHOT_DIR);
Expand Down Expand Up @@ -47,8 +48,8 @@ const MIME_TYPES = {
};

const STATIC_FILE_ROUTES = new Map([
['/', path.join(RENDERER_SOURCE_DIR, 'index.html')],
['/index.html', path.join(RENDERER_SOURCE_DIR, 'index.html')],
['/', path.join(RENDERER_PUBLIC_DIR, 'index.html')],
['/index.html', path.join(RENDERER_PUBLIC_DIR, 'index.html')],
['/assets/icon.png', path.join(ASSETS_DIR, 'icon.png')],
['/dist/renderer/output.css', path.join(RENDERER_BUILD_DIR, 'output.css')],
['/dist/renderer/bundle.js', path.join(RENDERER_BUILD_DIR, 'bundle.js')],
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sonar.sources=src
sonar.sourceEncoding=UTF-8

# Excluded directories and files (avoid noise from tests, fixtures, generated assets)
sonar.exclusions=node_modules/**,dist/**,coverage/**,tests/**,scripts/**,**/__tests__/**,**/*.test.js,**/*.test.jsx,**/*.test.ts,**/*.test.tsx,**/*.spec.js,**/*.spec.jsx,**/*.spec.ts,**/*.spec.tsx,src/renderer/styles.css
sonar.exclusions=node_modules/**,dist/**,coverage/**,tests/**,scripts/**,**/__tests__/**,**/*.test.js,**/*.test.jsx,**/*.test.ts,**/*.test.tsx,**/*.spec.js,**/*.spec.jsx,**/*.spec.ts,**/*.spec.tsx,src/renderer/styles/styles.css

# Test directories (kept for coverage mapping, excluded from issue noise)
sonar.tests=tests,src/__tests__
Expand Down
2 changes: 1 addition & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let updaterService = createUpdaterService(
);

const APP_ROOT = path.resolve(__dirname, '../../..');
const RENDERER_INDEX_PATH = path.join(APP_ROOT, 'src', 'renderer', 'index.html');
const RENDERER_INDEX_PATH = path.join(APP_ROOT, 'src', 'renderer', 'public', 'index.html');
const ASSETS_DIR = path.join(APP_ROOT, 'src', 'assets');
const createForbiddenAssetResponse = (): Response => new Response('Forbidden', { status: 403 });

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/index.html → src/renderer/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AI Code Fusion</title>
<link rel="stylesheet" href="../../dist/renderer/output.css" />
<link rel="stylesheet" href="../../../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.

high

Moving index.html to src/renderer/public/ changes the base path for relative URLs resolved by the browser. This breaks the application icon link in src/renderer/components/App.tsx (line 83), which currently uses src='../assets/icon.png'.

Since the HTML shell is now one level deeper, that path should be updated to ../../assets/icon.png in App.tsx to correctly point to src/assets/icon.png when running in Electron. Please verify if other components use similar relative paths to assets.

<script>
// Apply dark mode immediately to prevent flash of light theme
const appWindow = globalThis;
Expand All @@ -25,6 +25,6 @@
class="h-screen overflow-hidden bg-gray-100 dark:bg-gray-900 transition-colors duration-200"
>
<div id="app" class="h-full"></div>
<script src="../../dist/renderer/bundle.js"></script>
<script src="../../../dist/renderer/bundle.js"></script>
</body>
</html>
3 changes: 0 additions & 3 deletions src/renderer/styles.css → src/renderer/styles/styles.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@config '../../tailwind.config.js';
@import 'tailwindcss';
@source './**/*.{js,jsx,ts,tsx}';
@source './index.html';

.file-tree {
font-family:
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
content: ['./src/renderer/**/*.{js,jsx,ts,tsx}', './src/renderer/index.html'],
content: ['./src/renderer/**/*.{js,jsx,ts,tsx}', './src/renderer/public/index.html'],
darkMode: 'class',
theme: {
extend: {},
Expand Down
Loading