diff --git a/src/pages/GamePage.css b/src/pages/GamePage.css index 336ecd8..9b0d386 100644 --- a/src/pages/GamePage.css +++ b/src/pages/GamePage.css @@ -200,140 +200,6 @@ gap: 0.4rem; } -.header-settings { - position: relative; -} - -.settings-btn { - width: 36px; - height: 36px; - display: flex; - align-items: center; - justify-content: center; - background: rgba(255, 255, 255, 0.08); - border: none; - border-radius: 50%; - font-size: 1rem; - cursor: pointer; - transition: all 0.2s; -} - -.settings-btn:hover { - background: rgba(255, 255, 255, 0.15); -} - -.settings-menu { - position: absolute; - top: 100%; - right: 0; - margin-top: 0.5rem; - background: #141414; - border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 12px; - min-width: 240px; - box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); - z-index: 100; - overflow: hidden; -} - -.settings-menu-header { - padding: 0.75rem 1rem; - border-bottom: 1px solid rgba(255, 255, 255, 0.08); - font-size: 0.85rem; - color: #999; - font-weight: 500; -} - -.settings-menu-content { - padding: 0.5rem; -} - -.settings-item { - width: 100%; - display: flex; - align-items: center; - gap: 0.5rem; - padding: 0.75rem 1rem; - background: none; - border: none; - border-radius: 8px; - color: #ddd; - font-size: 0.9rem; - cursor: pointer; - text-align: left; - transition: all 0.2s; -} - -.settings-item:hover:not(:disabled) { - background: rgba(255, 255, 255, 0.08); -} - -.settings-item:disabled { - opacity: 0.4; - cursor: not-allowed; -} - -.settings-item.danger { - color: #f87171; -} - -.settings-item.danger:hover:not(:disabled) { - background: rgba(239, 68, 68, 0.12); -} - -.settings-item-hint { - font-size: 0.75rem; - color: #666; - margin-left: auto; -} - -.delete-confirm { - padding: 0.5rem; -} - -.delete-confirm p { - margin: 0 0 0.75rem 0; - font-size: 0.85rem; - color: #f87171; - text-align: center; -} - -.delete-confirm-buttons { - display: flex; - gap: 0.5rem; -} - -.confirm-btn { - flex: 1; - padding: 0.6rem 1rem; - border: none; - border-radius: 8px; - font-size: 0.85rem; - font-weight: 500; - cursor: pointer; - transition: all 0.2s; -} - -.confirm-btn.cancel { - background: rgba(255, 255, 255, 0.1); - color: #999; -} - -.confirm-btn.cancel:hover { - background: rgba(255, 255, 255, 0.15); - color: #fff; -} - -.confirm-btn.delete { - background: rgba(239, 68, 68, 0.2); - color: #f87171; -} - -.confirm-btn.delete:hover { - background: rgba(239, 68, 68, 0.35); - color: #fff; -} - .stat-badge { padding: 0.35rem 0.65rem; border-radius: 16px; diff --git a/src/pages/GamePage.tsx b/src/pages/GamePage.tsx index 26b18a3..d7ef26c 100644 --- a/src/pages/GamePage.tsx +++ b/src/pages/GamePage.tsx @@ -8,7 +8,6 @@ import { getSession, createSession, saveSession as apiSaveSession, - deleteSession as apiDeleteSession, getPlayerCharacter, type SessionListItem, } from "../services/api"; @@ -64,8 +63,6 @@ export default function GamePage() { const [showScrollButton, setShowScrollButton] = useState(false); const [editingMessageId, setEditingMessageId] = useState(null); const [editContent, setEditContent] = useState(""); - const [showSettings, setShowSettings] = useState(false); - const [deleteConfirmStep, setDeleteConfirmStep] = useState(0); const abortControllerRef = useRef(null); const messagesEndRef = useRef(null); const messagesContainerRef = useRef(null); @@ -627,26 +624,6 @@ export default function GamePage() { setIsInitialLoading(false); }; - const handleDeleteSession = async (sessionId: string) => { - if (!id || sessionsList.length <= 1) { - alert("Нельзя удалить единственную сессию"); - setDeleteConfirmStep(0); - return; - } - - const success = await apiDeleteSession(id, sessionId); - if (success) { - const updatedList = sessionsList.filter((s) => s.id !== sessionId); - setSessionsList(updatedList); - - // Если удалили текущую сессию — переключаемся на другую - if (sessionId === currentSessionId && updatedList.length > 0) { - await handleSwitchSession(updatedList[0].id); - } - } - setShowSessionMenu(false); - }; - const currentSessionName = sessionsList.find((s) => s.id === currentSessionId)?.name || "Сессия"; @@ -726,62 +703,8 @@ export default function GamePage() { 🎟️ {formatTokens(estimateTokens(session?.messages || []))} -
- - {showSettings && ( -
-
Настройки сессии
-
- {deleteConfirmStep === 0 && ( - - )} - {deleteConfirmStep === 1 && ( -
-

Вы уверены? Это действие нельзя отменить.

-
- - -
-
- )} -
-
- )} -
+ +
{ - if (confirm("Удалить эту историю?")) { - const success = await apiDeleteStory(id); - if (success) { - setStories(stories.filter((s) => s.id !== id)); - } - } - }; - const filteredStories = stories.filter( (story) => story.title.toLowerCase().includes(searchTerm.toLowerCase()) || @@ -133,12 +124,6 @@ export default function StoriesPage() { 🎮 Играть -