Skip to content

Commit

Permalink
fixup! TF-3236 Display SearchSnippet in search result
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Nov 14, 2024
1 parent 2f40306 commit 047d30b
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 98 deletions.
1 change: 0 additions & 1 deletion core/lib/presentation/views/text/rich_text_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class _RichTextBuilderState extends State<RichTextBuilder> with AutomaticKeepAli
richTextWidthDebouncer.value = MediaQuery.sizeOf(context).width;

return SingleChildScrollView(
key: const PageStorageKey('rich_text_builder'),
physics: const NeverScrollableScrollPhysics(),
scrollDirection: Axis.horizontal,
child: text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,60 +38,70 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
var bodyView = controller.searchController.isSearchEmailRunning
? const EmailView()
: bodyLandscapeTablet;

switch(controller.dashboardRoute.value) {
case DashboardRoutes.thread:
return ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
desktop: bodyView,
tabletLarge: bodyView,
landscapeTablet: bodyView,
mobile: _buildScaffoldHaveDrawer(body: ThreadView()));
case DashboardRoutes.emailDetailed:
return ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
desktop: bodyView,
tabletLarge: bodyView,
landscapeTablet: bodyView,
mobile: const EmailView());
case DashboardRoutes.searchEmail:
return SafeArea(child: SearchEmailView());
case DashboardRoutes.sendingQueue:
bodyView = Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
child: _buildScaffoldHaveDrawer(body: const SendingQueueView())),
const VerticalDivider(width: 12),
const Expanded(child: EmailView()),
],
);
return ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
desktop: bodyView,
tabletLarge: bodyView,
landscapeTablet: bodyView,
mobile: _buildScaffoldHaveDrawer(body: const SendingQueueView()));
case DashboardRoutes.waiting:
return const Center(
child: SizedBox(
width: 30,
height: 30,
child: CupertinoActivityIndicator(color: AppColor.colorLoading)));
default:
return ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
desktop: bodyView,
tabletLarge: bodyView,
landscapeTablet: bodyView,
mobile: _buildScaffoldHaveDrawer(body: ThreadView()));
}

return IndexedStack(
index: controller.dashboardRoute.value == DashboardRoutes.searchEmail
? 0
: 1,
children: [
SearchEmailView(),
_buildMailboxDashboardViews(bodyView),
],
);
}),
),
);
}

Widget _buildMailboxDashboardViews(Widget bodyView) {
switch(controller.dashboardRoute.value) {
case DashboardRoutes.thread:
return ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
desktop: bodyView,
tabletLarge: bodyView,
landscapeTablet: bodyView,
mobile: _buildScaffoldHaveDrawer(body: ThreadView()));
case DashboardRoutes.emailDetailed:
return ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
desktop: bodyView,
tabletLarge: bodyView,
landscapeTablet: bodyView,
mobile: const EmailView());
case DashboardRoutes.sendingQueue:
bodyView = Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
child: _buildScaffoldHaveDrawer(body: const SendingQueueView())),
const VerticalDivider(width: 12),
const Expanded(child: EmailView()),
],
);
return ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
desktop: bodyView,
tabletLarge: bodyView,
landscapeTablet: bodyView,
mobile: _buildScaffoldHaveDrawer(body: const SendingQueueView()));
case DashboardRoutes.waiting:
return const Center(
child: SizedBox(
width: 30,
height: 30,
child: CupertinoActivityIndicator(color: AppColor.colorLoading)));
default:
return ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
desktop: bodyView,
tabletLarge: bodyView,
landscapeTablet: bodyView,
mobile: _buildScaffoldHaveDrawer(body: ThreadView()));
}
}

_buildScaffoldHaveDrawer({required Widget body}) {
return Scaffold(
key: controller.scaffoldKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,19 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
}),
_buildListButtonQuickSearchFilter(context),
Expanded(child: Obx(() {
switch(controller.dashboardRoute.value) {
case DashboardRoutes.thread:
return _buildThreadViewForWebDesktop(context);
case DashboardRoutes.emailDetailed:
return const EmailView();
default:
return const SizedBox.shrink();
}
return IndexedStack(
index: switch (controller.dashboardRoute.value) {
DashboardRoutes.thread => 0,
_ => 1,
},
children: [
_buildThreadViewForWebDesktop(context),
if (controller.dashboardRoute.value == DashboardRoutes.emailDetailed)
const EmailView()
else
const SizedBox.shrink(),
],
);
}))
]))
]))
Expand All @@ -142,50 +147,43 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
),
),
tabletLarge: Obx(() {
switch(controller.dashboardRoute.value) {
case DashboardRoutes.searchEmail:
return SearchEmailView();
case DashboardRoutes.emailDetailed:
return controller.searchController.isSearchEmailRunning
? const EmailView()
: _buildScaffoldHaveDrawer(
body: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
child: ThreadView()),
const VerticalDivider(width: 1),
const Expanded(child: EmailView()),
],
),
);
default:
return _buildScaffoldHaveDrawer(
body: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
return IndexedStack(
index: controller.dashboardRoute.value == DashboardRoutes.searchEmail
? 0
: 1,
children: [
SearchEmailView(),
if (controller.searchController.isSearchEmailRunning)
const EmailView()
else
_buildScaffoldHaveDrawer(
body: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
child: ThreadView()),
const VerticalDivider(width: 1),
const Expanded(child: EmailView()),
],
),
);
}
const VerticalDivider(width: 1),
const Expanded(child: EmailView()),
],
),
)
],
);
}),
mobile: Obx(() {
switch(controller.dashboardRoute.value) {
case DashboardRoutes.thread:
return _buildScaffoldHaveDrawer(body: ThreadView());
case DashboardRoutes.emailDetailed:
return const EmailView();
case DashboardRoutes.searchEmail:
return SearchEmailView();
default:
return _buildScaffoldHaveDrawer(body: ThreadView());
}
return IndexedStack(
index: switch (controller.dashboardRoute.value) {
DashboardRoutes.emailDetailed => 1,
DashboardRoutes.searchEmail => 2,
_ => 0,
},
children: [
_buildScaffoldHaveDrawer(body: ThreadView()),
const EmailView(),
SearchEmailView(),
],
);
}),
),
Obx(() => controller.composerOverlayState.value == ComposerOverlayState.active
Expand Down

0 comments on commit 047d30b

Please sign in to comment.