4 Commits

Author SHA1 Message Date
jacobh2 4d53887fcc Update todo
Build Frontend / build (push) Successful in 8m35s
2026-06-07 22:46:36 +02:00
jacobh2 673c151213 Update clean tool 2026-06-07 22:46:01 +02:00
jacobh2 8b4f519e55 Adding some test 2026-06-07 22:42:09 +02:00
jacobh2 f14e58d42c chore(vite): prioritise .tsx/.ts over .js in resolve.extensions
Prevents stale compiled .js files from shadowing their .tsx sources
when the AI agent builds or type-checks the frontend.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 22:41:38 +02:00
4 changed files with 59 additions and 3 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
"test": "DEBUG_PRINT_LIMIT=0 vitest run --reporter=dot --no-color",
"test:all": "vitest run && npx playwright test",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"clean": "find src -name '*.js' -o -name '*.jsx' -delete"
"clean": "find .. -not -path '*/node_modules/*' -not -name 'eslint.config.js' \\( -name '*.js' -o -name '*.jsx' \\) -delete"
},
"dependencies": {
"@tanstack/react-query": "^5.100.5",
@@ -0,0 +1,55 @@
import { describe, it, expect, vi, beforeAll, afterAll } from 'vitest';
import { render, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
import { SessionList } from '../../../../src/components/stats/SessionList';
vi.mock('../../../../src/hooks/useSleepSession', () => ({
useSessions: () => ({
sessions: [
{
id: 1,
start_time: '2026-06-04T11:58:00',
end_time: '2026-06-04T13:58:00',
notes: null,
created_at: '2026-06-04T11:58:00',
updated_at: '2026-06-04T11:58:00',
},
],
isLoading: false,
updateSession: vi.fn(),
deleteSession: vi.fn(),
isDeleting: false,
}),
}));
vi.mock('../../../../src/hooks/useSettings', () => ({
useSettings: () => ({ settings: { sessionsPerPage: 10 } }),
}));
const originalTZ = process.env.TZ;
beforeAll(() => {
process.env.TZ = 'Europe/Stockholm';
});
afterAll(() => {
process.env.TZ = originalTZ;
});
describe('SessionList edit timezone', () => {
it('pre-fills edit inputs with local Stockholm time, not UTC', () => {
const { container } = render(<SessionList />);
const clickableRow = container.querySelector('.cursor-pointer') as HTMLElement;
expect(clickableRow).not.toBeNull();
fireEvent.click(clickableRow);
const inputs = container.querySelectorAll('input[type="datetime-local"]');
expect(inputs).toHaveLength(2);
// Backend sends 11:58 UTC (no Z). Stockholm is UTC+2, so local time is 13:58.
expect((inputs[0] as HTMLInputElement).value).toBe('2026-06-04T13:58');
// Backend sends 13:58 UTC → Stockholm 15:58
expect((inputs[1] as HTMLInputElement).value).toBe('2026-06-04T15:58');
});
});
+1
View File
@@ -26,6 +26,7 @@ export default defineConfig({
__APP_GITSHA__: JSON.stringify(APP_GITSHA),
},
resolve: {
extensions: ['.tsx', '.ts', '.jsx', '.mjs', '.js', '.json'],
alias: {
'@': path.resolve(__dirname, './src'),
},
+2 -2
View File
@@ -1,6 +1,6 @@
# Things I need to tell my AI to do
- [ ] Check so that all tests actually make sense, maybe some are now obsolete, and some are missing
- [/backend start] Check so that all tests actually make sense, maybe some are now obsolete, and some are missing
- [ ] Add a test coverage metric to both frontend and backend so that we can check how much of the code is tested. I would like >=90%
- [ ] Go over Claude's slop-cleanup-stuff
- [x] Update the "Sleep Sessions" by adding a fake pagination view in the frontend so that I don't have to scroll so much. Instead, I want to simply click "next" and "previous" (with like numbers in between like a google search)
@@ -18,7 +18,7 @@ hint: Updates were rejected because the tag already exists in the remote.
exitcode '1': failure
```
- [ ] Editing a sleep session in "sleep sessions", when I click the edit button the times show up as UTC but should show as my local timezone
- [x] Editing a sleep session in "sleep sessions", when I click the edit button the times show up as UTC but should show as my local timezone
- [x] We should drop the "notes" column from the sleep_session table
- [x] Switch over to oh-my-opencode and try it out
- [x] Adda footer at the bottom of the app that shows the version (aka git tag) of the app