```
feat(AI): 统一多模态模型架构,整合文本和视觉推理路径 - 将文本生成和VL(图→文)功能合并到单一的Qwen3.5-4B多模态MNN模型 - 移除独立的Qwen3-VL-4B模型依赖,MLX VL改为使用.llm的多模态模型 - 更新ModelKind枚举,新增userFacing集合用于面向用户展示 - MNN后端现在同时支持文本和视觉任务,模拟器回退到MLX refactor(models): 模型管理和界面调整以适应新的多模态架构 - 更新模型管理界面,只显示统一的Qwen3.5-4B(MNN)模型给用户 - 修改就绪状态检查逻辑,使用ModelKind.userFacing替代allCases - 更新模型文件清单,从Qwen3.5-2B升级到Qwen3.5-4B-4bit - 调整模型管理页面UI,突出MNN+SME2端侧加速功能 feat(camera): 添加拍照识别引擎切换功能 - 实现双路径拍照识别:Apple Vision OCR + 文本模型 和 Qwen3-VL直接识别 - 添加预处理逻辑,优化Qwen3-VL对窄长区域图片的识别效果 - 在模型管理页面添加拍照识别引擎选择组件 - 提供用户界面选项,在两种识别方式间切换 style(ui): 优化输入框样式和颜色主题一致性 - 为指标快速表单添加浅色主题偏好 - 统一所有文本输入框的颜色样式(theme) - 创建EntryInputField组件,替换原有的单行输入+按钮模式 - 实现聊天框风格的条目输入,支持多行自适应和圆形发送按钮 fix(build): 修正Xcode项目配置中的重复框架搜索路径 - 清理project.pbxproj中重复的FRAMEWORK_SEARCH_PATHS配置 - 重新排列Swift桥接头文件配置确保正确引用 - 修复因路径配置重复导致的编译警告问题 test: 增加区域图片预处理和模型清单测试覆盖 - 添加RegionImageCropper.prepareForQwenVL的单元测试 - 验证宽而矮图片的放大和填充逻辑 - 更新ModelManifestTests中的字节数预期值以匹配新模型 - 修正OCRService中VNRecognizedTextObservation类型的处理 ```
This commit is contained in:
@@ -370,17 +370,14 @@ private struct ChronicSection: View {
|
||||
}
|
||||
}
|
||||
|
||||
HStack {
|
||||
TextField("自定义慢病", text: $newCustomCondition)
|
||||
Button("加") {
|
||||
let trimmed = newCustomCondition.trimmingCharacters(in: .whitespaces)
|
||||
guard !trimmed.isEmpty,
|
||||
!profile.chronicConditions.contains(trimmed) else { return }
|
||||
profile.chronicConditions.append(trimmed)
|
||||
newCustomCondition = ""
|
||||
}
|
||||
.disabled(newCustomCondition.trimmingCharacters(in: .whitespaces).isEmpty)
|
||||
EntryInputField(placeholder: String(appLoc: "自定义慢病"), text: $newCustomCondition) {
|
||||
let trimmed = newCustomCondition.trimmingCharacters(in: .whitespaces)
|
||||
guard !trimmed.isEmpty,
|
||||
!profile.chronicConditions.contains(trimmed) else { return }
|
||||
profile.chronicConditions.append(trimmed)
|
||||
newCustomCondition = ""
|
||||
}
|
||||
.listRowBackground(Color.clear)
|
||||
} header: {
|
||||
Text("慢病(影响参考范围与 AI 解读)")
|
||||
}
|
||||
@@ -408,6 +405,48 @@ private struct ChronicSection: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - 聊天框风格的条目输入(圆角容器 + 多行增长 + 圆形发送按钮)
|
||||
|
||||
/// 替代原先单行 `TextField + “加”` 的搜索框观感:文字随内容换行增长(1~4 行),
|
||||
/// 右侧圆形发送按钮(内容为空时禁用变灰)。过敏 / 家族史 / 用药 / 自定义慢病共用。
|
||||
private struct EntryInputField: View {
|
||||
let placeholder: String
|
||||
@Binding var text: String
|
||||
var onSubmit: () -> Void
|
||||
|
||||
private var canSubmit: Bool {
|
||||
!text.trimmingCharacters(in: .whitespaces).isEmpty
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .bottom, spacing: 8) {
|
||||
TextField(placeholder, text: $text, axis: .vertical)
|
||||
.lineLimit(1...4)
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.vertical, 10)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: Tj.Radius.md, style: .continuous)
|
||||
.fill(Tj.Palette.paper)
|
||||
)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: Tj.Radius.md, style: .continuous)
|
||||
.strokeBorder(Tj.Palette.line, lineWidth: 1)
|
||||
)
|
||||
|
||||
Button {
|
||||
if canSubmit { onSubmit() }
|
||||
} label: {
|
||||
Image(systemName: "arrow.up.circle.fill")
|
||||
.font(.tjScaled(28))
|
||||
.foregroundStyle(canSubmit ? Tj.Palette.ink : Tj.Palette.text3)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.disabled(!canSubmit)
|
||||
}
|
||||
.padding(.vertical, 2)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - 过敏 / 家族史 / 用药(每节自带 @State,敲字只重算本节)
|
||||
|
||||
private struct StringListSection: View {
|
||||
@@ -431,16 +470,13 @@ private struct StringListSection: View {
|
||||
.buttonStyle(.borderless)
|
||||
}
|
||||
}
|
||||
HStack {
|
||||
TextField(placeholder, text: $newInput)
|
||||
Button("加") {
|
||||
let trimmed = newInput.trimmingCharacters(in: .whitespaces)
|
||||
guard !trimmed.isEmpty, !items.contains(trimmed) else { return }
|
||||
items.append(trimmed)
|
||||
newInput = ""
|
||||
}
|
||||
.disabled(newInput.trimmingCharacters(in: .whitespaces).isEmpty)
|
||||
EntryInputField(placeholder: placeholder, text: $newInput) {
|
||||
let trimmed = newInput.trimmingCharacters(in: .whitespaces)
|
||||
guard !trimmed.isEmpty, !items.contains(trimmed) else { return }
|
||||
items.append(trimmed)
|
||||
newInput = ""
|
||||
}
|
||||
.listRowBackground(Color.clear)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user