From 8156093e627f1691a67b53a24d79155a0e366bf0 Mon Sep 17 00:00:00 2001 From: Minor Date: Sun, 12 Jul 2026 05:54:47 +0000 Subject: [PATCH] fix: highlight the interface mode toggle --- README.md | 16 +++++++++------- docker-compose.yml | 2 +- pyproject.toml | 2 +- scripts/docker-build-push.sh | 2 +- static/app.js | 4 ++-- static/index.html | 6 +++--- static/styles.css | 21 +++++++++++++++++++++ tests/test_static_assets.py | 35 +++++++++++++++++++++++++++++++++-- uv.lock | 2 +- 9 files changed, 72 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1ce19a9..d6d1ff2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PicGen Console -一个面向 OpenAI 兼容图像生成 / 编辑接口的本地工作台,当前版本 **0.1.64**。它把 +一个面向 OpenAI 兼容图像生成 / 编辑接口的本地工作台,当前版本 **0.1.65**。它把 `/v1/images/generations`、`/v1/images/edits` 与 `/v1/responses`(含 `image_generation` 工具) 包装成统一可观测的代理,前端是一套零依赖的 Web 控制台。 @@ -14,7 +14,9 @@ ![PicGen Console 主程序界面](demo1.png) -## 0.1.64 主要特性 +## 0.1.65 主要特性 + +- **模式切换更醒目**:简洁模式和专业模式的切换按钮使用主绿色与白色图文,在桌面和移动端都更容易识别。 - **避免重采样后的 LOGO 重复叠加**:已有官方 LOGO 即使被上游缩放并产生少量像素位移,也会在严格颜色阈值下识别并保留,不再另贴第二枚 LOGO。 @@ -127,10 +129,10 @@ PICGEN_LOG_FORMAT=json \ ### Docker ```bash -docker build -t minorli/picgen:0.1.64 . +docker build -t minorli/picgen:0.1.65 . docker run --rm -p 8000:8000 \ -v picgen-data:/app/data \ - minorli/picgen:0.1.64 + minorli/picgen:0.1.65 ``` 或: @@ -145,10 +147,10 @@ docker compose up -d ./scripts/docker-build-push.sh ``` -默认会构建并推送 `minorli/picgen:0.1.64`。也可以覆盖: +默认会构建并推送 `minorli/picgen:0.1.65`。也可以覆盖: ```bash -IMAGE=minorli/picgen VERSION=0.1.64 PLATFORM=linux/amd64 ./scripts/docker-build-push.sh +IMAGE=minorli/picgen VERSION=0.1.65 PLATFORM=linux/amd64 ./scripts/docker-build-push.sh ``` 镜像不会包含 `.env`、本地用户库或历史图片。容器内置 `HEALTHCHECK` 探测 `/api/health`,以非 root @@ -261,7 +263,7 @@ Bug 反馈和找回密码申请会先写入本地认证库,再优先发送到 ## 图像通道 -PicGen 0.1.64 把四类图像操作统一提交给 `/api/image-jobs`,实际通道由服务端决定: +PicGen 0.1.65 把四类图像操作统一提交给 `/api/image-jobs`,实际通道由服务端决定: | 用户操作 | 默认接口 | 默认模型 | | --- | --- | --- | diff --git a/docker-compose.yml b/docker-compose.yml index 84220c7..af77395 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: picgen: - image: minorli/picgen:0.1.64 + image: minorli/picgen:0.1.65 build: context: . ports: diff --git a/pyproject.toml b/pyproject.toml index 4563e53..5ee1ab0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "picgen" -version = "0.1.64" +version = "0.1.65" description = "Enterprise-grade local web console for OpenAI-compatible image generation and editing APIs." readme = "README.md" requires-python = ">=3.12" diff --git a/scripts/docker-build-push.sh b/scripts/docker-build-push.sh index eab2ed1..9903e13 100755 --- a/scripts/docker-build-push.sh +++ b/scripts/docker-build-push.sh @@ -2,7 +2,7 @@ set -euo pipefail IMAGE="${IMAGE:-minorli/picgen}" -VERSION="${VERSION:-0.1.64}" +VERSION="${VERSION:-0.1.65}" PLATFORM="${PLATFORM:-linux/amd64}" docker buildx build \ diff --git a/static/app.js b/static/app.js index e07ce14..d3ce203 100644 --- a/static/app.js +++ b/static/app.js @@ -2,14 +2,14 @@ import { calculateLogoPlacementScore, calculateOfficialLogoPixelMatch, chooseLogoPlacement, -} from "./logo-placement.mjs?v=0.1.64" +} from "./logo-placement.mjs?v=0.1.65" import { DEFAULT_RESPONSES_MODEL, RESPONSES_MODEL_STORAGE_VERSION, RESPONSES_REASONING_STORAGE_VERSION, migrateStoredResponsesReasoningSettings, migrateStoredResponsesSettings, -} from "./responses-settings.mjs?v=0.1.64" +} from "./responses-settings.mjs?v=0.1.65" const RESPONSES_REASONING_EFFORTS = new Set(["low", "medium", "high", "xhigh", "max", "ultra"]) const DEFAULT_RESPONSES_REASONING_EFFORT = "xhigh" diff --git a/static/index.html b/static/index.html index 750488a..df76261 100644 --- a/static/index.html +++ b/static/index.html @@ -5,7 +5,7 @@ PicGen Console - +
@@ -1061,7 +1061,7 @@

