Skip to content

Tmail button widget action callback#4207

Closed
zatteo wants to merge 2 commits intoai-scribe-uifrom
tmail-button-widget-action-callback
Closed

Tmail button widget action callback#4207
zatteo wants to merge 2 commits intoai-scribe-uifrom
tmail-button-widget-action-callback

Conversation

@zatteo
Copy link
Member

@zatteo zatteo commented Dec 15, 2025

No description provided.

This callback add in params a RelativeRect position object like
onTapActionAtPositionCallback but with the top left of the button
instead of the tap position.
By leveraging the new TmailButtonWidget, we can remove totally the need of a GlobalKey. Code is cleaner and no memory leak possible.
@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tmail-button-widget-action-callback

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zatteo zatteo changed the base branch from master to ai-scribe-ui December 15, 2025 10:20
@zatteo zatteo mentioned this pull request Dec 15, 2025
return TMailContainerWidget(
onTapActionCallback: onTapActionCallback,
onTapActionAtPositionCallback: onTapActionAtPositionCallback,
onTapActionAtOriginCallback: onTapActionAtOriginCallback,
Copy link
Member

@chibenwa chibenwa Dec 15, 2025

Choose a reason for hiding this comment

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

I see this as a common pattern in this changeset that the calling context forward tons of of argument thought class fields downsteam.

While i understand this is an established pattern that we might not want to challenge here ( :-( ) I would like us to think how we Improve the overall structure of the code over here.

Ideas (uncontextualized) out of the box:

  • Grouping arguments together within case class

EG

case class WidgetStyle(Width with, Height height, MaxWidth maxWidth, MaxHeight maxHeight, BorderRadius borderRadius)
case class WidgetInteractions(onTapActionCallback: onTapActionCallback,  onTapActionAtPositionCallback, onTapActionAtOriginCallback, onTapActionAtOriginCallback);

And return TMailContainerWidget(widgetInteractions, widgetStyle, child: childWidget);

Bonus points: style convertions would be in WidgetStyle, interactions transformation in the case class as well

Extra bonus point - breaking evil combo: reuse.In over class

  • Other idea 2 staged builders: we only build a minimal object to which the caller would add it's state so that this class do not need to be aware.

  • Very likely zillion of other good ideas.

Cc @hoangdat

@dab246
Copy link
Member

dab246 commented Dec 22, 2025

We don't need this anymore, please close it. @zatteo

@zatteo zatteo closed this Dec 22, 2025
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