feat(record): NSFW filter & export report - #666
Open
fishyy119 wants to merge 4 commits into
Open
Conversation
fishyy119
marked this pull request as draft
August 1, 2026 16:18
There was a problem hiding this comment.
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
contextobject 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.
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
force-pushed
the
feat/record-export-filter
branch
from
August 2, 2026 18:15
6af5b11 to
412b658
Compare
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
force-pushed
the
feat/record-export-filter
branch
from
August 9, 2026 16:05
3fc26b2 to
d1998d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
支持记录页面响应NSFW过滤器
扩展NSFW过滤器的作用范围到记录页面,同时优化了标题栏中关于过滤器按钮的展示:现在游戏库页面显示全部的三个过滤器按钮,记录页面只展示NSFW过滤器按钮,其他页面不再展示过滤器按钮。
Resolve #664
支持导出JSON格式的游玩时长报告
Resolve #663
重构报告导出功能,将图片导出替换为HTML导出
移除了原先的主进程
skia-canvas海报渲染链路,改用 React 静态模板生成离线 HTML,以降低布局代码编写难度并提升导出效果。引入了
subset-font以支持在创建自包含 HTML 时生成字体子集,同时将子图文件移入共享的resources/fonts目录以便主进程能够访问所需的字体文件。