From 9e8a9f4c0aa973e3fdba58ee87173015c42e2bf0 Mon Sep 17 00:00:00 2001 From: duanfuxiang Date: Mon, 22 Sep 2025 18:58:40 +0800 Subject: [PATCH] update release --- .trunk/actions | 1 + .trunk/logs | 1 + .trunk/notifications | 1 + .trunk/plugins/trunk | 1 + .trunk/tools | 1 + CHANGELOG.yaml | 3 + manifest.json | 2 +- package.json | 2 +- .../components/ModelProviderSettings.tsx | 17 ++ .../components/PluginInfoSettings.tsx | 6 +- styles.css | 284 +++++++++++++----- 11 files changed, 240 insertions(+), 79 deletions(-) create mode 120000 .trunk/actions create mode 120000 .trunk/logs create mode 120000 .trunk/notifications create mode 120000 .trunk/plugins/trunk create mode 120000 .trunk/tools diff --git a/.trunk/actions b/.trunk/actions new file mode 120000 index 0000000..ffff9e6 --- /dev/null +++ b/.trunk/actions @@ -0,0 +1 @@ +/Users/dfx/.cache/trunk/repos/01f245efe699634f1bfdc90b794bb5b4/actions \ No newline at end of file diff --git a/.trunk/logs b/.trunk/logs new file mode 120000 index 0000000..0f49c34 --- /dev/null +++ b/.trunk/logs @@ -0,0 +1 @@ +/Users/dfx/.cache/trunk/repos/01f245efe699634f1bfdc90b794bb5b4/logs \ No newline at end of file diff --git a/.trunk/notifications b/.trunk/notifications new file mode 120000 index 0000000..33ebbe6 --- /dev/null +++ b/.trunk/notifications @@ -0,0 +1 @@ +/Users/dfx/.cache/trunk/repos/01f245efe699634f1bfdc90b794bb5b4/notifications \ No newline at end of file diff --git a/.trunk/plugins/trunk b/.trunk/plugins/trunk new file mode 120000 index 0000000..2809e97 --- /dev/null +++ b/.trunk/plugins/trunk @@ -0,0 +1 @@ +/Users/dfx/.cache/trunk/plugins/https---github-com-trunk-io-plugins/v1.7.2-4ebadccd80b22638 \ No newline at end of file diff --git a/.trunk/tools b/.trunk/tools new file mode 120000 index 0000000..833803a --- /dev/null +++ b/.trunk/tools @@ -0,0 +1 @@ +/Users/dfx/.cache/trunk/repos/01f245efe699634f1bfdc90b794bb5b4/tools \ No newline at end of file diff --git a/CHANGELOG.yaml b/CHANGELOG.yaml index 3ee226a..e705bb4 100644 --- a/CHANGELOG.yaml +++ b/CHANGELOG.yaml @@ -1,4 +1,7 @@ releases: + - version: "0.8.4" + features: + - "test mobile version" - version: "0.8.3" features: - "fix this update pro version error" diff --git a/manifest.json b/manifest.json index f089232..e24a157 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "infio-copilot", "name": "Infio Copilot", - "version": "0.8.3", + "version": "0.8.4", "minAppVersion": "0.15.0", "description": "A Cursor-inspired AI assistant for notes that offers smart autocomplete and interactive chat with your selected notes", "author": "Felix.D", diff --git a/package.json b/package.json index f77ebd7..b0e663f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-infio-copilot", - "version": "0.8.3", + "version": "0.8.4", "description": "A Cursor-inspired AI assistant that offers smart autocomplete and interactive chat with your selected notes", "main": "main.js", "scripts": { diff --git a/src/settings/components/ModelProviderSettings.tsx b/src/settings/components/ModelProviderSettings.tsx index f387303..7af9584 100644 --- a/src/settings/components/ModelProviderSettings.tsx +++ b/src/settings/components/ModelProviderSettings.tsx @@ -12,6 +12,7 @@ import { getProviderApiUrl } from '../../utils/provider-urls'; import { ApiKeyComponent, CustomUrlComponent } from './FormComponents'; import { ComboBoxComponent } from './ProviderModelsPicker'; +import { fetchUserPlan } from '../../hooks/use-infio'; type CustomProviderSettingsProps = { plugin: InfioPlugin; @@ -199,6 +200,22 @@ const CustomProviderSettings: React.FC = ({ plugin, const { default: LLMManager } = await import('../../core/llm/manager'); const { GetDefaultModelId } = await import('../../utils/api'); + // 对比 infio 使用独特的测试逻辑 + if (provider === ApiProvider.Infio) { + const apiKey = settings?.infioProvider?.apiKey?.trim(); + if (!apiKey) { + throw new Error('Infio API key is missing'); + } + + const userPlan = await fetchUserPlan(apiKey); + const plan = String(userPlan?.plan || '').toLowerCase(); + if (plan === 'general') { + console.debug('✅ Infio plan is general, skipping further connection tests.'); + return; // 直接返回成功 + } + } + + // 对于Ollama和OpenAICompatible,不支持测试API连接 if (provider === ApiProvider.Ollama || provider === ApiProvider.OpenAICompatible) { throw new Error(t("settings.ModelProvider.testConnection.notSupported", { provider })); diff --git a/src/settings/components/PluginInfoSettings.tsx b/src/settings/components/PluginInfoSettings.tsx index adf5f24..71ef812 100644 --- a/src/settings/components/PluginInfoSettings.tsx +++ b/src/settings/components/PluginInfoSettings.tsx @@ -1,4 +1,4 @@ -import { Notice, Plugin } from 'obsidian'; +import { Notice, Platform, Plugin } from 'obsidian'; import * as React from 'react'; import { ApiKeyModal } from '../../components/modals/ApiKeyModal'; @@ -75,6 +75,10 @@ export default function PluginInfoSettings({ } // 执行升级 + // check is mobile platform + if (Platform.isMobile) { + dl_zip = dl_zip.replace('.zip', '.mobile.zip'); + } const result = await upgradeToProVersion(plugin, dl_zip); if (result.success) { diff --git a/styles.css b/styles.css index 3d1e659..01aa818 100644 --- a/styles.css +++ b/styles.css @@ -158,7 +158,7 @@ .infio-chat-messages-assistant { display: flex; flex-direction: column; - /* 防止助手消息超出容器 */ + padding: var(--size-2-2); min-width: 0; max-width: 100%; } @@ -797,17 +797,17 @@ button:not(.clickable-icon).infio-chat-list-dropdown { display: flex; align-items: center; justify-content: center; - background-color: transparent !important; + color: var(--text-on-accent-hover); + background-color: var(--interactive-accent-hover); border: none !important; box-shadow: none !important; - color: var(--text-muted); padding: 0 !important; margin: 0 !important; width: 24px !important; height: 24px !important; &:hover { - background-color: var(--background-modifier-hover) !important; + background-color: var(--interactive-accent-hover) !important; } } @@ -991,11 +991,15 @@ input[type='text'].infio-chat-list-dropdown-item-title-input { gap: var(--size-4-1); } +/* =========================================== + 代码块样式 - 统一管理所有代码块相关样式 + =========================================== */ + +/* 基础代码块容器 */ .infio-chat-code-block { position: relative; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); - /* 防止代码块内容溢出 */ overflow: hidden; word-wrap: break-word; } @@ -1004,70 +1008,43 @@ input[type='text'].infio-chat-list-dropdown-item-title-input { padding: 0; } -/* 删除冲突的样式定义 */ - -/* RawMarkdownBlock 代码块容器样式 */ +/* RawMarkdownBlock 专用代码块容器 */ .infio-raw-markdown-code-block { - position: relative !important; - z-index: 100 !important; /* 提高z-index优先级 */ - margin: 0 !important; - padding: 0 !important; - /* 确保代码块不会被其他元素遮挡 */ - clear: both; - overflow: visible; - /* 添加背景色以确保可见性 */ - background: transparent; - /* 确保不被截断 */ + position: relative; + margin: 0; + padding: 0; width: 100%; + overflow: visible; + clear: both; box-sizing: border-box; + /* 创建新的层叠上下文,避免z-index冲突 */ + isolation: isolate; } -/* 确保代码块内容正确显示 */ +/* RawMarkdownBlock 内的 pre 元素 */ .infio-raw-markdown-code-block pre { - position: relative !important; - z-index: 101 !important; - margin: 0 !important; - padding: 0 !important; - /* 确保完整显示 */ - width: 100% !important; - overflow: visible !important; + position: relative; + margin: 0; + padding: 0; + width: 100%; + overflow: visible; } +/* RawMarkdownBlock 内的 code 元素 */ .infio-raw-markdown-code-block code { - position: relative !important; - z-index: 102 !important; - /* 确保代码内容完整显示 */ - display: block !important; - width: 100% !important; -} - -.infio-reasoning-content-wrapper { - /* Height restrictions removed to show full content */ - /* 防止推理内容溢出 */ - overflow-x: auto; - overflow-y: visible; -} - -/* 折叠/展开功能相关样式 */ -.infio-reasoning-content-wrapper.collapsed { - max-height: 150px; - overflow-y: auto; - transition: max-height 0.3s ease-in-out; -} - -.infio-reasoning-content-wrapper.expanded { - max-height: none; - overflow-y: visible; - transition: max-height 0.3s ease-in-out; + position: relative; + display: block; + width: 100%; } +/* 代码块头部样式 */ .infio-chat-code-block-header { display: none; justify-content: space-between; align-items: center; font-size: var(--font-smallest); padding: 0; - margin: 0; + margin: 0; } .infio-chat-code-block:hover .infio-chat-code-block-header { @@ -1091,6 +1068,7 @@ input[type='text'].infio-chat-list-dropdown-item-title-input { left: 0; } +/* 代码块头部文件名样式 */ .infio-chat-code-block-header-filename { padding-left: var(--size-4-2); font-size: var(--font-medium); @@ -1107,6 +1085,7 @@ input[type='text'].infio-chat-list-dropdown-item-title-input { flex-shrink: 0; } +/* 代码块头部按钮样式 */ .infio-chat-code-block-header-button { display: flex; gap: var(--size-4-1); @@ -1126,9 +1105,7 @@ input[type='text'].infio-chat-list-dropdown-item-title-input { padding-right: var(--size-4-1); } -.infio-chat-code-block.has-filename - .infio-chat-code-block-header-button - button { +.infio-chat-code-block.has-filename .infio-chat-code-block-header-button button { box-shadow: none; border: 0; padding: 0 var(--size-4-2); @@ -1137,10 +1114,10 @@ input[type='text'].infio-chat-list-dropdown-item-title-input { font-size: var(--font-medium); height: 100%; cursor: pointer; +} - &:hover { - background-color: var(--background-modifier-hover); - } +.infio-chat-code-block.has-filename .infio-chat-code-block-header-button button:hover { + background-color: var(--background-modifier-hover); } .infio-chat-code-block-header-button button { @@ -1149,12 +1126,36 @@ input[type='text'].infio-chat-list-dropdown-item-title-input { font-size: var(--font-ui-smaller); } +/* 代码块内容样式 */ +.infio-chat-code-block-content { + margin: 0; +} + +/* 特殊按钮样式 */ .infio-dataview-query-button { color: #008000; } -.infio-chat-code-block-content { - margin: 0; +/* =========================================== + 推理内容包装器样式 + =========================================== */ + +.infio-reasoning-content-wrapper { + overflow-x: auto; + overflow-y: visible; +} + +/* 折叠/展开功能相关样式 */ +.infio-reasoning-content-wrapper.collapsed { + max-height: 150px; + overflow-y: auto; + transition: max-height 0.3s ease-in-out; +} + +.infio-reasoning-content-wrapper.expanded { + max-height: none; + overflow-y: visible; + transition: max-height 0.3s ease-in-out; } /* Read File Block - Minimal styling for better integration */ @@ -1556,7 +1557,7 @@ input[type='text'].infio-chat-list-dropdown-item-title-input { .infio-search-lexical-content-editable-root { min-height: 36px; - max-height: 500px; + max-height: 120px; overflow-y: auto; overflow-x: hidden; /* 确保编辑器不会影响外部滚动 */ @@ -2997,10 +2998,8 @@ button.infio-chat-input-model-select { } .infio-commands-header-title { - color: var(--text-normal); - font-size: 28px; - font-weight: 500; - margin: 0 0 var(--size-4-3) 0; + margin: 0; + font-size: 24px; } .infio-commands-label { @@ -3656,18 +3655,18 @@ button.infio-chat-input-model-select { .infio-markdown-actions { position: absolute; - top: 8px; - right: 8px; + bottom: 1px; + right: 1px; display: flex; gap: 4px; - opacity: 0; - visibility: hidden; - transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out; + opacity: 0.7; + visibility: visible; padding: 0px; - z-index: 50; /* 降低z-index,确保不会遮挡代码块 */ + z-index: 10; /* 降低z-index,确保不会遮挡代码块 */ /* 确保不会遮挡代码块 */ pointer-events: none; } + .infio-markdown-actions button { display: flex; align-items: center; @@ -3678,19 +3677,19 @@ button.infio-chat-input-model-select { background-color: transparent; border-color: transparent; box-shadow: none; - color: var(--text-faint); + color: var(--text-muted); + border-radius: var(--radius-s); cursor: pointer; /* 恢复按钮的点击事件 */ pointer-events: auto; &:hover { - background-color: var(--background-modifier-hover); + background-color: var(--interactive-accent-hover); } } - .infio-chat-message-actions-icon--copied { - color: var(--text-muted); - } +.infio-chat-message-actions-icon--copied { + color: var(--text-muted); } .infio-markdown-container-with-actions:hover .infio-markdown-actions { @@ -3958,3 +3957,136 @@ button.infio-chat-input-model-select { transform: translateY(0); } } + +/* Structured Progress Styles */ +.infio-structured-progress { + padding: 16px; + background-color: var(--background-secondary); + border: 1px solid var(--background-modifier-border); + border-radius: var(--radius-m); + margin: 12px 0; +} + +.infio-progress-steps { + display: flex; + flex-direction: column; + gap: 0; +} + +.infio-progress-step { + display: flex; + align-items: flex-start; + position: relative; + min-height: 60px; +} + +.infio-progress-step-indicator { + display: flex; + flex-direction: column; + align-items: center; + margin-right: 16px; + position: relative; + flex-shrink: 0; +} + +.infio-progress-step-icon { + width: 24px; + height: 24px; + display: flex; + align-items: center; + justify-content: center; + font-size: 16px; + z-index: 2; + position: relative; +} + +.infio-progress-step-line { + width: 2px; + height: 40px; + background-color: var(--background-modifier-border); + margin-top: 8px; +} + +.infio-progress-step-line.completed { + background-color: var(--color-green, #28a745); +} + +.infio-progress-step-content { + flex: 1; + min-width: 0; + padding-top: 4px; +} + +.infio-progress-step-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 4px; +} + +.infio-progress-step-title { + font-size: var(--font-ui-medium); + font-weight: 600; + color: var(--text-normal); + margin: 0; + line-height: 1.3; +} + +.infio-progress-step.running .infio-progress-step-title { + color: var(--interactive-accent); +} + +.infio-progress-step-counter { + font-size: var(--font-ui-small); + color: var(--text-muted); + font-family: var(--font-monospace); + background-color: var(--background-modifier-border); + padding: 2px 6px; + border-radius: var(--radius-s); +} + +.infio-progress-step-description { + font-size: var(--font-ui-small); + color: var(--text-muted); + margin: 4px 0 0 0; + line-height: 1.4; +} + +.infio-progress-step-details { + font-size: var(--font-ui-smaller); + color: var(--text-faint); + margin: 2px 0 0 0; + line-height: 1.3; + font-family: var(--font-monospace); +} + +.infio-progress-step-bar { + width: 100%; + height: 4px; + background-color: var(--background-modifier-border); + border-radius: 2px; + margin-top: 8px; + overflow: hidden; +} + +.infio-progress-step-bar-fill { + height: 100%; + background-color: var(--interactive-accent); + border-radius: 2px; + transition: width 0.3s ease; +} + +/* Tool result content display */ +.infio-tool-result-content { + font-family: var(--font-monospace); + font-size: 13px; + line-height: 1.5; + margin: 0; + padding: 12px; + background-color: var(--background-primary); + border: 1px solid var(--background-modifier-border); + border-radius: var(--radius-s); + white-space: pre-wrap; + word-break: break-word; + overflow: auto; +}