From 15d498797748d107ffc2fe878ca15c07dfec5589 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Tue, 6 Oct 2026 16:04:58 +0300 Subject: [PATCH] fix(auth, pwa): restore api.auth.me, bump PWA cache to v5.3, and fix CEFR CSS styling --- app/static/css/style.css | 48 ++++++++++++++++++++++++++++++++++++ app/static/index.html | 4 +-- app/static/js/modules/api.js | 5 +++- app/static/sw.js | 6 ++--- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/app/static/css/style.css b/app/static/css/style.css index 5679af3..85d9fbd 100644 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -4227,6 +4227,54 @@ body { width: 100%; } +.cefr-overview-container, +.cefr-quiz-container, +.cefr-summary-container { + width: 100%; +} + +.level-code { + font-weight: 800; +} + +.badge-pos { + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + background: var(--bg-hover); + color: var(--text-muted); + padding: 3px 8px; + border-radius: var(--radius-sm); + border: 1px solid var(--border-color); +} + +.clue-icon { + font-size: 16px; +} + +.clue-label { + font-size: 13px; + color: var(--text-muted); + font-weight: 500; +} + +.cefr-feedback-box .fb-term { + font-size: 16px; + color: var(--text-main); + font-weight: 700; +} + +.cefr-feedback-box .fb-trans { + font-size: 14.5px; + color: var(--text-main); + font-weight: 500; +} + +.progress-labels-row .counts-text { + font-size: 12px; + color: var(--text-muted); +} + .cefr-header { margin-bottom: 28px; } diff --git a/app/static/index.html b/app/static/index.html index 0875a58..1ac0e89 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -5,7 +5,7 @@ Notes — Персональный тренажер и словарь английского языка - + @@ -1383,7 +1383,7 @@ - + diff --git a/app/static/js/modules/api.js b/app/static/js/modules/api.js index 1f1f802..aba3838 100644 --- a/app/static/js/modules/api.js +++ b/app/static/js/modules/api.js @@ -28,8 +28,11 @@ window.fetch = function(url, options = {}) { export const api = { // Auth endpoints auth: { + async me() { + return await fetch('/api/me'); + }, async check() { - const resp = await fetch('/api/me'); + const resp = await this.me(); if (resp.ok) { return await resp.json(); } diff --git a/app/static/sw.js b/app/static/sw.js index 0fa5976..7adac4f 100644 --- a/app/static/sw.js +++ b/app/static/sw.js @@ -1,7 +1,7 @@ // Service Worker for Notes English PWA (Stage 2) // Strategy: Cache-first for static assets, Network-first for API calls. -const CACHE_NAME = 'notes-v5.2'; +const CACHE_NAME = 'notes-v5.3'; const OFFLINE_URL = '/'; const PRECACHE_URLS = [ @@ -67,14 +67,14 @@ self.addEventListener('fetch', (event) => { return; } - // Static assets (CSS, JS, icons) → Cache-first + // Static assets (CSS, JS, icons) → Cache-first (with ignoreSearch) if ( url.pathname.startsWith('/static/') || url.pathname === '/manifest.json' || url.pathname === '/sw.js' ) { event.respondWith( - caches.match(request).then((cached) => { + caches.match(request, { ignoreSearch: true }).then((cached) => { return cached || fetch(request).then((response) => { if (response.ok) { const clone = response.clone();