19 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
ad96d38863 feat: split schedule view horizontal axis into AM/PM half-day slots
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/b0f3486c-edf5-4c08-b1e8-161b380aa0a0

Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
2026-04-06 08:09:33 +00:00
h
b80c15e186 Merge pull request #7 from pdf114514/copilot/fix-morning-afternoon-specification
Fix AM/PM period loss on reservation drag-move; add drag & drop car reordering
2026-04-06 16:52:28 +09:00
copilot-swe-agent[bot]
7a04012b60 refactor: extract shared applyReorder helper in CarManagement
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/c5f8f1a2-8a8b-4951-8442-76ce37d906ae

Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
2026-04-06 07:48:47 +00:00
copilot-swe-agent[bot]
3b49844d0b fix: preserve AM/PM when dragging reservation; add drag & drop car reordering
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/c5f8f1a2-8a8b-4951-8442-76ce37d906ae

Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
2026-04-06 07:47:08 +00:00
h
81767e5270 Merge pull request #6 from pdf114514/copilot/update-reservation-options
Add car reordering and AM/PM period fields for reservations
2026-04-06 16:37:36 +09:00
copilot-swe-agent[bot]
675e5f6fe8 Add car reordering and AM/PM period for reservations
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/c0a4b7dc-228e-4e7d-a985-61b9a17de159

Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
2026-04-06 07:12:49 +00:00
h
2e9e100178 Commit 2026-04-06 15:36:51 +09:00
h
1081ea1074 Merge pull request #5 from pdf114514/copilot/update-vehicle-indicator-display
Updating vehicle indicator and editing interface
2026-03-22 13:26:06 +09:00
copilot-swe-agent[bot]
761c7f1971 Changes before error encountered
Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/a42d4e36-a3cf-4ff7-b1cb-f076e601b1b8
2026-03-22 04:25:00 +00:00
h
0bd5efde2c Merge pull request #4 from pdf114514/copilot/add-field-and-sync-features
Implementing vehicle details and real-time editing synchronization
2026-03-22 13:00:47 +09:00
copilot-swe-agent[bot]
8e9db971d3 feat: add inspection_expiry/has_etc/tire_type fields, icons in schedule view, and WebSocket real-time sync
Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/6d0f25ae-6db4-4937-ae2b-6674456a5ca1
2026-03-22 03:58:07 +00:00
h
09872737b7 Merge pull request #3 from pdf114514/copilot/add-popup-for-edit-delete-reservations
Add timeline view, right-click context menu on reservations, fix trust proxy
2026-03-21 03:52:02 +09:00
copilot-swe-agent[bot]
cc3ad148fc Add timeline view, right-click context menu, and fix Express trust proxy
- backend/server.js: Add app.set('trust proxy', 1) to fix express-rate-limit
  ValidationError when app runs behind nginx reverse proxy
- ScheduleView.jsx: Add right-click context menu on reservation blocks with
  Edit and Delete options; closes on click-outside or Escape
- ScheduleView.module.css: Add context menu styles
- TimelineView.jsx: New Gantt-style monthly timeline view showing all
  reservations sorted by date, with month navigation and right-click menu
- TimelineView.module.css: Styles for the timeline view
- App.jsx: Add 'タイムライン' tab to navigation

Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/d03ca12c-21ce-45a0-881f-919d6635e7fb
2026-03-20 18:50:51 +00:00
copilot-swe-agent[bot]
1eb96877ff Initial plan 2026-03-20 18:38:28 +00:00
h
76dc94dd78 Merge pull request #2 from pdf114514/copilot/disable-drag-drop-for-touch
Disable touch drag & drop, warn on car delete with reservations, support configurable backend URL
2026-03-21 03:21:50 +09:00
copilot-swe-agent[bot]
c3dd0cfa69 Disable touch drag & drop, warn on car delete with reservations, configure backend URL
Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/cd194ca1-b339-4f2f-b717-31a0ba193964
2026-03-20 18:19:53 +00:00
copilot-swe-agent[bot]
40371b43d1 Initial plan 2026-03-20 18:13:46 +00:00
h
19953dff55 Merge pull request #1 from pdf114514/copilot/create-car-rental-schedule-system
Add car rental schedule management system (React+Vite + Express+SQLite)
2026-03-21 03:07:15 +09:00
copilot-swe-agent[bot]
50d3803610 Implement car reservation schedule management system
Co-authored-by: pdf114514 <57948770+pdf114514@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pdf114514/CarReservation/sessions/1d8c6b05-0e8d-4484-a2d8-8d427dfad9cb
2026-03-20 18:03:33 +00:00
3 changed files with 14 additions and 7 deletions

