An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Fix unit text wrapping in mobile settings https://github.com/siyuan-note/siyuan/issues/19302
Daniel07566f432f67
diff --git a/app/src/assets/scss/util/_responsive.scss b/app/src/assets/scss/util/_responsive.scssindex f17fc190b4..e95c70c09f 100644--- a/app/src/assets/scss/util/_responsive.scss+++ b/app/src/assets/scss/util/_responsive.scss@@ -94,6 +94,19 @@}}+ // 输入框和单位保持同行,单位前的间距不被隐藏+ &-item > .config-item__number {+ flex-wrap: nowrap;++ & > .b3-text-field.fn__flex-1 {+ margin-top: 0;+ }++ & > .fn__space {+ display: inline-block;+ }+ }+&-range {.config-range__desktop {display: none;diff --git a/app/src/config/render/render.test.ts b/app/src/config/render/render.test.tsindex 09b9f1790d..24d2777236 100644--- a/app/src/config/render/render.test.ts+++ b/app/src/config/render/render.test.ts@@ -1,6 +1,22 @@import * as assert from "node:assert/strict";import {describe, it} from "node:test";-import {genStackHtml} from "./render";+import {genNumberInputHtml, genStackHtml} from "./render";++describe("genNumberInputHtml", () => {+ it("keeps the unit next to the input inside the number wrapper", () => {+ const html = genNumberInputHtml("timeout", 30, 0, 100, undefined, "s");++ assert.match(html, /class="fn__size200 fn__flex-center fn__flex config-item__number"/);+ assert.match(html, /<span class="ft__on-surface fn__flex-center">s<\/span>/);+ });++ it("renders a standalone input when there is no unit", () => {+ const html = genNumberInputHtml("timeout", 30);++ assert.match(html, /class="b3-text-field fn__flex-center fn__size200"/);+ assert.doesNotMatch(html, /config-item__number/);+ });+});describe("genStackHtml", () => {it("renders descriptions with controls using the primary text color", () => {diff --git a/app/src/config/render/render.ts b/app/src/config/render/render.tsindex 3e719fe334..89c94a4e8b 100644--- a/app/src/config/render/render.ts+++ b/app/src/config/render/render.ts@@ -24,7 +24,7 @@ export const genNumberInputHtml = (const fieldClass = unit ? "fn__flex-1" : "fn__flex-center fn__size200";const input = `<input class="b3-text-field ${fieldClass}" id="${id}" type="number" min="${min ?? ""}" max="${max ?? ""}" step="${step ?? ""}" value="${value}"/>`;if (unit) {- return `<div class="fn__size200 fn__flex-center fn__flex">${input}<span class="fn__space"></span><span class="ft__on-surface fn__flex-center">${unit}</span></div>`;+ return `<div class="fn__size200 fn__flex-center fn__flex config-item__number">${input}<span class="fn__space"></span><span class="ft__on-surface fn__flex-center">${unit}</span></div>`;}return input;};