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
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:

- name: Enable automerge
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: gh pr merge "$PR_URL" --auto --squash
6 changes: 6 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
"quoteStyle": "single"
}
},
"css": {
"parser": {
"cssModules": false,
"tailwindDirectives": true
}
},
"json": {
"formatter": {
"enabled": true,
Expand Down
10 changes: 7 additions & 3 deletions global.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

/* Load existing theme config (colors, fonts, shadows, border-radius) */
@config "./tailwind.config.ts";

/* ============================================
ThumbCode Global Styles — Native Mobile Feel
Capacitor app targeting iOS & Android stores
============================================ */

/* Dark mode via class strategy (Tailwind v4) */
@custom-variant dark (&:where(.dark *));

@layer base {
/* Font smoothing — antialiased rendering */
html {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@
"@commitlint/cli": "^20.0.0",
"@commitlint/config-conventional": "^20.0.0",
"@playwright/test": "^1.57.0",
"@tailwindcss/vite": "^4.2.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/diff": "^8.0.0",
"@types/lodash-es": "^4.17.0",
"@types/react": "~19.2.14",
"@types/react-dom": "~18.3.0",
"@types/react-dom": "~19.2.3",
"@vitejs/plugin-react": "^5.1.4",
"@vitest/coverage-v8": "^4.0.18",
"autoprefixer": "^10.4.24",
"jscpd": "^4.0.8",
"jsdom": "^28.0.0",
"msw": "^2.12.10",
Expand Down
368 changes: 261 additions & 107 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions postcss.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/core/git/GitHttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const gitHttpClient = {
const res = await secureFetch(url, {
method,
headers,
body: body ? new Blob(body) : undefined,
body: body ? new Blob(body as BlobPart[]) : undefined,
});

const responseHeaders: Record<string, string> = {};
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-camera-capture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface UseCameraCaptureResult {
stopCapture: () => void;
takePhoto: () => string | null;
isCapturing: boolean;
previewRef: React.RefObject<HTMLVideoElement>;
previewRef: React.RefObject<HTMLVideoElement | null>;
error: string | null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/performance/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function useDebouncedCallback<T extends (...args: unknown[]) => void>(
* Previous value - useful for comparing state changes
*/
export function usePrevious<T>(value: T): T | undefined {
const ref = useRef<T>();
const ref = useRef<T | undefined>(undefined);

useEffect(() => {
ref.current = value;
Expand Down
5 changes: 3 additions & 2 deletions src/services/ai/__tests__/openai-helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@ describe('formatMessagesForOpenAI', () => {
| OpenAI.Chat.Completions.ChatCompletionAssistantMessageParam
| undefined;

expect(assistantMsg?.tool_calls?.[0].function.name).toBe('');
expect(assistantMsg?.tool_calls?.[0].function.arguments).toBe('{}');
const toolCall = assistantMsg?.tool_calls?.[0];
expect(toolCall?.type === 'function' && toolCall.function.name).toBe('');
expect(toolCall?.type === 'function' && toolCall.function.arguments).toBe('{}');
Comment on lines +287 to +288
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

While this use of the logical AND && operator is clever for type guarding and asserting in one line, it can be difficult to read and understand, especially for developers less familiar with this pattern. The test failure message if toolCall.type is not 'function' (expected false to be '') can also be confusing.

For better readability and clearer test failure messages, I suggest separating the type check from the property assertions.

const toolCall = assistantMsg?.tool_calls?.[0];
expect(toolCall?.type).toBe('function');

// This type guard is necessary for TypeScript to allow accessing `.function`
if (toolCall?.type === 'function') {
  expect(toolCall.function.name).toBe('');
  expect(toolCall.function.arguments).toBe('{}');
}

});

it('should not add tool_calls message for user messages with tool_use blocks', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/services/ai/openai-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export function parseOpenAIContent(

if (message.tool_calls) {
for (const toolCall of message.tool_calls) {
if (toolCall.type !== 'function') continue;

let parsedInput: Record<string, unknown> = {};
try {
parsedInput = JSON.parse(toolCall.function.arguments);
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';

export default defineConfig({
plugins: [react(), tsconfigPaths()],
plugins: [tailwindcss(), react(), tsconfigPaths()],
resolve: {
extensions: ['.tsx', '.ts', '.jsx', '.js'],
},
Expand Down
Loading