Skip to content

Conversation

@prateekmedia
Copy link
Member

Description

Previously, tapping "Custom order" from a different sort order would only switch to custom order but not open the rearrange screen. Users had to tap the sort button again and click "edit" beside Custom order to access it.

Fixed by removing the condition that checked if the current sort was already manual, so now selecting custom order immediately opens the rearrange screen.

Tests

  • Test on simulator

Previously, tapping "Custom order" from a different sort order would only
switch to custom order but not open the rearrange screen. Users had to tap
the sort button again and click "edit" beside Custom order to access it.

Fixed by removing the condition that checked if the current sort was already
manual, so now selecting custom order immediately opens the rearrange screen.
@prateekmedia prateekmedia marked this pull request as ready for review November 8, 2025 07:44
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1348 to 1353
currentKey: PreferenceService.instance.codeSortKey(),
onSelected: (newOrder) async {
await PreferenceService.instance.setCodeSortKey(newOrder);
if (newOrder == CodeSortKey.manual && newOrder == _codeSortKey) {
if (newOrder == CodeSortKey.manual) {
await navigateToReorderPage(_allCodes!);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard against null codes before navigating to reorder screen

The null assertion _allCodes! is now reached whenever the user taps “Custom order”, even if the codes list has not finished loading. Early in page startup _allCodes is still null, so changing the sort to manual immediately triggers a crash before the codes stream populates. The previous condition required the current sort to already be manual, which significantly reduced the chance of hitting this path before _allCodes was initialized. Consider skipping navigation or awaiting data when _allCodes is null to avoid a runtime exception.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant