Remove duplicate page-id bridge API

- keep getCurrentPageId off the legacy shell bridge surface
- leave page-id lookup on the router side where it is actually used
- align the bridge tests and type definitions with the slimmer API
This commit is contained in:
Antti Kettunen 2026-05-03 18:11:34 +03:00
parent ed2b8d0e3d
commit 82115011b2
No known key found for this signature in database
GPG key ID: C6B2A3D250359BD7
6 changed files with 0 additions and 12 deletions

View file

@ -54,7 +54,6 @@ function mockIssuesFetch() {
function createShellBridge(overrides: Partial<ShellBridge> = {}): ShellBridge {
return {
getCurrentPageId: vi.fn<() => ShellPageId>(() => 'dashboard'),
getCurrentProfileContext: vi.fn(() => ({ profileId: 1, isAdmin: false })),
isPageAllowed: vi.fn(() => true),
getProfileHomePage: vi.fn<() => ShellPageId>(() => 'discover'),

View file

@ -14,7 +14,6 @@ describe('waitForShellContext', () => {
getProfileHomePage: vi.fn(() => 'discover'),
isPageAllowed: vi.fn(() => true),
activateLegacyPath: vi.fn(),
getCurrentPageId: vi.fn(() => 'issues'),
getCurrentProfileContext: vi.fn(() => ({ profileId: 2, isAdmin: true })),
resolveLegacyPath: vi.fn(() => 'issues'),
setActivePageChrome: vi.fn(),
@ -36,7 +35,6 @@ describe('waitForShellContext', () => {
getProfileHomePage: vi.fn(() => 'discover'),
isPageAllowed: vi.fn(() => true),
activateLegacyPath: vi.fn(),
getCurrentPageId: vi.fn(() => 'issues'),
getCurrentProfileContext,
resolveLegacyPath: vi.fn(() => 'issues'),
setActivePageChrome: vi.fn(),

View file

@ -79,9 +79,6 @@ export async function waitForShellContext(): Promise<ShellContext> {
export function bindWindowWebRouter(router: AnyRouter) {
window.SoulSyncWebRouter = {
routeManifest: [...shellRouteManifest],
getCurrentPageId() {
return resolveShellPageFromPath(window.location.pathname);
},
getCurrentPath() {
return normalizeShellPath(window.location.pathname);
},

View file

@ -17,7 +17,6 @@ declare global {
};
SoulSyncWebRouter?: {
routeManifest: ShellRouteDefinition[];
getCurrentPageId: () => ShellPageId | null;
getCurrentPath: () => string;
resolvePageId: (pathname: string) => ShellPageId | null;
navigateToPage: (
@ -28,7 +27,6 @@ declare global {
) => Promise<boolean>;
};
SoulSyncWebShellBridge?: {
getCurrentPageId: () => ShellPageId;
getCurrentProfileContext: () => ShellProfileContext | null;
isPageAllowed: (pageId: ShellPageId) => boolean;
getProfileHomePage: () => ShellPageId;

View file

@ -16,7 +16,6 @@ function createResponse(body: unknown, ok = true, status = 200) {
function createShellBridge(overrides: Partial<ShellBridge> = {}): ShellBridge {
return {
getCurrentPageId: vi.fn<() => ShellPageId>(() => 'issues'),
getCurrentProfileContext: vi.fn(() => ({ profileId: 2, isAdmin: true })),
isPageAllowed: vi.fn(() => true),
getProfileHomePage: vi.fn<() => ShellPageId>(() => 'discover'),

View file

@ -124,9 +124,6 @@ window.SoulSyncWorkflowActions = {
};
window.SoulSyncWebShellBridge = {
getCurrentPageId() {
return currentPage || getWebRouter()?.resolvePageId?.(window.location.pathname) || _getPageFromPath();
},
getCurrentProfileContext() {
if (!currentProfile) return null;
return {