View File

@@ -68,6 +68,7 @@ if (!carCols.includes('sort_order')) {
db.exec('ALTER TABLE cars ADD COLUMN sort_order INTEGER DEFAULT 0'); db.exec('ALTER TABLE cars ADD COLUMN sort_order INTEGER DEFAULT 0');
db.exec('UPDATE cars SET sort_order = id'); db.exec('UPDATE cars SET sort_order = id');
} }
db.prepare("UPDATE cars SET tire_type = 'スタッドレス' WHERE tire_type = 'スタットレス'").run();
// Migrate: add period fields to reservations if they don't exist yet // Migrate: add period fields to reservations if they don't exist yet
const resCols = db.prepare("PRAGMA table_info(reservations)").all().map((c) => c.name); const resCols = db.prepare("PRAGMA table_info(reservations)").all().map((c) => c.name);
@@ -99,13 +100,17 @@ function broadcast(message) {
}); });
} }
// for future use function normalizeTireType(value) {
return value === 'スタットレス' ? 'スタッドレス' : value;
}
function normalizeCar(car) { function normalizeCar(car) {
if (!car) { if (!car) {
return car; return car;
} }
return { return {
...car, ...car,
tire_type: normalizeTireType(car.tire_type),
}; };
} }

View File

@@ -1,5 +1,5 @@
import { useState, useEffect, useRef, useCallback } from 'react'; import { useState, useEffect, useRef, useCallback } from 'react';
import { format, addDays, parseISO, differenceInDays } from 'date-fns'; import { format, addDays, startOfWeek, parseISO, differenceInDays } from 'date-fns';
import { ja } from 'date-fns/locale'; import { ja } from 'date-fns/locale';
import { api } from '../api.js'; import { api } from '../api.js';
import { isInspectionExpirySoon, formatDateRange, formatReservationTooltip } from '../utils/carUtils.js'; import { isInspectionExpirySoon, formatDateRange, formatReservationTooltip } from '../utils/carUtils.js';
@@ -43,8 +43,10 @@ export default function ScheduleView({ reloadKey = 0 }) {
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [error, setError] = useState(null); const [error, setError] = useState(null);
// The first date shown in the grid (start from today) // The first date shown in the grid
const [viewStart, setViewStart] = useState(() => new Date()); const [viewStart, setViewStart] = useState(() =>
startOfWeek(new Date(), { weekStartsOn: 1 })
);
// Drag-to-create state // Drag-to-create state
const [creating, setCreating] = useState(null); const [creating, setCreating] = useState(null);
@@ -90,7 +92,7 @@ export default function ScheduleView({ reloadKey = 0 }) {
// --- Navigation --- // --- Navigation ---
const prevWeek = () => setViewStart((d) => addDays(d, -7)); const prevWeek = () => setViewStart((d) => addDays(d, -7));
const nextWeek = () => setViewStart((d) => addDays(d, 7)); const nextWeek = () => setViewStart((d) => addDays(d, 7));
const goToday = () => setViewStart(new Date()); const goToday = () => setViewStart(startOfWeek(new Date(), { weekStartsOn: 1 }));
// --- Grid position helpers --- // --- Grid position helpers ---
// Given a mouse clientX within the grid scroll area, get the half-day slot index (0-based) // Given a mouse clientX within the grid scroll area, get the half-day slot index (0-based)

View File

@@ -136,9 +136,9 @@ export default function TimelineView({ reloadKey = 0 }) {
const carColorMap = {}; const carColorMap = {};
cars.forEach((car, i) => { carColorMap[car.id] = getColor(i); }); cars.forEach((car, i) => { carColorMap[car.id] = getColor(i); });
// Sort reservations by start_date descending (newest first) then car // Sort reservations by start_date then car
const sortedReservations = [...reservations].sort((a, b) => { const sortedReservations = [...reservations].sort((a, b) => {
if (a.start_date !== b.start_date) return a.start_date > b.start_date ? -1 : 1; if (a.start_date !== b.start_date) return a.start_date < b.start_date ? -1 : 1;
return a.car_id - b.car_id; return a.car_id - b.car_id;
}); });