Skip to content

feat(timeline): #COCO-5568, add switch buttons between homepage and timeline2#987

Merged
jcbe-ode merged 4 commits intodevelop-b2schoolfrom
feat/COCO-5568
Mar 31, 2026
Merged

feat(timeline): #COCO-5568, add switch buttons between homepage and timeline2#987
jcbe-ode merged 4 commits intodevelop-b2schoolfrom
feat/COCO-5568

Conversation

@jcbe-ode
Copy link
Copy Markdown
Contributor

@jcbe-ode jcbe-ode commented Mar 30, 2026

Description

Adds a “beta/classic homepage” switcher in both the legacy AngularJS timeline UI and the new React frontend

  • Added an AngularJS beta-switch directive that updates /userbook/api/preferences and reloads.
  • Added a React BetaSwitch component rendered from the root route via a portal target added to homepage.html

Fixes

https://edifice-community.atlassian.net/browse/COCO-5568

Type of change

Please check options that are relevant.

  • Chore (PATCH)
  • Doc (PATCH)
  • Bug fix (PATCH)
  • New feature (MINOR)

Which packages changed?

Please check the name of the package you changed

  • admin
  • app-registry
  • archive
  • auth
  • cas
  • common
  • communication
  • conversation
  • directory
  • feeder
  • infra
  • portal
  • session
  • test
  • tests
  • timeline
  • workspace

Tests

  1. Describe here the tests you performed
  2. Step by step
  3. With expected results

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 ! 😃

@jcbe-ode jcbe-ode requested a review from Copilot March 30, 2026 09:16
@jcbe-ode jcbe-ode changed the title Feat/coco 5568 feat(timeline): #COCO-5568, add switch buttons between homepage and timeline2 Mar 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.html structure and empty-state blocks; added rendering of a new <beta-switch> directive.
  • Added an AngularJS beta-switch directive that updates /userbook/api/preferences and reloads.
  • Added a React BetaSwitch component rendered from the root route via a portal target added to homepage.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.

</h2>
<img
class="emptyscreen-image__mini"
src="/timeline/public/img/lightmode-timeline.svg"
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
src="/timeline/public/img/lightmode-timeline.svg"
src="/timeline/public/img/lightmode-timeline.svg"
alt=""

Copilot uses AI. Check for mistakes.
@jcbe-ode jcbe-ode merged commit 53cb83d into develop-b2school Mar 31, 2026
@jcbe-ode jcbe-ode deleted the feat/COCO-5568 branch March 31, 2026 06:31
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@damienromito damienromito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top

Comment on lines +196 to +197
"timeline.beta.switch.previous": "Basculer vers la page d'accueil classique",
"timeline.beta.switch.new": "Basculer vers la nouvelle page d'accueil",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

est ce qu'il ne faudrait pas tout appeler "homepage" maintenant ? plutôt que timeline

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le module est toujours timeline.
De plus, ces nouvelles trads sont aussi utilisées côté angularJs (timeline2)

jcbe-ode added a commit that referenced this pull request Mar 31, 2026
…imeline2 (#987)

* feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2

* add angularJS implementation

* feedback from copilot

* remove dead code
jcbe-ode added a commit that referenced this pull request Mar 31, 2026
…imeline2 (#987)

* feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2

* add angularJS implementation

* feedback from copilot

* remove dead code
@jcbe-ode
Copy link
Copy Markdown
Contributor Author

Petit fix ajouté sur la condition d'affichage du bouton sur timeline2

jcbe-ode added a commit that referenced this pull request Mar 31, 2026
…imeline2 (#987)

* feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2

* add angularJS implementation

* feedback from copilot

* remove dead code
vbillard91 pushed a commit that referenced this pull request Apr 2, 2026
…imeline2 (#987)

* feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2

* add angularJS implementation

* feedback from copilot

* remove dead code
jenkinsEdificePublic pushed a commit that referenced this pull request Apr 7, 2026
…imeline2 (#987)

* feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2

* add angularJS implementation

* feedback from copilot

* remove dead code
pb-jo pushed a commit that referenced this pull request Apr 8, 2026
…imeline2 (#987)

* feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2

* add angularJS implementation

* feedback from copilot

* remove dead code
vbillard91 pushed a commit that referenced this pull request Apr 8, 2026
…imeline2 (#987)

* feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2

* add angularJS implementation

* feedback from copilot

* remove dead code
benjaminperez pushed a commit that referenced this pull request Apr 8, 2026
…imeline2 (#987)

* feat(timeline): #COCO-5568, add switch buttons for homepage and timeline2

* add angularJS implementation

* feedback from copilot

* remove dead code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants