feat(timeline): #COCO-5568, add switch buttons between homepage and timeline2#987
feat(timeline): #COCO-5568, add switch buttons between homepage and timeline2#987jcbe-ode merged 4 commits intodevelop-b2schoolfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a “beta/classic homepage” switcher in both the legacy AngularJS timeline UI and the new React frontend, alongside a refactor of the timeline directive template to improve empty-state rendering (including lightmode handling).
Changes:
- Refactored
timeline.directive.htmlstructure and empty-state blocks; added rendering of a new<beta-switch>directive. - Added an AngularJS
beta-switchdirective that updates/userbook/api/preferencesand reloads. - Added a React
BetaSwitchcomponent rendered from the root route via a portal target added tohomepage.html, plus a small i18n hook.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| timeline/src/main/resources/public/ts/timeline2/directives/timeline.directive.html | Template restructure; lightmode/empty states; adds <beta-switch> in the legacy UI. |
| timeline/src/main/resources/public/ts/timeline2/directives/beta-switch.directive.ts | New AngularJS directive/controller to toggle homepage preference and reload. |
| timeline/src/main/resources/public/ts/timeline2/directives/beta-switch.directive.html | New AngularJS button template for the switch. |
| timeline/src/main/resources/public/ts/timeline2/app.ts | Registers the new betaSwitch directive in the AngularJS module. |
| timeline/src/main/resources/i18n/fr.json | Adds French label for the switch button. |
| timeline/frontend/src/routes/root/index.tsx | Renders the new React <BetaSwitch /> from the root route. |
| timeline/frontend/src/hooks/useI18n.ts | Adds a small helper hook for app/common i18n namespaces. |
| timeline/frontend/src/hooks/index.ts | Removes starter placeholder content. |
| timeline/frontend/src/components/BetaSwitch/BetaSwitch.tsx | New React component that disables the beta homepage preference and reloads. |
| timeline/frontend/src/components/BetaSwitch/BetaSwitch.css | Positions the portal target container. |
| timeline/frontend/src/components/App.tsx | Removes starter component. |
| timeline/frontend/src/components/App.test.tsx | Removes starter test. |
| timeline/frontend/homepage.html | Adds <div id="beta-switch"></div> portal mount point. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
timeline/src/main/resources/public/ts/timeline2/directives/beta-switch.directive.ts
Show resolved
Hide resolved
timeline/src/main/resources/public/ts/timeline2/directives/beta-switch.directive.ts
Outdated
Show resolved
Hide resolved
timeline/src/main/resources/public/ts/timeline2/directives/beta-switch.directive.ts
Show resolved
Hide resolved
| </h2> | ||
| <img | ||
| class="emptyscreen-image__mini" | ||
| src="/timeline/public/img/lightmode-timeline.svg" |
There was a problem hiding this comment.
The lightmode emptyscreen image is missing an alt attribute, while other emptyscreen images in this template provide localized alt text. Please add an appropriate alt (ideally using the existing i18n key) to avoid accessibility regressions for screen readers.
| src="/timeline/public/img/lightmode-timeline.svg" | |
| src="/timeline/public/img/lightmode-timeline.svg" | |
| alt="" |
827f7e8 to
57f80f3
Compare
e9e093d to
92a1896
Compare
92a1896 to
7e213f8
Compare
57f80f3 to
1f9a92e
Compare
7e213f8 to
5b6753f
Compare
1f9a92e to
e78c054
Compare
|
| "timeline.beta.switch.previous": "Basculer vers la page d'accueil classique", | ||
| "timeline.beta.switch.new": "Basculer vers la nouvelle page d'accueil", |
There was a problem hiding this comment.
est ce qu'il ne faudrait pas tout appeler "homepage" maintenant ? plutôt que timeline
There was a problem hiding this comment.
Le module est toujours timeline.
De plus, ces nouvelles trads sont aussi utilisées côté angularJs (timeline2)
…imeline2 (#987) * feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2 * add angularJS implementation * feedback from copilot * remove dead code
…imeline2 (#987) * feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2 * add angularJS implementation * feedback from copilot * remove dead code
|
Petit fix ajouté sur la condition d'affichage du bouton sur timeline2 |
…imeline2 (#987) * feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2 * add angularJS implementation * feedback from copilot * remove dead code
…imeline2 (#987) * feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2 * add angularJS implementation * feedback from copilot * remove dead code
…imeline2 (#987) * feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2 * add angularJS implementation * feedback from copilot * remove dead code
…imeline2 (#987) * feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2 * add angularJS implementation * feedback from copilot * remove dead code
…imeline2 (#987) * feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2 * add angularJS implementation * feedback from copilot * remove dead code
…imeline2 (#987) * feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2 * add angularJS implementation * feedback from copilot * remove dead code



Description
Adds a “beta/classic homepage” switcher in both the legacy AngularJS timeline UI and the new React frontend
Fixes
https://edifice-community.atlassian.net/browse/COCO-5568
Type of change
Please check options that are relevant.
Which packages changed?
Please check the name of the package you changed
Tests
Reminder
Security flaws
Performance impacts (think bulk !)
Unit tests were replayed
Unit tests were added and/or changed
I have updated the reminder for the version including my modifications
All done ! 😃