Skip to content

eNotify × Vikunja 集成(前端):设置页「集成」页签 + 历史来源徽章 - #174

Merged
todosdev[bot] merged 3 commits into
mainfrom
tds/conv-01a1a962-ec65-795e-8211-ec660ad171fa
Nov 5, 2026
Merged

todosdev[bot] merged 3 commits into
mainfrom
tds/conv-01a1a962-ec65-795e-8211-ec660ad171fa

Conversation

@todosdev

@todosdev todosdev Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 设置页新增「集成」页签:按冻结的接口契约对接 Vikunja 集成管理(创建 / 一次性 secret / 启停 / 地址 / 轮换 / 删除),让用户把 Vikunja webhook 指向 eNotify 并管理已创建的集成。
  • 通知历史新增「Vikunja」来源徽章,区分经入站 webhook 触发的推送与手动/API/测试来源。
  • 页签增至 7 个后页签栏改为换行排版,并让下划线跟随激活页签(含跨行与语言切换)。

Changes

web/src/pages/settings/SettingsPage.tsx

  • 新增 IntegrationsTab(与同文件的 ApiKeysTab 同风格):
    • 未创建态:说明 + 「创建集成」。
    • 创建 / 轮换后:一次性展示 secret(复制、「只显示这一次,丢了只能轮换」、我已保存);明文仅存于组件状态,不落 localStorage、不打日志。
    • 已创建态:Webhook URL(window.location.origin + /api/integrations/vikunja/{hook_token})带复制、启用开关(components/ui/switch)、Vikunja 地址输入与保存、轮换 secret 与删除各走 components/ConfirmDialog、创建/更新时间。图标用 lucide。
  • 请求语义:开关只发 {enabled}、保存地址只发 {base_url},互不影响输入框里未保存的草稿;409(服务端已存在)与 404(已不存在)都有收敛路径,并回填 / 清空地址。
  • 地址校验:noValidate 让应用自己的本地化提示生效(不被浏览器原生气泡抢先),aria-invalid 与 aria-describedby 关联到错误或提示段落。
  • Vikunja 配置指引(仅在已创建时渲染):Target URL / Secret 的填法、事件只勾 task.reminder.fired 与 tasks.overdue、不要同时勾 task.overdue。
  • 页签栏:overflow-x-auto 改为 flex-wrap,下划线按激活页签所在行定位;ResizeObserver 观察页签栏与各页签,语言切换 / 窗口缩放后重新测量。

web/src/pages/history/HistoryPage.tsx

  • SOURCE_LABEL_KEYS 增加 vikunja: "history.sourceVikunja"(桌面表格、移动卡片与详情共用同一徽章组件)。

web/src/locales/zh.json / en.json

  • 新增 settings.integrations、integrations 命名空间(43 键,中英键集合一致)与 history.sourceVikunja;组件内无硬编码文案。

Testing

  • pnpm typecheck、pnpm build、pnpm test(23 files / 301 tests)、pnpm format:check、改动文件的 biome lint:全绿。
  • 浏览器手工核对(真实构建产物,71 项断言全过;1440×900 与 390×844,中英双语):创建 → 一次性 secret → 复制(含剪贴板读回校验)→ 启用/停用 → 地址保存与非法值拦截 → 轮换确认 → 删除确认 → 404 收敛 → 409 恢复后地址不被清空 → 历史页「Vikunja」徽章按行命中 → 移动端菜单入口与无横向溢出 → 7 个页签在各宽度/语言下全部可见、下划线跟随激活页签(含语言切换与窗口缩放)。
  • 联调说明:后端(fix(deps): update dependency react-i18next to v17 #12)为并行 PR、尚未合并,上述核对使用本地 mock /api;接口路径与请求/响应形状严格按冻结契约实现,未为迁就 mock 改动任何字段。后端合入后需用真接口复跑一次创建 / 开关 / 轮换 / 删除与历史徽章。

Todos added 3 commits November 5, 2026 09:58
Add an Integrations settings tab that drives the frozen /api/me/integrations/vikunja
contract (create, one-time secret, enable switch, base URL, rotate, delete) plus a
Vikunja source badge in notification history and zh/en copy. Keeps the active
settings tab scrolled into view now that seven tabs can overflow the tab bar.

Checkpoint: MTWnOZp_8OrAA18H-Ej4e
Send only `enabled` on toggle and only `base_url` on save, stop refreshes from
discarding an in-progress address edit, add noValidate plus aria wiring, give
copy and flash their own timers, render the Vikunja guide only once configured,
drop the unused locale key, and let the seven-tab bar wrap instead of scrolling
off-screen.

Checkpoint: 210UTe58QNf3crKvuc3UN
…b underline

Refresh with the address field after a 409 so a failed first load cannot wipe
the stored base_url, and replace the resize-only listener with a ResizeObserver
over the tab strip so a language switch (new widths, new row count) moves the
underline to the active tab's row.

Checkpoint: Ko45WoKPh-Xpk5MPwHj-n
@todosdev
todosdev Bot merged commit d53cd7b into main Nov 5, 2026
1 check passed
@mapxn
mapxn deleted the tds/conv-01a1a962-ec65-795e-8211-ec660ad171fa branch November 8, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants