删除发布面板冗余提示文案
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m58s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m52s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m47s
Project CI / Frontend tests (pull_request) Successful in 3m32s
Project CI / Backend tests (pull_request) Successful in 8m33s
Project CI / Repository checks (pull_request) Successful in 7m6s
Project CI / AI game creator shell web tests (pull_request) Failing after 3m42s
Project CI / Native shell tests (pull_request) Successful in 10m57s

- GameDistributionPublishPanel.tsx:删除「项目版本」下的说明段(projectVersionHint 派生逻辑与其 useMemo、以及渲染它的 hint span),面板不再写「发布将使用最新内部版本 v{N}…」「线上最近提交 vN 是平台侧事实…」
- GameDistributionPublishPanel.tsx:删除简介/分类的三态提示文案(「正在根据创作内容生成简介和分类…」/「AI 已根据创作内容生成…」/「已根据创作内容预填…」)及支撑它们的 metadataSuggestionPending、metadataSuggestionReady 两个 state 与请求完成后的置位,保留静默预填行为
- apps/ai-game-creator-shell/src/styles.css:删除随上述提示一起作废的样式(-7 行)
- tests/gameDistributionPublishPanel.test.tsx:同步删除对已废弃提示文案的断言(-15 行)
This commit is contained in:
2026-10-04 18:45:56 +08:00
parent ab1045f72d
commit 5a651f3eae
3 changed files with 7 additions and 72 deletions
@@ -247,9 +247,6 @@ export function GameDistributionPublishPanel({
const [previewScreenshot, setPreviewScreenshot] =
useState<PanelScreenshotEntry | null>(null);
const [uploadingLabel, setUploadingLabel] = useState('');
const [metadataSuggestionPending, setMetadataSuggestionPending] =
useState(false);
const [metadataSuggestionReady, setMetadataSuggestionReady] = useState(false);
const [coverConfirmOpen, setCoverConfirmOpen] = useState(false);
const [generatingCover, setGeneratingCover] = useState(false);
const [coverGenerationPrice, setCoverGenerationPrice] = useState<
@@ -282,25 +279,6 @@ export function GameDistributionPublishPanel({
() => resolveGameCreationAppProjectVersion(manifest),
[manifest],
);
/**
* 「项目版本」这一格的说明。
*
* 口径必须与取数一致:发布提交的标签是 `versions.length`(最新内部版本序数),
* **不读**任何"选中版本";资源画布上的选中/「当前版本」只影响「当前版本素材」与运行用哪版播放。
* 所以这里直说"发布用最新",并写明暂不能指定版本,不用「发布标签」去暗示用户可以挑卡。
*/
const projectVersionHint = useMemo(() => {
const internalCount = manifest.versions?.length ?? 0;
const label =
internalCount > 0
? `发布将使用最新内部版本 v${projectVersion}(标签 = 内部版本条数,暂不能指定其它版本);agent 再改进一次后,下一次是 v${projectVersion + 1}。`
: `这个项目还没有内部版本,本次发布按首版 v${projectVersion}。`;
const platform =
latestVersionNumber > 0
? `线上最近提交 v${latestVersionNumber} 是平台侧事实,与本标签互不推导。`
: '第一次发布即第一版。';
return `${label}${platform}`;
}, [latestVersionNumber, manifest.versions, projectVersion]);
const metadataSuggestionRequestRef = useRef(0);
const publicationRequestRef = useRef(0);
const publicationDraftAppliedRef = useRef(false);
@@ -331,8 +309,6 @@ export function GameDistributionPublishPanel({
setBusy(false);
setError('');
setResult(null);
setMetadataSuggestionPending(false);
setMetadataSuggestionReady(false);
setCoverConfirmOpen(false);
setGeneratingCover(false);
setCoverGenerationPrice(null);
@@ -351,7 +327,6 @@ export function GameDistributionPublishPanel({
uploadedAssetCacheRef.current.clear();
const suggestionRequestId = ++metadataSuggestionRequestRef.current;
setMetadataSuggestionPending(true);
void suggestGameDistributionPublishMetadata({
name: manifest.name,
goal: manifest.goal,
@@ -375,15 +350,9 @@ export function GameDistributionPublishPanel({
) {
setCategory(suggestion.category);
}
setMetadataSuggestionReady(true);
})
.catch(() => {
// 免费增强能力失败时保留本地兜底,不阻断发布。
})
.finally(() => {
if (suggestionRequestId === metadataSuggestionRequestRef.current) {
setMetadataSuggestionPending(false);
}
});
// 绑定恢复:原生按当前会话(账号 + origin)隔离;网络/401/5xx 返回 unavailable,
@@ -940,19 +909,6 @@ export function GameDistributionPublishPanel({
value={projectVersion}
/>
</label>
<span className="game-distribution-publish-panel__hint">
{projectVersionHint}
</span>
<span
className="game-distribution-publish-panel__metadata-hint"
role="status"
>
{metadataSuggestionPending
? '正在根据创作内容生成简介和分类…'
: metadataSuggestionReady
? 'AI 已根据创作内容生成简介和分类,免费;你可以直接修改。'
: '已根据创作内容预填简介和分类,免费;你可以直接修改。'}
</span>
</div>
<div
className="game-distribution-publish-panel__media"
@@ -1010,11 +966,11 @@ export function GameDistributionPublishPanel({
</button>
) : null}
</div>
<span className="game-distribution-publish-panel__hint">
{cover
? `已选择「${cover.name}」;重新选择即可替换封面。`
: '封面会作为游戏广场卡片与详情页首图,建议 16:9 的 JPG/PNG/WebP,最大 6MB。'}
</span>
{cover ? null : (
<span className="game-distribution-publish-panel__hint">
{'封面会作为游戏广场卡片与详情页首图,建议 16:9 的 JPG/PNG/WebP,最大 6MB。'}
</span>
)}
{coverGenerationDetail ? (
<span
className="game-distribution-publish-panel__hint"
@@ -1052,9 +1008,6 @@ export function GameDistributionPublishPanel({
: '添加截图'}
</span>
</span>
<span className="game-distribution-publish-panel__hint">
每张截图独立上传,单张失败不会影响其它截图或发布;鼠标移到成功截图上可删除或预览。
</span>
</label>
{screenshots.length > 0 ? (
<ul className="game-distribution-publish-panel__shots">
@@ -3566,13 +3566,6 @@ textarea {
margin-top: 18px;
}
.game-distribution-publish-panel__metadata-hint {
color: var(--platform-text-muted);
font-size: 11px;
font-weight: 500;
line-height: 1.5;
}
.game-distribution-publish-panel__publication {
display: grid;
gap: 4px;
@@ -98,7 +98,7 @@ async function selectCover(
fireEvent.change(screen.getByLabelText(/游戏封面/u), {
target: { files: [file] },
});
await screen.findByText(new RegExp(`已选择「${file.name}」`, 'u'));
await screen.findByText('更换封面图片');
}
function renderPanel(
@@ -172,7 +172,6 @@ describe('GameDistributionPublishPanel', () => {
screen.queryByText(/exports\/playtest-package-unit\.zip/u),
).toBeNull();
expect(screen.queryByText(/只上传已导出的 ZIP/u)).toBeNull();
await screen.findByText(/简介和分类/u);
});
test('打开时根据创作上下文补全简介和分类', async () => {
@@ -190,11 +189,6 @@ describe('GameDistributionPublishPanel', () => {
);
});
expect(screen.getByLabelText('分类')).toHaveProperty('value', '策略');
expect(
screen.getByText(
'AI 已根据创作内容生成简介和分类,免费;你可以直接修改。',
),
).not.toBeNull();
});
test('发布资料建议只带脱敏且有界的项目上下文', async () => {
@@ -540,7 +534,7 @@ describe('GameDistributionPublishPanel', () => {
fireEvent.change(screen.getByLabelText(/游戏封面/u), {
target: { files: [coverFile] },
});
await screen.findByText(/已选择「cover.png」/u);
await screen.findByText('更换封面图片');
expect(uploadPlatformMediaAsset).toHaveBeenCalledTimes(1);
});
@@ -839,11 +833,6 @@ describe('GameDistributionPublishPanel', () => {
expect(input).toHaveProperty('value', '4');
expect(input).toHaveProperty('readOnly', true);
expect(screen.getByText('v4')).not.toBeNull();
expect(
screen.getByText(
/发布将使用最新内部版本 v4(标签 = 内部版本条数,暂不能指定其它版本);agent 再改进一次后,下一次是 v5。/u,
),
).not.toBeNull();
expect(screen.getByText(/线上最近提交 v5 · 已公开/u)).not.toBeNull();
await selectCover();
fireEvent.click(screen.getByRole('button', { name: '更新游戏' }));