Skip to content

feat(record): NSFW filter & export report - #666

Open
fishyy119 wants to merge 4 commits into
ximu3:mainfrom
fishyy119:feat/record-export-filter
Open

feat(record): NSFW filter & export report#666
fishyy119 wants to merge 4 commits into
ximu3:mainfrom
fishyy119:feat/record-export-filter

Conversation

@fishyy119

@fishyy119 fishyy119 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

支持记录页面响应NSFW过滤器

扩展NSFW过滤器的作用范围到记录页面,同时优化了标题栏中关于过滤器按钮的展示:现在游戏库页面显示全部的三个过滤器按钮,记录页面只展示NSFW过滤器按钮,其他页面不再展示过滤器按钮。

Resolve #664

支持导出JSON格式的游玩时长报告

Resolve #663

重构报告导出功能,将图片导出替换为HTML导出

移除了原先的主进程 skia-canvas 海报渲染链路,改用 React 静态模板生成离线 HTML,以降低布局代码编写难度并提升导出效果。

引入了 subset-font 以支持在创建自包含 HTML 时生成字体子集,同时将子图文件移入共享的 resources/fonts 目录以便主进程能够访问所需的字体文件。

Copilot AI review requested due to automatic review settings August 1, 2026 16:17
@fishyy119
fishyy119 marked this pull request as draft August 1, 2026 16:18
@fishyy119 fishyy119 changed the title Feat/record export filter feat(record): NSFW filter & export report Aug 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the existing NSFW filtering behavior to the Record (reports) pages and makes poster generation respect the currently visible (NSFW-filtered) game set. It also adjusts the Titlebar filter UI so filter controls only appear where they apply (Library shows all filters; Record shows only NSFW; other pages show none).

Changes:

  • Introduce a shared NSFW filter predicate + hook (useNSFWFilteredGameIds) and apply it across Record report pages.
  • Thread a context object through the poster render IPC path so templates can optionally render against a filtered game set.
  • Refine Titlebar filter control visibility based on current route.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types/poster/poster.ts Add poster render context and extend template render signature to accept it.
src/renderer/src/utils/poster.ts Allow renderer-side poster invocation to pass render context via IPC.
src/renderer/src/stores/game/useVisibleGameIds.ts Centralize NSFW filter semantics and expose an NSFW-only filtered game-id hook.
src/renderer/src/stores/game/recordUtils.ts Allow record aggregation helpers to operate on an explicit subset of game IDs.
src/renderer/src/stores/game/gameUtils.ts Allow record summary helpers to operate on an explicit subset of game IDs.
src/renderer/src/pages/Record/YearlyReport.tsx Apply NSFW-filtered game IDs to yearly report aggregation.
src/renderer/src/pages/Record/WeeklyReport.tsx Apply NSFW-filtered game IDs to weekly report aggregation.
src/renderer/src/pages/Record/ScoreReport/main.tsx Apply NSFW-filtered game IDs to score report grouping.
src/renderer/src/pages/Record/RecordOverview.tsx Apply NSFW-filtered game IDs to record overview totals and rankings.
src/renderer/src/pages/Record/MonthlyReport.tsx Apply NSFW-filtered game IDs to monthly report aggregation.
src/renderer/src/pages/Record/GeneratePoster/main.tsx Pass filtered game IDs into poster render context.
src/renderer/src/components/Titlebar.tsx Show filter controls only on Library (all) and Record (NSFW-only) routes.
src/main/posters/utils/score.ts Support limiting score data to a provided included-game set.
src/main/posters/templates/scoreReport.ts Use included-game filtering and fail fast when no scored games remain.
src/main/posters/registry.ts Thread render context into template render calls.
src/main/posters/ipc.ts Accept and log poster render context; pass through to registrar.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/renderer/src/pages/Record/GeneratePoster/main.tsx Outdated
Comment thread src/types/poster/poster.ts Outdated
Make overview, weekly, monthly, yearly, and score reports aggregate only games allowed by the current NSFW filter while preserving the default behavior of reusable statistics helpers.

Pass filtered game IDs through poster rendering so score report exports match on-screen data, and reject exports when no scored games remain.
Local game and custom visibility filters only affect library content, while the NSFW filter applies to both library and record content. Displaying the same filter controls across unrelated routes can therefore expose ineffective actions and mislead users.

Keep the complete configured filter set on library routes, show only the enabled NSFW control on record routes, and hide filter controls entirely on unsupported routes.
@fishyy119
fishyy119 force-pushed the feat/record-export-filter branch from 6af5b11 to 412b658 Compare August 2, 2026 18:15
@fishyy119
fishyy119 marked this pull request as ready for review August 2, 2026 18:15
Extend report exports with grouped Poster and JSON presets while keeping shared output path and export controls. Render preset-specific settings and show an empty state for presets without configuration.

Add a JSON play time report containing local generation time, NSFW filter state, and game and collection durations in milliseconds, rounded minutes, and one-decimal hours. Preserve the user's custom collection order and sort games by play time.
- Replace the backend Skia Canvas pipeline with renderer-side React templates that generate self-contained, script-free HTML score reports.
- Add card and classic table variants, configurable themes and cover sizes, optional score badges.
- Introduce typed report export and font-subset IPC shared by HTML and JSON reports.
- Persist common and report-specific settings in config-local storage and reorganize each report under its own generator.
- Move LXGW WenKai Mono into shared packaged resources so the main process can access it to generate cached WOFF2 subsets
- Include the OFL license for LXGW WenKai Mono.
- Remove the legacy poster registry, Canvas engines, schema-driven configuration, Zustand persistence, poster types, and skia-canvas dependency.
- Rename the poster tab and presets around report export and update the related localized interface text.
@fishyy119
fishyy119 force-pushed the feat/record-export-filter branch from 3fc26b2 to d1998d4 Compare August 9, 2026 16:05
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.

[Feat]: 能否在游戏记录里也加一个nsfw开关 [Feat]: 老大,能做一个游戏时长统计的导出功能吗?

2 participants