Skip to content

Commit 11bae04

Browse files
authored
feat move This Device memory filter into the filter sheet (#9978)
## What Moves the **This Device** memory filter chip out of the memories search row and into the filter bottom sheet (opened by the last icon on the search row). It now sits below the category options (All / System / Interesting / Manual), separated by a divider, and toggles without closing the sheet — matching the category options' behavior. - [page.dart](app/lib/pages/memories/page.dart): removed the standalone `FilterChip` from the search row (and its shimmer placeholder). - [memory_management_sheet.dart](app/lib/pages/memories/widgets/memory_management_sheet.dart): added the This Device row to the sheet; extracted a shared `_buildFilterOption` row builder reused by the category options. <img width="603" alt="This Device filter inside the filter sheet" src="https://github.com/user-attachments/assets/eabc6fad-5296-4840-870a-27d85d310fb2" /> ## Product invariants affected - INV-MEM-1 — UI-only relocation of the This Device filter control; filtering semantics and memory-tier behavior are unchanged. ## Verification - `dart format --line-length 120` on both files (no changes). - `flutter analyze` on both files — only pre-existing info-level lints, no warnings or errors. - `scripts/pr-preflight` local lane passes with this body. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/9978?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
2 parents c14774c + f207654 commit 11bae04

2 files changed

Lines changed: 30 additions & 16 deletions

File tree

app/lib/pages/memories/page.dart

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ class MemoriesPageState extends State<MemoriesPage> with AutomaticKeepAliveClien
211211
SizedBox(width: 44, height: 44, child: _buildShimmerButton()),
212212
const SizedBox(width: 8),
213213
SizedBox(width: 44, height: 44, child: _buildShimmerButton()),
214-
const SizedBox(width: 8),
215-
SizedBox(width: 44, height: 44, child: _buildShimmerButton()),
216214
],
217215
),
218216
),
@@ -293,14 +291,6 @@ class MemoriesPageState extends State<MemoriesPage> with AutomaticKeepAliveClien
293291
},
294292
),
295293
const SizedBox(width: 8),
296-
FilterChip(
297-
label: Text(context.l10n.memoryThisDevice, style: const TextStyle(fontSize: 12)),
298-
selected: provider.filterThisDeviceOnly,
299-
onSelected: provider.setFilterThisDeviceOnly,
300-
visualDensity: VisualDensity.compact,
301-
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
302-
),
303-
const SizedBox(width: 8),
304294
SizedBox(
305295
width: 44,
306296
height: 44,

app/lib/pages/memories/widgets/memory_management_sheet.dart

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,26 @@ class MemoryManagementSheet extends StatelessWidget {
6565
padding: const EdgeInsets.fromLTRB(20, 16, 16, 8),
6666
child: Text(context.l10n.filterMemories, style: AppStyles.title),
6767
),
68-
_buildFilterOption(context, context.l10n.filterAll, null),
69-
_buildFilterOption(context, context.l10n.filterSystem, MemoryCategory.system),
70-
_buildFilterOption(context, context.l10n.filterInteresting, MemoryCategory.interesting),
71-
_buildFilterOption(context, context.l10n.filterManual, MemoryCategory.manual),
68+
_buildCategoryFilterOption(context, context.l10n.filterAll, null),
69+
_buildCategoryFilterOption(context, context.l10n.filterSystem, MemoryCategory.system),
70+
_buildCategoryFilterOption(context, context.l10n.filterInteresting, MemoryCategory.interesting),
71+
_buildCategoryFilterOption(context, context.l10n.filterManual, MemoryCategory.manual),
72+
const Padding(
73+
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 8),
74+
child: Divider(height: 1, color: Colors.white10),
75+
),
76+
_buildFilterOption(
77+
context,
78+
context.l10n.memoryThisDevice,
79+
isSelected: provider.filterThisDeviceOnly,
80+
onTap: () => provider.setFilterThisDeviceOnly(!provider.filterThisDeviceOnly),
81+
),
7282
const SizedBox(height: 16),
7383
],
7484
);
7585
}
7686

77-
Widget _buildFilterOption(BuildContext context, String label, MemoryCategory? category) {
87+
Widget _buildCategoryFilterOption(BuildContext context, String label, MemoryCategory? category) {
7888
// If category is null, it represents "All"
7989
// For "All", it is selected if the set is empty.
8090
final bool isSelected;
@@ -84,7 +94,10 @@ class MemoryManagementSheet extends StatelessWidget {
8494
isSelected = provider.selectedCategories.contains(category);
8595
}
8696

87-
return InkWell(
97+
return _buildFilterOption(
98+
context,
99+
label,
100+
isSelected: isSelected,
88101
onTap: () {
89102
if (category == null) {
90103
provider.clearCategoryFilter();
@@ -93,6 +106,17 @@ class MemoryManagementSheet extends StatelessWidget {
93106
}
94107
// Do NOT pop here to allow multiple selections
95108
},
109+
);
110+
}
111+
112+
Widget _buildFilterOption(
113+
BuildContext context,
114+
String label, {
115+
required bool isSelected,
116+
required VoidCallback onTap,
117+
}) {
118+
return InkWell(
119+
onTap: onTap,
96120
child: Container(
97121
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
98122
child: Row(

0 commit comments

Comments
 (0)