diff --git a/README.md b/README.md index 3dbfd2f..5df5ad2 100644 --- a/README.md +++ b/README.md @@ -631,6 +631,14 @@ data: [DONE] ## Changelog +### v2.1.0 (2026-05-19) +- **File Tree per Session** — sidebar shows all AI-generated files per conversation, click to view/edit/save +- **File Viewer with Edit Mode** — view any file, switch to edit mode, save changes back to device +- **Auto-Continue** — app detects incomplete AI responses and auto-continues until task is confirmed done +- **Task Completion Protocol** — AI outputs `[TASK_COMPLETE]` when done; detects truncated code blocks and unclosed file tags +- **Configurable Auto-Continue** — max auto-continues adjustable 1–20 (default 5) in Settings +- File tree button visible in Coding/Agentic modes alongside Terminal toggle + ### v2.0.1 (2026-05-19) - **APK Build Verification** — confirms APK file exists after build, shows file size - **Stay Awake Fix** — dual wake locks (screen bright + CPU partial) with 24h timeout keep device fully awake diff --git a/android/app/build.gradle b/android/app/build.gradle index 30e385f..b0bfee1 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 11 - versionName "2.0.1" + versionCode 12 + versionName "2.1.0" 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 1cb9b21..abaf34c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zai-chat", - "version": "2.0.1", + "version": "2.1.0", "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 90555b5..07e625d 100644 --- a/www/css/styles.css +++ b/www/css/styles.css @@ -899,6 +899,214 @@ a:hover { text-decoration: underline; } font-size: 11px; } +/* File Tree Panel */ +.file-tree-panel { + position: fixed; + right: -300px; + top: 0; + bottom: 0; + width: 280px; + background: var(--bg-secondary); + border-left: 1px solid var(--border); + z-index: 100; + display: flex; + flex-direction: column; + transition: right 0.3s ease; +} +.file-tree-panel.open { right: 0; } +.file-tree-overlay { + position: fixed; + top: 0; left: 0; right: 0; bottom: 0; + background: var(--sidebar-overlay-bg); + z-index: 99; + display: none; +} +.file-tree-overlay.active { display: block; } +.file-tree-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px; + border-bottom: 1px solid var(--border); +} +.file-tree-header h3 { font-size: 16px; } +.file-tree-body { + flex: 1; + overflow-y: auto; + padding: 8px 0; +} +.file-tree-footer { + padding: 8px 16px; + border-top: 1px solid var(--border); + font-size: 12px; + color: var(--text-muted); +} +.ftree-empty { + text-align: center; + color: var(--text-muted); + font-size: 13px; + padding: 40px 20px; + line-height: 1.6; +} +.ftree-folder { } +.ftree-folder .ftree-children { + display: none; +} +.ftree-folder.open > .ftree-children { + display: block; +} +.ftree-node { + display: flex; + align-items: center; + gap: 6px; + padding: 6px 8px; + cursor: pointer; + transition: background var(--transition); + font-size: 13px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.ftree-node:hover { + background: var(--accent-dim); +} +.ftree-dir { + color: var(--text-primary); + font-weight: 600; +} +.ftree-arrow { + font-size: 8px; + color: var(--text-muted); + width: 10px; + flex-shrink: 0; + transition: transform 0.2s ease; +} +.ftree-dirname { + flex: 1; + overflow: hidden; + text-overflow: ellipsis; +} +.ftree-file { + color: var(--text-secondary); +} +.ftree-ext { + font-size: 9px; + font-weight: 700; + text-transform: uppercase; + background: var(--accent-dim); + color: var(--accent); + padding: 1px 5px; + border-radius: 3px; + flex-shrink: 0; + letter-spacing: 0.3px; +} +.ftree-fname { + flex: 1; + overflow: hidden; + text-overflow: ellipsis; +} + +/* File Viewer */ +.file-viewer { + display: none; + position: fixed; + top: 0; left: 0; right: 0; bottom: 0; + z-index: 200; + flex-direction: column; + background: var(--bg-primary); +} +.file-viewer-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 8px 12px; + background: var(--bg-secondary); + border-bottom: 1px solid var(--border); + min-height: 52px; + gap: 8px; +} +.file-viewer-title { + display: flex; + align-items: center; + gap: 8px; + flex: 1; + min-width: 0; +} +#file-viewer-name { + font-size: 14px; + font-weight: 600; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.fv-lang { + font-size: 10px; + font-weight: 700; + text-transform: uppercase; + background: var(--accent-dim); + color: var(--accent); + padding: 2px 6px; + border-radius: 3px; + flex-shrink: 0; +} +.file-viewer-actions { + display: flex; + align-items: center; + gap: 6px; + flex-shrink: 0; +} +.fv-btn { + background: var(--bg-tertiary); + border: 1px solid var(--border); + color: var(--text-primary); + padding: 5px 14px; + border-radius: 6px; + font-size: 12px; + font-weight: 600; + cursor: pointer; +} +.fv-btn:active { background: var(--accent-dim); } +.fv-btn-save { + background: var(--success); + color: white; + border-color: var(--success); +} +.fv-btn-save:active { opacity: 0.8; } +.file-viewer-body { + flex: 1; + overflow: auto; + padding: 0; +} +.file-viewer-body pre { + margin: 0; + padding: 16px; + font-family: 'Fira Code', 'JetBrains Mono', monospace; + font-size: 13px; + line-height: 1.5; + color: var(--text-primary); + white-space: pre-wrap; + word-break: break-all; + background: transparent; +} +.file-viewer-editor { + flex: 1; + display: flex; +} +.file-viewer-editor textarea { + flex: 1; + width: 100%; + padding: 16px; + font-family: 'Fira Code', 'JetBrains Mono', monospace; + font-size: 13px; + line-height: 1.5; + color: var(--text-primary); + background: var(--bg-code); + border: none; + outline: none; + resize: none; + -webkit-overflow-scrolling: touch; +} + /* Responsive */ @media (max-width: 480px) { .message { max-width: 92%; } diff --git a/www/index.html b/www/index.html index 11e01dd..cbe28fb 100644 --- a/www/index.html +++ b/www/index.html @@ -76,6 +76,7 @@
+ @@ -94,6 +95,40 @@
+
+
+

Project Files

+ +
+
+
No files yet.
AI-generated files appear here.
+
+ +
+
+ +
+
+
+ file + +
+
+ + + +
+
+
+

+                
+ +
+
@@ -261,6 +296,19 @@
How many times AI will auto-retry after build failures +
+ + +
+ Auto-continues AI if task is incomplete or response cut off +
+ + +
+ Max times AI will be asked to continue incomplete work

Appearance

@@ -279,13 +327,24 @@

About

-

Z.AI Chat v2.0.1

+

Z.AI Chat v2.1.0

Built with Z.AI SDK & GLM-5.1

Compatible with Android 15/16

Changelog