Merge User Stories page into Specs page

- SpecsPage: Add screen filter, scroll-to-story, selection highlight
- FeatureFilter: Add screen filter chips for both mobile and desktop
- Router: Redirect /stories/* routes to /specs/* for backward compatibility
- App: Remove UserStoriesPage routing, simplify navigation
- Gallery: Remove User Stories button, keep only Specs BDD
- Button: Add cursor-pointer to base styles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Sylvain Duchesne
2026-01-18 20:02:39 +01:00
parent 4ae96b0e94
commit fd5fab5bd2
6 changed files with 162 additions and 63 deletions
+10 -9
View File
@@ -2,9 +2,8 @@ import React, { createContext, useContext, useState, useEffect, useCallback } fr
type Route =
| { page: 'gallery' }
| { page: 'stories'; storyId?: string }
| { page: 'demo'; screenId: string }
| { page: 'specs'; featureId?: string };
| { page: 'specs'; featureId?: string; storyId?: string };
interface RouterContextValue {
route: Route;
@@ -21,14 +20,16 @@ function parseHash(hash: string): Route {
return { page: 'gallery' };
}
// Redirect /stories to /specs (backward compatibility)
if (path === 'stories') {
return { page: 'stories' };
return { page: 'specs' };
}
// Redirect /stories/{id} to /specs with storyId (backward compatibility)
if (path.startsWith('stories/')) {
const storyId = path.replace('stories/', '');
if (storyId) {
return { page: 'stories', storyId };
return { page: 'specs', storyId };
}
}
@@ -57,12 +58,12 @@ function routeToHash(route: Route): string {
switch (route.page) {
case 'gallery':
return '#/';
case 'stories':
return route.storyId ? `#/stories/${route.storyId}` : '#/stories';
case 'demo':
return `#/demo/${route.screenId}`;
case 'specs':
return route.featureId ? `#/specs/${route.featureId}` : '#/specs';
if (route.featureId) return `#/specs/${route.featureId}`;
if (route.storyId) return `#/specs/${route.storyId}`;
return '#/specs';
}
}
@@ -112,10 +113,10 @@ export function useGoBack() {
}
/**
* Generate a URL for a specific story
* Generate a URL for a specific story (now redirects to specs)
*/
export function getStoryUrl(storyId: string): string {
return `#/stories/${storyId}`;
return `#/specs/${storyId}`;
}
/**