-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(flutter): pre-defined response formats #7128
base: main
Are you sure you want to change the base?
feat(flutter): pre-defined response formats #7128
Conversation
🥷 Ninja i18n – 🛎️ Translations need to be updatedProject
|
lint rule | new reports | level | link |
---|---|---|---|
Missing translation | 420 | warning | contribute (via Fink 🐦) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7128 +/- ##
==========================================
- Coverage 57.69% 57.62% -0.08%
==========================================
Files 320 320
Lines 14057 14057
Branches 2039 2039
==========================================
- Hits 8110 8100 -10
- Misses 5683 5694 +11
+ Partials 264 263 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4092970
to
cb81747
Compare
5b75bdb
to
c9bca30
Compare
7e4baa7
to
dc0e491
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
TextFormat.bulletList => ResponseTextFormatPB.BulletedList, | ||
TextFormat.numberedList => ResponseTextFormatPB.NumberedList, | ||
TextFormat.table => ResponseTextFormatPB.Table, | ||
null => null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the sentiment, but might as well be a default case no? _ => null
I guess it's not important, this way you get a warning I suppose when you add a new TextFormat.
setState(() { | ||
predefinedFormat = format; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\nit
setState(() { | |
predefinedFormat = format; | |
}); | |
setState(() => predefinedFormat = format); |
if (showPredefinedFormatSection) { | ||
widget.onSubmitted(trimmedText, predefinedFormat, metadata); | ||
} else { | ||
widget.onSubmitted(trimmedText, null, metadata); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (showPredefinedFormatSection) { | |
widget.onSubmitted(trimmedText, predefinedFormat, metadata); | |
} else { | |
widget.onSubmitted(trimmedText, null, metadata); | |
} | |
widget.onSubmitted(trimmedText, showPredefinedFormatSection ? predefinedFormat : null, metadata); |
this.hintText = "", | ||
// this.onStartMentioningPage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
final String hintText; | ||
// final void Function()? onStartMentioningPage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
setState(() { | ||
predefinedFormat = format; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\nit
setState(() { | |
predefinedFormat = format; | |
}); | |
setState(() => predefinedFormat = format); |
child: _LeadingActions( | ||
textController: textController, | ||
// onMention: () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove if we don't need this?
child: FlowySvg( | ||
format.icon, | ||
size: format == ImageFormat.textAndImage | ||
? Size(21.0 / 16.0 * iconSize, iconSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way of calculating the height seems scary haha.
Mobile: 26.25 if IconSize is 20
Desktop: 21 if IconSize is 16
Feels like black magic 😂
leftIcon: FlowySvg( | ||
format.icon, | ||
size: format == ImageFormat.textAndImage | ||
? const Size(21.0 / 16.0 * 20, 20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? const Size(21.0 / 16.0 * 20, 20) | |
? const Size(26.25, 20) |
This value is a bit odd, but there's no need to have a calculation here.
Desktop:
input:
regenerate:
Mobile:
input:
regenerate:
Feature Preview
PR Checklist