This commit is contained in:
2026-04-29 11:51:04 +08:00
parent e191619ab3
commit 412279ae11
89 changed files with 3966 additions and 491 deletions

View File

@@ -15,7 +15,9 @@ import {
describe('appPageRoutes', () => {
it('normalizes page paths for stable matching', () => {
expect(normalizeAppPath('')).toBe('/');
expect(normalizeAppPath('/CREATION/RPG/AGENT/')).toBe('/creation/rpg/agent');
expect(normalizeAppPath('/CREATION/RPG/AGENT/')).toBe(
'/creation/rpg/agent',
);
});
it('resolves platform entry stages from independent paths', () => {
@@ -52,11 +54,11 @@ describe('appPageRoutes', () => {
it('builds and reads public work detail query routes', () => {
expect(buildPublicWorkDetailPath('CW-00000001')).toBe(
'/worlds/detail?work=CW-00000001',
);
expect(buildPublicWorkDetailUrl('CW-00000001', 'https://example.test')).toBe(
'https://example.test/worlds/detail?work=CW-00000001',
'/works/detail?work=CW-00000001',
);
expect(
buildPublicWorkDetailUrl('CW-00000001', 'https://example.test'),
).toBe('https://example.test/works/detail?work=CW-00000001');
expect(readPublicWorkCodeFromLocationSearch('?work=CW-00000001')).toBe(
'CW-00000001',
);

View File

@@ -6,6 +6,7 @@ export const PUBLIC_WORK_QUERY_PARAM = 'work';
const STAGE_ROUTE_ENTRIES = [
['platform', '/'],
['work-detail', '/works/detail'],
['detail', '/worlds/detail'],
['agent-workspace', '/creation/rpg/agent'],
['custom-world-generating', '/creation/rpg/generating'],
@@ -57,7 +58,7 @@ export function readPublicWorkCodeFromLocationSearch(search: string) {
}
export function buildPublicWorkDetailPath(publicWorkCode: string) {
return buildPublicWorkStagePath('detail', publicWorkCode);
return buildPublicWorkStagePath('work-detail', publicWorkCode);
}
export function buildPublicWorkStagePath(