diff --git a/README.md b/README.md index ec22812..e7742b9 100644 --- a/README.md +++ b/README.md @@ -631,6 +631,16 @@ data: [DONE] ## Changelog +### v1.2.1 (2026-05-19) +- Fixed: messages lost when switching conversations during streaming generation +- Streaming responses auto-save every 20 tokens to prevent data loss +- Partial responses preserved when switching sessions mid-generation +- Added in-app terminal panel for Coding and Agentic modes +- Terminal parses code blocks, file operations, and tool calls from AI responses +- Terminal toggle button with collapsible panel (persists state) +- Conversation list now shows message count per session +- Improved conversation switch safety with flush-before-switch pattern + ### v1.2.0 (2026-05-19) - Added light mode / dark mode toggle - Theme persists across sessions via localStorage diff --git a/android/app/build.gradle b/android/app/build.gradle index 2d2c08d..59ed888 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "ai.z.chat" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 2 - versionName "1.2.0" + versionCode 3 + versionName "1.2.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' diff --git a/package.json b/package.json index 7869faa..608d8eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zai-chat", - "version": "1.2.0", + "version": "1.2.1", "description": "Z.AI Chat - Full stack AI chat powered by GLM Coding Plan", "main": "index.js", "scripts": { diff --git a/www/css/styles.css b/www/css/styles.css index b0da3ca..b965ea0 100644 --- a/www/css/styles.css +++ b/www/css/styles.css @@ -693,6 +693,155 @@ a:hover { text-decoration: underline; } font-size: 12px; } +.terminal-panel { + display: none; + flex-direction: column; + background: var(--bg-code); + border-top: 1px solid var(--border); + max-height: 0; + overflow: hidden; + transition: max-height 0.3s ease; + flex-shrink: 0; +} +.terminal-panel.open { + max-height: 45vh; +} +.terminal-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 8px 12px; + background: var(--bg-tertiary); + border-bottom: 1px solid var(--border); + flex-shrink: 0; +} +.terminal-title { + font-size: 12px; + font-weight: 700; + color: var(--success); + text-transform: uppercase; + letter-spacing: 1px; + font-family: 'Fira Code', 'JetBrains Mono', monospace; +} +.terminal-info { + font-size: 11px; + color: var(--text-muted); + font-family: monospace; +} +.terminal-body { + overflow-y: auto; + padding: 8px; + font-family: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace; + font-size: 12px; + line-height: 1.5; + flex: 1; + min-height: 60px; + max-height: calc(45vh - 40px); +} +.term-empty { + color: var(--text-muted); + text-align: center; + padding: 20px; + font-size: 12px; +} +.term-entry { + margin-bottom: 8px; + border-radius: 6px; + overflow: hidden; + border: 1px solid var(--border); +} +.term-tool { + background: var(--bg-secondary); +} +.term-tool-header { + padding: 6px 10px; + font-size: 11px; + font-weight: 700; + font-family: monospace; + background: var(--bg-tertiary); +} +.term-action { + font-weight: 800; + letter-spacing: 0.5px; +} +.term-target { + color: var(--text-secondary); + font-weight: 400; + margin-left: 4px; + word-break: break-all; +} +.term-code-block { + background: var(--bg-secondary); +} +.term-file-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 5px 10px; + background: var(--bg-tertiary); + border-bottom: 1px solid var(--border); +} +.term-lang { + font-size: 11px; + color: var(--accent); + font-weight: 600; +} +.term-copy-btn { + background: var(--accent-dim); + border: none; + color: var(--accent); + padding: 2px 8px; + border-radius: 3px; + font-size: 10px; + cursor: pointer; + font-family: inherit; +} +.term-copy-btn:hover { background: var(--accent); color: white; } +.term-code { + padding: 8px 10px; + margin: 0; + font-size: 11px; + line-height: 1.4; + color: var(--text-primary); + white-space: pre-wrap; + word-break: break-all; + overflow-x: auto; + max-height: 200px; + overflow-y: auto; + background: transparent; +} + +.terminal-toggle-btn { + display: none; + align-items: center; + justify-content: center; + gap: 6px; + width: 100%; + padding: 8px; + background: var(--bg-tertiary); + border: none; + border-top: 1px solid var(--border); + color: var(--text-secondary); + font-size: 12px; + font-weight: 600; + cursor: pointer; + transition: all var(--transition); + flex-shrink: 0; +} +.terminal-toggle-btn:hover { + background: var(--accent-dim); + color: var(--accent); +} +.terminal-icon { + font-size: 10px; +} +.terminal-label { + font-family: 'Fira Code', monospace; + text-transform: uppercase; + letter-spacing: 0.5px; + font-size: 11px; +} + /* Responsive */ @media (max-width: 480px) { .message { max-width: 92%; } diff --git a/www/index.html b/www/index.html index 029872f..923e685 100644 --- a/www/index.html +++ b/www/index.html @@ -96,6 +96,18 @@
+
+
+ ■ Terminal + +
+
+
+ +
@@ -185,13 +197,28 @@

About

-

Z.AI Chat v1.2.0

+

Z.AI Chat v1.2.1

Built with Z.AI SDK & GLM-5.1

Compatible with Android 15/16

Changelog