This repository was archived by the owner on Sep 20, 2026. It is now read-only.
feat(collection): copy template IDs in staging - #216
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a staging-only Collection panel helper that lets testers copy the hovered card’s stable template GUID via Ctrl+C, including UI hint/feedback and regression coverage to ensure it never activates on Online/PTR builds.
Changes:
- Introduce a
-stagingraw-version gate (CollectionStagingTools) and wire it intoCollectionPanelinitialization. - Add
Ctrl+Chandling to copy the currently hoveredCollectionCardVm.Idto the system clipboard, with a short-lived UI confirmation message. - Extend
CollectionGridLayout.Teststo validate the staging/Online/PTR gating behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/CollectionGridLayout.Tests/Program.cs | Adds assertions covering staging vs Online/PTR enablement behavior. |
| tests/CollectionGridLayout.Tests/CollectionGridLayout.Tests.csproj | Links CollectionStagingTools.cs into the test project for gating tests. |
| src/BazaarPlusPlus/Game/CollectionPanel/Ui/CollectionPanelView.Tree.cs | Conditionally adds the staging hint/feedback label to the operation rail. |
| src/BazaarPlusPlus/Game/CollectionPanel/Ui/CollectionPanelView.cs | Stores staging flag state, implements “copied” feedback with scheduled reset, and threads the flag through the constructor. |
| src/BazaarPlusPlus/Game/CollectionPanel/Grid/CollectionGridVirtualizer.cs | Exposes the currently hovered card VM via TryGetHoveredCard. |
| src/BazaarPlusPlus/Game/CollectionPanel/CollectionStagingTools.cs | Implements raw-version -staging detection helper. |
| src/BazaarPlusPlus/Game/CollectionPanel/CollectionPanel.cs | Computes staging gate once, polls Ctrl+C to copy hovered template GUID to clipboard, and triggers view feedback. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+478
to
+483
| var keyboard = Keyboard.current; | ||
| if ( | ||
| keyboard?.cKey.wasPressedThisFrame != true | ||
| || (keyboard.leftCtrlKey.isPressed || keyboard.rightCtrlKey.isPressed) != true | ||
| ) | ||
| return; |
Collaborator
|
狠狠点赞! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Context
staging 验收时经常需要从 Collection 快速拿到稳定的 template ID,用于查数据、复现问题或配置测试。这个工具最初随录制 PR 209 的本地验收改动出现,但与战斗录制无关,因此从最新
master拆成独立 PR。改动重点
-staging时启用;Online 与 PTR 不展示也不响应。Ctrl+C,复制该卡牌的 GUID template ID。Ctrl+C。协作过程
sequenceDiagram participant U as staging 验收者 participant C as Collection participant B as 剪贴板 U->>C: 悬停卡牌并按 Ctrl+C C->>C: 校验 staging、输入焦点和悬停卡牌 C->>B: 写入 template GUID C-->>U: 显示复制成功反馈方案讨论
环境判断直接使用原始版本字符串中的
-staging标记,而不复用当前会合并渠道语义的 build channel,避免工具误入 Online 或 PTR。交互复用 Collection 已有的悬停状态,不增加每张卡牌的常驻按钮和布局负担。最终方案
Collection 初始化时计算一次 staging 门禁;每帧完成悬停更新后,仅在门禁开启、无文本输入焦点且检测到
Ctrl+C时,将当前悬停卡牌的 template GUID 写入系统剪贴板。非 staging 环境不创建提示 UI,也不执行复制逻辑。验证情况
CollectionGridLayout.Tests:通过。Architecture.Tests:153/153 通过。git diff --check:通过。已知局限 / 后续工作