fix(frontend): raise dark contrast, expand hit areas, and surface input limits
Independent Staging Quality Gate / validate (push) Successful in 9m19s
Independent Staging Quality Gate / publish (push) Successful in 9m54s

Dark muted surfaces missed WCAG AA; action and tertiary tokens plus a 32-pair contract close that. Hit targets, remaining-count, and Enter-to-send follow the interaction audit without changing visual sizes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-30 11:19:00 +08:00
parent b43808b016
commit e8fa1ce4ea
20 changed files with 555 additions and 40 deletions
+17
View File
@@ -0,0 +1,17 @@
/** Show the remaining-count hint when this many characters (or fewer) are left. */
export function remainingThreshold(maxLength: number): number {
return Math.max(8, Math.min(50, Math.round(maxLength / 10)));
}
export function characterRemainingVisible(length: number, maxLength: number): boolean {
return maxLength - length <= remainingThreshold(maxLength);
}
export function characterRemainingLabel(remaining: number, maxLength: number): string {
return remaining <= 0 ? `已达 ${maxLength} 字上限` : `还剩 ${remaining}`;
}
/** Stable live text: one announcement on entering the threshold, one at the cap. */
export function characterRemainingAnnouncement(remaining: number, maxLength: number): string {
return remaining <= 0 ? `已达 ${maxLength} 字上限` : "接近字数上限";
}