清理首页菜单与泥点弹层细节
移除泥点弹层账户读取状态文案 使用详情改为统一占位通知 修复帮助按钮展开态灰色背景 补充泥点弹层交互断言
This commit is contained in:
@@ -2159,7 +2159,6 @@ export function WorkspaceLauncher({
|
||||
useState<PendingNonEmptyProject | null>(null);
|
||||
const [profileDashboard, setProfileDashboard] =
|
||||
useState<ProfileDashboardSummary | null>(null);
|
||||
const [profileStatus, setProfileStatus] = useState('正在读取账户');
|
||||
const [walletPanelOpen, setWalletPanelOpen] = useState(false);
|
||||
const [walletLedger, setWalletLedger] = useState<ProfileWalletLedgerEntry[]>(
|
||||
[],
|
||||
@@ -2232,14 +2231,13 @@ export function WorkspaceLauncher({
|
||||
return;
|
||||
}
|
||||
setProfileDashboard(dashboard);
|
||||
setProfileStatus('已读取账户');
|
||||
})
|
||||
.catch((error) => {
|
||||
if (disposed) {
|
||||
return;
|
||||
}
|
||||
setProfileDashboard(null);
|
||||
setProfileStatus(error instanceof Error ? error.message : '泥点读取失败');
|
||||
setWalletLedgerStatus(error instanceof Error ? error.message : '泥点读取失败');
|
||||
});
|
||||
void listClientShowcaseResources()
|
||||
.then((response) => {
|
||||
@@ -2709,6 +2707,7 @@ export function WorkspaceLauncher({
|
||||
function showLauncherNotice(title: string) {
|
||||
setAccountMenuOpen(false);
|
||||
setHelpMenuOpen(false);
|
||||
setWalletPanelOpen(false);
|
||||
setLauncherNotice({
|
||||
title,
|
||||
message: `${title}正在接入中,当前版本会先保留入口。`,
|
||||
@@ -3048,11 +3047,7 @@ export function WorkspaceLauncher({
|
||||
type="button"
|
||||
aria-label="帮助"
|
||||
title="帮助"
|
||||
className={
|
||||
helpMenuOpen || ['guide', 'contact', 'news'].includes(launcherView)
|
||||
? 'launcher-nav-active'
|
||||
: ''
|
||||
}
|
||||
className="launcher-config-button"
|
||||
aria-expanded={helpMenuOpen}
|
||||
onClick={() => {
|
||||
setAccountMenuOpen(false);
|
||||
@@ -3139,7 +3134,6 @@ export function WorkspaceLauncher({
|
||||
{walletPanelOpen ? (
|
||||
<div className="launcher-wallet-popover" role="dialog">
|
||||
<strong>泥点</strong>
|
||||
<span>{profileStatus}</span>
|
||||
<p>{formatMudPoints(profileDashboard?.walletBalance)} 泥点</p>
|
||||
<div className="launcher-wallet-ledger">
|
||||
{walletLedger.length > 0 ? (
|
||||
@@ -3153,7 +3147,10 @@ export function WorkspaceLauncher({
|
||||
<small>{walletLedgerStatus}</small>
|
||||
)}
|
||||
</div>
|
||||
<button type="button" onClick={() => void loadWalletLedger()}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => showLauncherNotice('使用详情')}
|
||||
>
|
||||
使用详情
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -274,6 +274,15 @@ textarea {
|
||||
background: #f3f4f6;
|
||||
}
|
||||
|
||||
.launcher-help-nav .launcher-config-button,
|
||||
.launcher-help-nav .launcher-config-button:hover,
|
||||
.launcher-help-nav .launcher-config-button:focus,
|
||||
.launcher-help-nav .launcher-config-button:focus-visible,
|
||||
.launcher-help-nav .launcher-config-button:active,
|
||||
.launcher-help-nav .launcher-config-button[aria-expanded='true'] {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.launcher-main {
|
||||
position: relative;
|
||||
display: grid;
|
||||
|
||||
@@ -801,6 +801,15 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
name: '升级',
|
||||
}),
|
||||
).not.toBeNull();
|
||||
fireEvent.click(
|
||||
within(screen.getByLabelText('账户资产')).getByRole('button', {
|
||||
name: '泥点余额',
|
||||
}),
|
||||
);
|
||||
expect(screen.queryByText('已读取账户')).toBeNull();
|
||||
fireEvent.click(screen.getByRole('button', { name: '使用详情' }));
|
||||
expect(screen.getByRole('dialog', { name: '使用详情' })).not.toBeNull();
|
||||
fireEvent.click(screen.getByRole('button', { name: '知道了' }));
|
||||
expect(
|
||||
screen.queryByRole('button', { name: 'Agent 聊天' }),
|
||||
).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user