5e484d0e74043b156de9796ac8b3b85ed34a5004
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1fc34f1bcd |
fix(miniapp): 修复导航页与微信胶囊重合,并把首页两个栏目卡缩到 1/3
问题 1:五个导航页顶部与右上角胶囊按钮(··· ⊙)重合 - 根因:自定义导航用 env(safe-area-inset-top) 取的是设备物理安全区, 在 Android 上常为 0,完全不反映胶囊位置;且右对齐元素从未为胶囊让出宽度。 - 新增 miniapp/utils/nav-metrics.js 作为唯一事实源:以 wx.getMenuButtonBoundingClientRect() 实测胶囊矩形,反推并导出四个 CSS 变量 --nav-status / --nav-h / --nav-right / --nav-top,并提供无接口时的兜底值。 - nav-bar 组件改为自行获取导航度量(attached + observer 双触发), 标题按胶囊垂直居中并收窄 max-width;外部传参降级为兜底。 - index / discover / messages / activity / mine 五页根结点注入同一组变量, WXSS 里的 env(safe-area-inset-top)、硬编码 88rpx 与右对齐 right:0 全量替换。 问题 2:首页「善缘公益服务」「善缘安全提醒」两个栏目过宽 - 根因:封面 <image> 只声明 width 未声明 height,小程序默认按 240px 计算, 实际把卡片撑到约 480rpx 高。 - 按「整体等比缩到 1/3」重构:两栏改为 mini-card 小卡,宽度 calc((100% - 2*gap)/3)、高度写死 168rpx,封面 height:100%; 公益服务一行三卡横向排布,安全提醒为「标题小卡 + 右侧文案条」, 长文案收进详情页,安全提示原文保留。 守卫与验证 - 新增 ui-tests/miniapp-capsule-safe-contracts.mjs: A 层多机型断言导航行与胶囊垂直居中、右对齐让位、navTop 与兜底值; B 层纯函数审计五个自带导航行页面(页面清单由文件系统推导,失配直接报红); C 层断言首页小卡宽为 1/3 且显式声明高度,并钉住旧 service-/safety- 选择器回归。 审计前剥离注释,避免守卫被自身示例文本误伤。 - 新增 scripts/audit-image-height.mjs:按属性名精确比对,审计全仓 「有 width 无 height」的 <image>,当前 30 个类 0 命中。 - 负向注入 N1~N7(含 nav-safe 未接入、旧选择器回归、极小屏幕、无胶囊兜底等) 全部被守卫咬住并 exit 1,还原后复跑通过。 - 真编译(wcc/wcsc):WXSS 88 / WXML 86,失败 0; tsc --noEmit 通过;UI 契约门控 21/21 PASS(新增第 21 个守卫并抬高 MIN_GUARDS)。 - 渲染探针实测:单卡 213rpx x 168rpx;五页右对齐元素右缘 423~528px, 均在胶囊右缘 365px 之外。 未纳入本次提交:miniapp/project.config.json(微信开发者工具自动改写, 仅追加若干布尔开关并删掉文件末换行)与生成的预览页 artifacts preview.html (约 7900 行生成产物),以免淹没代码评审视线。 |
||
|
|
755a570849 |
fix(activity): close Phase 14 KEEP-VERIFY/EXTEND — 11 backend + 3 frontend-contract + 2 test-fidelity defects
Phase 14 (multi-type public-welfare activities) verification closure. Backend (D1-D11): - D1 CRITICAL: ActivityMapper.countRemainingCapacity had no @Select and no XML -> activity detail / register / approve all threw Invalid bound statement. Removed the shell; unified on ActivityRegistrationMapper. - D2 CRITICAL: register & approve were read-then-write -> oversold under concurrency. Replaced with single atomic SQL (insertIfCapacityAvailable / approveIfCapacityAvailable, affectedRows==0 => full). - D3 HIGH: activityType / orgRole never validated against production chk_activity_type / chk_org_role -> 500 only on PostgreSQL. - D4 HIGH: ActivityListItemDTO had no activityType -> miniapp category tabs always empty (Gate failure). - D5: male/female counts were fabricated as approvedCount/2; now real aggregation over user_profiles.gender. - D6: minAge/maxAge was a TODO no-op; added assertAgeInRange. - D7: registration_policy write-only; per-type eligibility now enforced (identity / local eligibility / gender quota). - D8: POST /operator/activities dropped type, multi-org and capacity groups and set organizer_org_id to the operator user id; now delegates to createActivityFromAdmin (single implementation). - D9: three operator write endpoints were mounted on the user-side ActivityController (dual implementation, zero callers) -> moved. - D10: NPE on soft-deleted activity in getMyActivities; NPE/500 on missing admin form fields (Instant.parse(null)); tolerant time parsing added. - D11: DTO lacked registeredCount / status / coverFileId / description -> card always showed 0 registered, "view detail", no cover, no summary. Frontend contract (F1-F3): - F1: miniapp category code "classroom" is not in the production whitelist (should be relationship_education); three types had no tab at all. - F2: ui-activity-card read 7 fields that do not exist on the backend; now reads only real DTO fields, plus per-type badge and eligibility hint. - F3: admin-web had no activity management page at all; added ActivityManagementView.vue (type-driven dynamic form, multi-org, capacity groups, publish/cancel) + /activities route and nav entry. Test fidelity (T1-T2): - T1: deleted two assertTrue(true) placeholder tests (testNoOverbooking, testNoDuplicateRegistration) that covered the exact broken invariants. - T2: test schema lacked V023 columns/constraints and three tables; the activity tables were only in the OPTIONAL set (zero coverage) -> schema completed and moved to REQUIRED_IN_TEST_SCHEMA. Tests: ActivityPhase14Test (23 cases), ActivityConstraintGuardTest (9 cases, parses real db/migration/V*.sql plus miniapp source). Two negative-verification rounds proved both guard families actually turn red. Regression: 450 tests / 0 failures / 0 errors / 3 skipped / BUILD SUCCESS (baseline 420). admin-web vue-tsc 0 error, vite build OK. |
||
|
|
ce172ffd4f |
feat(ui): activity 页迁 TS + 修复过期契约 + 新增 11 页静态预览器
## 背景
2026-09-13 UI 重设计方案的 13 个契约门禁中 3 个为红,逐一查明性质后分类处理。
## 1. activity 页迁移 TypeScript(11/11 页现已全 TS)
- activity.js → activity.ts(139 行),业务逻辑零改动,仅补类型
- 此前 STATUS.md 记「9/11 TS-only、3 页待迁」,但 messages/matchmaker
已在
|