-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New Update settings_shortcuts_view.dart #8279
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis PR enhances hover interactions and refines the shortcuts settings UI by updating the ResetButton behavior, tightening layout in ShortcutSettingTile, and enforcing consistent const usage with formatting cleanup. Class diagram for updated SettingsShortcutsView and related widgetsclassDiagram
class SettingsShortcutsView {
+createState()
}
class _SettingsShortcutsViewState {
-String _query
-bool _isEditing
+build(context)
}
SettingsShortcutsView --> _SettingsShortcutsViewState
class _SearchBar {
+onSearchChanged: void Function(String)?
+build(context)
}
class _ResetButton {
+onReset: void Function()?
+build(context)
+resetHoverOnRebuild: false
+style: HoverStyle
}
class ShortcutSettingTile {
+command: CommandShortcutEvent
+onStartEditing: VoidCallback
+onFinishEditing: VoidCallback
+canStartEditing: bool Function()
+createState()
}
class _ShortcutSettingTileState {
-keybindController: TextEditingController
-focusNode: FocusNode
-isHovering: bool
-isEditing: bool
-canClickOutside: bool
+initState()
+dispose()
+build(context)
+_finishEditing()
+_updateCommand()
+_renderKeybindings(isHovering)
+_renderKeybindEditor()
+_toParts(binding: Keybinding): List<String>
}
ShortcutSettingTile --> _ShortcutSettingTileState
class KeyBadge {
+keyLabel: String
+build(context)
+iconData: FlowySvgData?
}
class FlowyHover {
+resetHoverOnRebuild: bool
+style: HoverStyle
+builder: (context, isHovering)
}
class FlowyText {
+regular(text, color)
}
class FlowySvg {
+FlowySvg(svg, size, color)
}
class FlowyTextField {
+controller: TextEditingController
+focusNode: FocusNode
+onSubmitted: Function
}
_ResetButton --> FlowyHover
_ResetButton --> FlowySvg
_ResetButton --> FlowyText
_ShortcutSettingTileState --> FlowyTextField
_ShortcutSettingTileState --> KeyBadge
KeyBadge --> FlowySvg
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
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.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart:396-400` </location>
<code_context>
],
- const Spacer(),
- if (isHovering)
+ if (isHovering) ...[
+ const HSpace(8),
GestureDetector(
</code_context>
<issue_to_address>
**suggestion:** Conditional rendering of HSpace(8) only when hovering may cause layout shift.
To prevent layout jumps, keep the spacing consistent whether or not the component is hovered.
```suggestion
const HSpace(8),
if (isHovering)
GestureDetector(
onTap: () {
if (widget.canStartEditing()) {
```
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Feature Preview
PR Checklist
Summary by Sourcery
Refactor settings_shortcuts_view.dart to enhance hover interactions, streamline layout, and improve keybinding editing behavior
Enhancements: