对齐我的界面反馈入口
我的界面反馈与建议改为新页签打开飞书表格 隐藏旧站内反馈页面路由和渲染分支 补充反馈入口外链和旧路由隐藏测试
This commit is contained in:
@@ -320,10 +320,7 @@ import {
|
||||
remixRpgEntryWorldGallery,
|
||||
} from '../../services/rpg-entry/rpgEntryLibraryClient';
|
||||
import { navigateHostNativePage } from '../../services/host-bridge/hostBridge';
|
||||
import {
|
||||
getRpgProfilePlayStats,
|
||||
submitRpgProfileFeedback,
|
||||
} from '../../services/rpg-entry/rpgProfileClient';
|
||||
import { getRpgProfilePlayStats } from '../../services/rpg-entry/rpgProfileClient';
|
||||
import { requestRpgRuntimeJson } from '../../services/rpg-runtime/rpgRuntimeRequest';
|
||||
import { type RuntimeGuestRequestOptions } from '../../services/runtimeGuestAuth';
|
||||
import { squareHoleCreationClient } from '../../services/square-hole-creation';
|
||||
@@ -374,6 +371,7 @@ import type { CustomWorldProfile } from '../../types';
|
||||
import { useAuthUi } from '../auth/AuthUiContext';
|
||||
import { PlatformAcknowledgeStatusDialog } from '../common/PlatformAcknowledgeStatusDialog';
|
||||
import { PlatformActionButton } from '../common/PlatformActionButton';
|
||||
import { FLOATING_FEEDBACK_FORM_URL } from '../common/floatingFeedbackEntryModel';
|
||||
import { PlatformDangerConfirmDialog } from '../common/PlatformDangerConfirmDialog';
|
||||
import { PlatformFieldLabel } from '../common/PlatformFieldLabel';
|
||||
import { PlatformSubpanel } from '../common/PlatformSubpanel';
|
||||
@@ -550,7 +548,6 @@ import type {
|
||||
import { PlatformEntryWorldDetailView } from './PlatformEntryWorldDetailView';
|
||||
import { PlatformErrorDialog } from './PlatformErrorDialog';
|
||||
import { buildExternalGenerationQueueStatus } from './platformExternalGenerationQueueStatusModel';
|
||||
import { PlatformFeedbackView } from './PlatformFeedbackView';
|
||||
import { resolvePlatformGenerationProgressTickDecision } from './platformGenerationProgressTickModel';
|
||||
import {
|
||||
buildPlatformHostDraftFailureNotification,
|
||||
@@ -2513,8 +2510,9 @@ export function PlatformEntryFlowShellImpl({
|
||||
useEffect(() => {
|
||||
if (selectionStage === 'profile-feedback') {
|
||||
setPlatformTab('profile');
|
||||
setSelectionStage('platform');
|
||||
}
|
||||
}, [selectionStage, setPlatformTab]);
|
||||
}, [selectionStage, setPlatformTab, setSelectionStage]);
|
||||
|
||||
const openProfileFeedback = useCallback(() => {
|
||||
if (!authUi?.user) {
|
||||
@@ -2522,9 +2520,8 @@ export function PlatformEntryFlowShellImpl({
|
||||
return;
|
||||
}
|
||||
|
||||
setPlatformTab('profile');
|
||||
setSelectionStage('profile-feedback');
|
||||
}, [authUi, setPlatformTab, setSelectionStage]);
|
||||
window.open(FLOATING_FEEDBACK_FORM_URL, '_blank', 'noopener,noreferrer');
|
||||
}, [authUi]);
|
||||
|
||||
const enterCreateTab = useCallback(() => {
|
||||
// 只依赖稳定的 setter,避免把 bootstrap 对象的 render 级引用变化
|
||||
@@ -15543,24 +15540,6 @@ export function PlatformEntryFlowShellImpl({
|
||||
</motion.div>
|
||||
)}
|
||||
|
||||
{selectionStage === 'profile-feedback' && (
|
||||
<motion.div
|
||||
key="platform-profile-feedback"
|
||||
initial={{ opacity: 0, y: 12 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
exit={{ opacity: 0, y: -12 }}
|
||||
className="flex h-full min-h-0 flex-col"
|
||||
>
|
||||
<PlatformFeedbackView
|
||||
onBack={() => {
|
||||
setPlatformTab('profile');
|
||||
setSelectionStage('platform');
|
||||
}}
|
||||
onSubmit={submitRpgProfileFeedback}
|
||||
/>
|
||||
</motion.div>
|
||||
)}
|
||||
|
||||
{selectionStage === 'work-detail' && !selectedPublicWorkDetail && (
|
||||
<motion.div
|
||||
key="platform-work-detail-empty"
|
||||
|
||||
@@ -198,6 +198,7 @@ import {
|
||||
AuthUiContext,
|
||||
type PlatformSettingsSection,
|
||||
} from '../auth/AuthUiContext';
|
||||
import { FLOATING_FEEDBACK_FORM_URL } from '../common/floatingFeedbackEntryModel';
|
||||
import { PLATFORM_DESKTOP_LAYOUT_QUERY } from '../platform-entry/platformEntryResponsive';
|
||||
import {
|
||||
getUnifiedCreationSpec,
|
||||
@@ -9453,6 +9454,44 @@ test('creation home desktop rail hides recommend and discover entries', async ()
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('profile feedback shortcut opens Feishu form in a new tab', async () => {
|
||||
const user = userEvent.setup();
|
||||
const openWindow = vi
|
||||
.spyOn(window, 'open')
|
||||
.mockImplementation(() => null);
|
||||
mockDesktopPlatformLayout();
|
||||
window.history.replaceState(null, '', '/creation');
|
||||
const { container } = render(<TestWrapper withAuth />);
|
||||
|
||||
await screen.findByRole('heading', {
|
||||
name: '陶泥儿 - 开启全民精品游戏创作',
|
||||
});
|
||||
const nav = container.querySelector('.platform-desktop-rail');
|
||||
expect(nav).toBeTruthy();
|
||||
|
||||
await user.click(
|
||||
within(nav as HTMLElement).getByRole('button', { name: '我的' }),
|
||||
);
|
||||
const shortcutRegion = await screen.findByRole('region', {
|
||||
name: '常用功能',
|
||||
});
|
||||
|
||||
await user.click(
|
||||
within(shortcutRegion).getByRole('button', { name: /反馈与建议/u }),
|
||||
);
|
||||
|
||||
expect(openWindow).toHaveBeenCalledWith(
|
||||
FLOATING_FEEDBACK_FORM_URL,
|
||||
'_blank',
|
||||
'noopener,noreferrer',
|
||||
);
|
||||
expect(screen.queryByText('反馈与投诉')).toBeNull();
|
||||
expect(window.location.pathname).not.toBe('/profile/feedback');
|
||||
expect(resolveSelectionStageFromPath(window.location.pathname)).toBe(
|
||||
'platform',
|
||||
);
|
||||
});
|
||||
|
||||
test('project page keeps desktop rail with recommend and discover hidden', async () => {
|
||||
mockDesktopPlatformLayout();
|
||||
window.history.replaceState(null, '', '/project');
|
||||
|
||||
@@ -11,15 +11,12 @@ import {
|
||||
} from './appPageRoutes';
|
||||
|
||||
describe('appPageRoutes', () => {
|
||||
it('resolves profile feedback route', () => {
|
||||
it('hides the legacy profile feedback route', () => {
|
||||
expect(resolveSelectionStageFromPath('/profile/feedback')).toBe(
|
||||
'profile-feedback',
|
||||
'platform',
|
||||
);
|
||||
expect(resolveSelectionStageFromPath('/profile/feedback/')).toBe(
|
||||
'profile-feedback',
|
||||
);
|
||||
expect(resolvePathForSelectionStage('profile-feedback')).toBe(
|
||||
'/profile/feedback',
|
||||
'platform',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ const STAGE_ROUTE_ENTRIES = [
|
||||
['creation-home', '/creation'],
|
||||
['project', '/project'],
|
||||
['image-editor', '/editor/canvas'],
|
||||
['profile-feedback', '/profile/feedback'],
|
||||
['work-detail', '/works/detail'],
|
||||
['detail', '/worlds/detail'],
|
||||
['agent-workspace', '/creation/rpg'],
|
||||
|
||||
Reference in New Issue
Block a user