Fix session UNIQUE constraint race, fix table horizontal scrollbar

- create_session uses INSERT OR IGNORE to handle concurrent requests
  with same session cookie (race when multiple requests arrive before
  the first INSERT commits)
- Widen actions column 110px→130px to fit 3 action buttons without
  overflowing (was causing 4px horizontal scrollbar)
- Widen status column 100px→120px for DOWNLOADING badge breathing room
This commit is contained in:
xpltd 2026-03-21 20:23:07 -05:00
parent 1592407658
commit 0a67cb45bc
2 changed files with 4 additions and 4 deletions

View file

@ -319,10 +319,10 @@ async def close_db(db: aiosqlite.Connection) -> None:
async def create_session(db: aiosqlite.Connection, session_id: str) -> None:
"""Insert a new session row."""
"""Insert a new session row (idempotent — ignores duplicates)."""
now = datetime.now(timezone.utc).isoformat()
await db.execute(
"INSERT INTO sessions (id, created_at, last_seen) VALUES (?, ?, ?)",
"INSERT OR IGNORE INTO sessions (id, created_at, last_seen) VALUES (?, ?, ?)",
(session_id, now, now),
)
await db.commit()

View file

@ -387,11 +387,11 @@ a.name-with-icon:hover .name-text {
min-width: 0;
}
.col-status { width: 100px; }
.col-status { width: 120px; white-space: nowrap; }
.col-progress { width: 180px; min-width: 120px; }
.col-speed { width: 100px; }
.col-eta { width: 80px; }
.col-actions { width: 110px; }
.col-actions { width: 130px; }
/* Status badges */
.status-badge {