Skip to content

Commit b2967e8

Browse files
committed
compose [nfc]: s/_ComposeBoxLayout/_ComposeBoxBody/
This widget is already doing more than layout (sizing and positioning its inputs on the screen): it creates the attachment buttons and styles their touch feedback, and it defeats an unwanted border that its `topicInput` and `contentInput` params might otherwise create. I chose the name "body" to distinguish this from some other elements that will need to share the compose-box surface, for the UI part of issue zulip#720: an error banner and a linear progress indicator. Then also add "body" to the names _StreamComposeBox and _FixedDestinationComposeBox. Since the recent commits that simplified those, they're really just thin, stateless wrappers that configure a _ComposeBoxBody.
1 parent fe3a0fe commit b2967e8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/widgets/compose_box.dart

+11-11
Original file line numberDiff line numberDiff line change
@@ -1030,8 +1030,8 @@ class _ComposeBoxContainer extends StatelessWidget {
10301030
}
10311031
}
10321032

1033-
class _ComposeBoxLayout extends StatelessWidget {
1034-
const _ComposeBoxLayout({
1033+
class _ComposeBoxBody extends StatelessWidget {
1034+
const _ComposeBoxBody({
10351035
required this.topicInput,
10361036
required this.contentInput,
10371037
required this.sendButton,
@@ -1134,8 +1134,8 @@ class FixedDestinationComposeBoxController extends ComposeBoxController {}
11341134
///
11351135
/// This offers a text input for the topic to send to,
11361136
/// in addition to a text input for the message content.
1137-
class _StreamComposeBox extends StatelessWidget {
1138-
const _StreamComposeBox({required this.narrow, required this.controller});
1137+
class _StreamComposeBoxBody extends StatelessWidget {
1138+
const _StreamComposeBoxBody({required this.narrow, required this.controller});
11391139

11401140
/// The narrow on view in the message list.
11411141
final ChannelNarrow narrow;
@@ -1148,7 +1148,7 @@ class _StreamComposeBox extends StatelessWidget {
11481148
:topic, :content, :topicFocusNode, :contentFocusNode,
11491149
) = controller;
11501150

1151-
return _ComposeBoxLayout(
1151+
return _ComposeBoxBody(
11521152
contentController: content,
11531153
contentFocusNode: contentFocusNode,
11541154
topicInput: _TopicInput(
@@ -1193,8 +1193,8 @@ class _ErrorBanner extends StatelessWidget {
11931193
}
11941194
}
11951195

1196-
class _FixedDestinationComposeBox extends StatelessWidget {
1197-
const _FixedDestinationComposeBox({required this.narrow, required this.controller});
1196+
class _FixedDestinationComposeBoxBody extends StatelessWidget {
1197+
const _FixedDestinationComposeBoxBody({required this.narrow, required this.controller});
11981198

11991199
final SendableNarrow narrow;
12001200

@@ -1206,7 +1206,7 @@ class _FixedDestinationComposeBox extends StatelessWidget {
12061206
:content, :contentFocusNode,
12071207
) = controller;
12081208

1209-
return _ComposeBoxLayout(
1209+
return _ComposeBoxBody(
12101210
contentController: content,
12111211
contentFocusNode: contentFocusNode,
12121212
topicInput: null,
@@ -1316,15 +1316,15 @@ class _ComposeBoxState extends State<ComposeBox> implements ComposeBoxState {
13161316
switch (narrow) {
13171317
case ChannelNarrow():
13181318
assert(_controller is StreamComposeBoxController);
1319-
return _StreamComposeBox(controller: (_controller as StreamComposeBoxController),
1319+
return _StreamComposeBoxBody(controller: (_controller as StreamComposeBoxController),
13201320
narrow: narrow);
13211321
case TopicNarrow():
13221322
assert(_controller is FixedDestinationComposeBoxController);
1323-
return _FixedDestinationComposeBox(controller: (_controller as FixedDestinationComposeBoxController),
1323+
return _FixedDestinationComposeBoxBody(controller: (_controller as FixedDestinationComposeBoxController),
13241324
narrow: narrow);
13251325
case DmNarrow():
13261326
assert(_controller is FixedDestinationComposeBoxController);
1327-
return _FixedDestinationComposeBox(controller: (_controller as FixedDestinationComposeBoxController),
1327+
return _FixedDestinationComposeBoxBody(controller: (_controller as FixedDestinationComposeBoxController),
13281328
narrow: narrow);
13291329
case CombinedFeedNarrow():
13301330
case MentionsNarrow():

0 commit comments

Comments
 (0)