online icon indicating copy to clipboard operation
online copied to clipboard

Extracted main-nav to seperate ts file

Open maddie0501 opened this issue 7 months ago • 7 comments

Refactored all logic related to .main-nav from jQuery-based JavaScript to modular, strongly typed TypeScript. The changes include:

  • Moving .main-nav related logic to a new TypeScript file: Control.MenuAndTitleBar.ts
  • Replacing all jQuery DOM manipulations (addClass, removeClass, prepend, css, etc.) with vanilla TypeScript equivalents
  • Encapsulating .main-nav behavior as methods within the MenuAndTitleBar class
  • Providing exported methods like setNotebookbar, getMainNavWidth, showMainNav, hideMainNav, isMainNavHidden, and resetMainNavHeader for use in other modules
  • Updating external files (UIManager, Notebookbar, Toolbar) to call these TypeScript methods instead of using jQuery
  • Resolves: #11959

maddie0501 avatar Jun 11 '25 11:06 maddie0501

Thanks for opening this pull request!

Things that will help get your PR across the finish line:

  • Check out our contributing guidelines.
  • Connect with us through one of our communication channels.
  • Click on the details link next to the failing CI checks, if any, to see an explanation on how to fix it.
  • Feel free to ping @pedropintosilva or the mentor of the easyHack you are solving if you need help.

welcome[bot] avatar Jun 11 '25 11:06 welcome[bot]

thanks and welcome @maddie0501 !

There are some missing steps to pass the CI :)

Do sign- off your commits and Add Change -id.

Sign-off (DCO)

You should only do this if:

To add your Signed-off-by line to every commit in this branch:

Ensure you have a local copy of your branch by checking out the pull request locally via command line. In your local branch, run: git rebase HEAD~2 --signoff Force push your changes to overwrite the branch: git push --force-with-lease origin Switch-between-spreadsheet-tabs

Change-id

How to obtain Change-Id in commit message :

copy commit hook : cp .git-hooks/commit-msg .git/hooks/commit-msg

And then amend your commit message : git commit --amend git push -f

Darshan-upadhyay1110 avatar Jun 11 '25 12:06 Darshan-upadhyay1110

Hi @Darshan-upadhyay1110 I have done the above changes

maddie0501 avatar Jun 11 '25 14:06 maddie0501

Hello @maddie0501 thanks for the sign-off but it seem you only did sign-off your last commit. But as it defined in DOC all commits should be signed off. https://github.com/CollaboraOnline/online/pull/12126/checks?check_run_id=43896069996

Sorry i think my last comment miss-leaded you :bow:

Also there are some warnings i see in code, can you please address those ? it seems few variables and conditions are dead code...

Also as last step please rebase this pacth with latest online master, That would fix the issues currently as you were seeing as Red CI :)

Darshan-upadhyay1110 avatar Jun 11 '25 15:06 Darshan-upadhyay1110

you can delete the last commit (formatting changes) and modify first one with amend to get signoff right. Then DCO check will pass :)

Good to have formatting nice, but we can have just a code change here and will be good. Thanks!

eszkadev avatar Jun 12 '25 05:06 eszkadev

Hey I have done the changes..

maddie0501 avatar Jun 12 '25 06:06 maddie0501

build error is:

  TSC      tscompile.done
src/control/Control.MenuAndTitleBar.ts(59,31): error TS2339: Property 'scrollbarWidth' does not exist on type 'CSSStyleDeclaration'.

https://cpci.cbg.collabora.co.uk:8080/job/github_online_master_debug_vs_co-25.04_cypress_desktop/2095/console

eszkadev avatar Jun 16 '25 08:06 eszkadev

closing due to no activity and code which has many conflicts already

eszkadev avatar Sep 23 '25 04:09 eszkadev