管理员高级设置

@@ -1371,6 +1371,6 @@

图片预览

- + diff --git a/static/styles.css b/static/styles.css index 066300a..8c43252 100644 --- a/static/styles.css +++ b/static/styles.css @@ -4345,9 +4345,30 @@ button:disabled { top: 50%; right: calc(100% + var(--ux-space-2)); flex: 0 0 auto; + border-color: var(--ux-primary-8); + background: var(--ux-primary-8); + color: var(--ux-color-white); + font-weight: var(--ux-font-weight-semibold); + box-shadow: var(--ux-shadow-1); transform: translateY(-50%); } +.ux-button-secondary.ui-mode-toggle:hover:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):not(.is-loading) { + border-color: var(--ux-primary-7); + background: var(--ux-primary-7); + color: var(--ux-color-white); +} + +.ux-button-secondary.ui-mode-toggle:active:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):not(.is-loading) { + border-color: var(--ux-primary-9); + background: var(--ux-primary-9); + color: var(--ux-color-white); +} + +.ux-button-secondary.ui-mode-toggle:focus-visible { + box-shadow: var(--ux-focus-ring-primary); +} + body.ui-simple-mode { color: var(--ux-text-1); font-family: var(--ux-font-family); diff --git a/tests/test_static_assets.py b/tests/test_static_assets.py index 81468eb..cb201a9 100644 --- a/tests/test_static_assets.py +++ b/tests/test_static_assets.py @@ -13,7 +13,7 @@ def test_legacy_responses_model_storage_is_migrated_once() -> None: settings_js = (ROOT_DIR / "static" / "responses-settings.mjs").read_text(encoding="utf-8") assert 'const DEPRECATED_RESPONSES_MODELS = new Set(["gpt-5.4"])' in app_js - assert 'from "./responses-settings.mjs?v=0.1.64"' in app_js + assert 'from "./responses-settings.mjs?v=0.1.65"' in app_js assert 'const LEGACY_DEFAULT_RESPONSES_MODEL = "gpt-5.5"' in settings_js assert "const RESPONSES_MODEL_STORAGE_VERSION = 4" in settings_js assert "function migrateStoredResponsesSettings" in settings_js @@ -38,7 +38,7 @@ def test_logo_overlay_uses_uploaded_asset_without_ai_guidance() -> None: assert 'const COMPANY_LOGO_URL = "6renyou.png"' in app_js assert "composeLogoOverlayForCandidates" in app_js assert "createOfficialLogoCanvas" in app_js - assert 'from "./logo-placement.mjs?v=0.1.64"' in app_js + assert 'from "./logo-placement.mjs?v=0.1.65"' in app_js assert "chooseLogoPlacement" in app_js assert "calculateLogoPlacementScore" in app_js assert "calculateOfficialLogoPixelMatch" in app_js @@ -1840,6 +1840,37 @@ def test_simple_itinerary_template_headers_are_not_parsed_as_route_stops() -> No assert all(stop["name"] != "9/12" for stop in stops) +def test_ui_mode_toggle_uses_the_primary_accent_palette() -> None: + styles_css = (ROOT_DIR / "static" / "styles.css").read_text(encoding="utf-8") + + def declarations(selector: str) -> str: + start = styles_css.index(f"{selector} {{") + return styles_css[start : styles_css.index("\n}", start)] + + base = declarations(".ui-mode-toggle") + assert "border-color: var(--ux-primary-8);" in base + assert "background: var(--ux-primary-8);" in base + assert "color: var(--ux-color-white);" in base + assert "font-weight: var(--ux-font-weight-semibold);" in base + + hover = declarations( + '.ux-button-secondary.ui-mode-toggle:hover:not(:disabled):not([aria-disabled="true"])' + ':not([aria-busy="true"]):not(.is-loading)' + ) + assert "background: var(--ux-primary-7);" in hover + assert "color: var(--ux-color-white);" in hover + + active = declarations( + '.ux-button-secondary.ui-mode-toggle:active:not(:disabled):not([aria-disabled="true"])' + ':not([aria-busy="true"]):not(.is-loading)' + ) + assert "background: var(--ux-primary-9);" in active + assert "color: var(--ux-color-white);" in active + + focus = declarations(".ux-button-secondary.ui-mode-toggle:focus-visible") + assert "box-shadow: var(--ux-focus-ring-primary);" in focus + + def test_simple_mode_dom_and_existing_submit_path_contract() -> None: app_js = (ROOT_DIR / "static" / "app.js").read_text(encoding="utf-8") index_html = (ROOT_DIR / "static" / "index.html").read_text(encoding="utf-8") diff --git a/uv.lock b/uv.lock index 69e64ea..22eb31f 100644 --- a/uv.lock +++ b/uv.lock @@ -340,7 +340,7 @@ wheels = [ [[package]] name = "picgen" -version = "0.1.64" +version = "0.1.65" source = { editable = "." } dependencies = [ { name = "anyio" },