Skip to content

Conversation

@NaoCoding
Copy link
Member

Fix all the follow-up issus mentioned in #247

Freehand tool selection and toolbar improvements:

  • Added state to CreationToolbar to track and display the last selected freehand tool, ensuring the toolbar button always shows the user's most recent choice. [1] [2]
  • Refactored the logic for determining the currently selected freehand icon and tool, improving the user experience when switching between pen and eraser. [1] [2]
  • Updated the toolbar and popover to consistently reflect the selected freehand tool, and to open automatically when the current pointer is a freehand tool. [1] [2]

i18n:

  • Fix i18n of freehand-toolbar

@NaoCoding NaoCoding requested a review from pubuzhixing8 August 28, 2025 15:02
@pubuzhixing8
Copy link
Contributor

pubuzhixing8 commented Aug 28, 2025

Very cool @NaoCoding ! I can preview the deploy page https://fix-freehand.drawnix.pages.dev now, that's very convenient.

  1. After experiencing the improvement I found the selected icon don't have selected status.
  2. I will review code soon.
Screenshot 2025-08-28 at 23 44 50

@NaoCoding
Copy link
Member Author

Let me fix the selected hover stuff

const getCurrentFreehandIcon = () => {
const currentPointer = board.pointer;
if (currentPointer === FreehandShape.eraser) {
const getFreehandIcon = (pointer) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

is the function getFreehandIcon useless?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it is useless. I forgot to delete this function after refactor the logic of the freehand toolbar

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 28, 2025

Deploying drawnix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 230d496
Status: ✅  Deploy successful!
Preview URL: https://31470ebb.drawnix.pages.dev
Branch Preview URL: https://fix-freehand.drawnix.pages.dev

View logs

@NaoCoding
Copy link
Member Author

Hi @pubuzhixing8 , I have resolved all the issues.

@pubuzhixing8
Copy link
Contributor

I have another suggestion about previous pr which the file name of freehand-toolbar.tsx could be rename to freehand-panel.tsx, do you think it is better?

@NaoCoding
Copy link
Member Author

Sure, I think the suggestion provide a better readability and more affordable for further maintenance. Let me modify the file name.

@NaoCoding
Copy link
Member Author

@pubuzhixing8 Done!

@pubuzhixing8
Copy link
Contributor

The new experience is great 👍🏻!

@pubuzhixing8 pubuzhixing8 merged commit 4a25b54 into develop Aug 28, 2025
2 checks passed
@NaoCoding NaoCoding deleted the fix-freehand branch August 28, 2025 16:14
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