同步草稿未读原生角标

平台壳按可见作品架未读完成草稿同步 app.setBadgeCount

新增草稿未读更新计数模型并覆盖多恢复ID去重

更新原生壳方案、HostBridge 协议和共享决策记录
This commit is contained in:
2026-06-18 07:18:42 +08:00
parent cdcbaf4cee
commit 20e4e88bd4
6 changed files with 170 additions and 30 deletions
@@ -14,6 +14,7 @@ import {
buildPuzzleResultProfileId,
buildPuzzleResultWorkId,
collectVisibleDraftNoticeKeys,
countUnreadDraftGenerationUpdates,
createPendingDraftShelfState,
type DraftGenerationNoticeMap,
getGenerationNoticeShelfKeys,
@@ -595,6 +596,63 @@ describe('platformDraftGenerationShelfModel', () => {
visibleKeys,
),
).toBe(false);
expect(
countUnreadDraftGenerationUpdates(
{
'puzzle:puzzle-work-ocean': {
status: 'ready',
seen: false,
},
'puzzle:puzzle-profile-ocean': {
status: 'ready',
seen: false,
},
'puzzle:puzzle-session-ocean': {
status: 'ready',
seen: false,
},
},
{
rpgItems: [],
bigFishItems: [],
jumpHopItems: [],
woodenFishItems: [],
match3dItems: [],
squareHoleItems: [],
puzzleItems: [puzzle],
visualNovelItems: [],
barkBattleItems: [],
babyObjectMatchItems: [],
},
),
).toBe(1);
expect(
countUnreadDraftGenerationUpdates(
{
'puzzle:puzzle-profile-ocean': {
status: 'failed',
seen: false,
},
'puzzle:puzzle-session-other': {
status: 'ready',
seen: false,
},
},
{
rpgItems: [],
bigFishItems: [],
jumpHopItems: [],
woodenFishItems: [],
match3dItems: [],
squareHoleItems: [],
puzzleItems: [puzzle],
visualNovelItems: [],
barkBattleItems: [],
babyObjectMatchItems: [],
},
),
).toBe(0);
});
});