Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Ruler class to centralize common functionality and enforce subclass implementation #10907

Closed

Conversation

Darshan-upadhyay1110
Copy link
Contributor

  • Converted ruler file into typescript
  • created base class and subclass for Horizontal and vertical ruler
  • Moved the _updatePaintTimer method to the base Ruler class to avoid duplication across HRuler and VRuler.
  • Added _updateBreakPoints as an abstract-like method in the base class, throwing an error to enforce implementation in subclasses.
  • Streamlined the initialization logic in Ruler.initializeRuler for better readability and modularity.

Change-Id: I8f0187588ffab533e135023285acb3dcada832d4

  • Resolves: #
  • Target version: master

Summary

TODO

  • ...

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

browser/src/control/Ruler.ts Fixed Show fixed Hide fixed
browser/src/control/Ruler.ts Fixed Show fixed Hide fixed
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/ruler-typescript-conversion branch 3 times, most recently from 9fb352d to 9def96f Compare January 13, 2025 14:06
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/ruler-typescript-conversion branch 2 times, most recently from 177456e to 766617b Compare January 14, 2025 06:22
@caolanm caolanm force-pushed the private/darshan/ruler-typescript-conversion branch from 766617b to 01ff76c Compare January 14, 2025 08:27
src/control/VRuler.ts \
src/control/HRuler.ts \
src/control/Ruler.ts \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have 2 of these?

src/control/Signing.js \
src/control/Toolbar.js \
src/control/VRuler.ts \
src/control/Ruler.ts \
Copy link
Contributor

Choose a reason for hiding this comment

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

It's the same here, why duplicate?

@gokaysatir gokaysatir self-requested a review January 14, 2025 14:30
@gokaysatir
Copy link
Contributor

Works well, thanks @Darshan-upadhyay1110 :) Don't know why that test is failing. Maybe a rebase could work?

@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/ruler-typescript-conversion branch from 01ff76c to 6a59100 Compare January 15, 2025 06:25
Copy link
Contributor

@gokaysatir gokaysatir left a comment

Choose a reason for hiding this comment

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

Thanks for the improvements :)

@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/ruler-typescript-conversion branch from 6a59100 to 8b5d792 Compare January 15, 2025 14:25
…ubclass implementation

- Converted ruler file into typescript
- created base class and subclass for Horizontal and vertical ruler
- Moved the `_updatePaintTimer` method to the base `Ruler` class to avoid duplication across `HRuler` and `VRuler`.
- Added `_updateBreakPoints` as an abstract-like method in the base class, throwing an error to enforce implementation in subclasses.
- Streamlined the initialization logic in `Ruler.initializeRuler` for better readability and modularity.

Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Change-Id: I8f0187588ffab533e135023285acb3dcada832d4
- Change overflow from hidden to overflow-x: clip to ensure horizontal ruler visibility.
- Prevent vertical ruler overflow beyond parent container when zoomed in.
- Resolve misalignment when the tab container has custom or transparent background.

Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Change-Id: I43e52f248ba4d4a9fc86d9ba347de776a0894334
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/ruler-typescript-conversion branch from 8b5d792 to 9096d51 Compare January 16, 2025 05:59
@Darshan-upadhyay1110 Darshan-upadhyay1110 removed the request for review from eszkadev January 16, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants