Skip to content

feat(app): allow users to rename their Omi device#4749

Closed
eulicesl wants to merge 3 commits intoBasedHardware:mainfrom
eulicesl:feat/rename-device
Closed

feat(app): allow users to rename their Omi device#4749
eulicesl wants to merge 3 commits intoBasedHardware:mainfrom
eulicesl:feat/rename-device

Conversation

@eulicesl
Copy link
Copy Markdown

@eulicesl eulicesl commented Feb 11, 2026

Closes #2824

Summary

  • Add a rename dialog in Device Settings — tap the device name row to open it, long-press to copy
  • Extract updateDeviceNameOnConnect() into SharedPreferencesUtil to centralize device-switch detection/name preservation and remove duplicated logic
  • Introduce deviceNameDeviceId to track which device owns the custom name and avoid stale/overwritten btDevice.id edge cases
  • Show custom name on device home header (fallback to hardware name)
  • Preserve custom name on disconnect; clear on unpair/forget (clears both deviceName and deviceNameDeviceId)
  • Add 4 l10n keys: renameDevice, enterDeviceName, deviceNameCannotBeEmpty, deviceNameUpdated

Scope (current)

  • 41 files total (+602 / -10)
  • 5 functional files (feature logic/UI)
  • 36 localization files (app_en.arb + flutter gen-l10n generated outputs)
  • Localization files are intentionally included to keep context.l10n.* usage and generated APIs in sync for merge/build safety.

Demo

  • Note: Demo recorded on the dev/staging backend (api.omiapi.com), so the STAGING banner is expected; rename-device behavior is backend-agnostic.
ScreenRecording_03-12-2026.14-28-06_1.mp4

Changes

  • app/lib/backend/preferences.dart
  • app/lib/providers/device_provider.dart
  • app/lib/providers/onboarding_provider.dart
  • app/lib/pages/settings/device_settings.dart
  • app/lib/pages/home/device.dart
  • app/lib/l10n/app_en.arb + generated localization files

Copilot AI review requested due to automatic review settings February 11, 2026 15:24
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a useful feature for renaming devices. The implementation of the rename dialog and the logic to preserve the custom name on reconnection are well done. However, I've identified a couple of issues that should be addressed:

  1. Critical Bug: The 'Forget Device' functionality does not clear the custom device name, which is contrary to the feature's description and user expectations. This violates the rule about ensuring UI element actions are consistent with user expectations.
  2. Code Duplication: The logic for updating the device name on connection is repeated in five different places. This should be refactored into a single helper method to improve maintainability, aligning with the rule to prefer existing helper functions over inlining logic.

My detailed comments provide suggestions on how to fix these issues.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds end-user device renaming support and attempts to prevent automatic reconnections from overwriting a user-defined device name, with localization updates for the new UI strings.

Changes:

  • Add a rename dialog in Device Settings (tap to rename, long-press to copy).
  • Guard writes to SharedPreferencesUtil().deviceName in DeviceProvider/OnboardingProvider to preserve custom names.
  • Add new localization keys and regenerate localization outputs.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
app/lib/providers/onboarding_provider.dart Adds device-switch detection logic to avoid overwriting a stored custom device name during onboarding connections.
app/lib/providers/device_provider.dart Adds guarded deviceName writes intended to preserve user-defined names across reconnects and reset on device switch.
app/lib/pages/settings/device_settings.dart Adds rename dialog + tap/long-press handling; adjusts disconnect flow to avoid clearing deviceName.
app/lib/pages/home/device.dart Adjusts disconnect flow to avoid clearing deviceName.
app/lib/l10n/app_en.arb Adds 4 new English localization keys for the rename UI.
app/lib/l10n/app_localizations.dart Adds new abstract localization getters and documentation for rename UI strings.
app/lib/l10n/app_localizations_ar.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_bg.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_ca.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_cs.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_da.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_de.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_el.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_en.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_es.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_et.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_fi.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_fr.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_hi.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_hu.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_id.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_it.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_ja.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_ko.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_lt.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_lv.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_ms.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_nl.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_no.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_pl.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_pt.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_ro.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_ru.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_sk.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_sv.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_th.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_tr.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_uk.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_vi.dart Regenerated localization output including new keys.
app/lib/l10n/app_localizations_zh.dart Regenerated localization output including new keys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 41 out of 41 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@eulicesl eulicesl changed the title feat(app): allow users to rename their Omi device feat(app): allow users to rename their Omi device #2824 Feb 11, 2026
@eulicesl eulicesl changed the title feat(app): allow users to rename their Omi device #2824 feat(app): allow users to rename their Omi device Feb 11, 2026
@beastoin
Copy link
Copy Markdown
Collaborator

@eulicesl This PR has been inactive for 25 days. Are you still working on it? If so, please rebase on latest main and let us know — happy to review. Otherwise we'll close it to keep the queue current.


by AI for @beastoin

@eulicesl eulicesl force-pushed the feat/rename-device branch 3 times, most recently from 795b175 to ea81499 Compare March 12, 2026 18:50
@eulicesl
Copy link
Copy Markdown
Author

eulicesl commented Mar 12, 2026

Reviewer context (guideline alignment):

  • Scope is tied to bounty issue rename my Omi device ($300) #2824 and targets main.
  • Added required l10n keys and committed generated localization outputs to keep APIs in sync with source changes.
  • Manual verification completed for rename flow (validation, save/update, header display, disconnect/unpair behavior).
  • No public docs changes required for this internal settings/UI behavior update.
  • AI-assisted during development/PR prep; final code and behavior were manually reviewed and verified.

@eulicesl
Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown

@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.

Reviewed commit: 345b1dd4ee

ℹ️ 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".

@eulicesl
Copy link
Copy Markdown
Author

eulicesl commented Mar 13, 2026

@beastoin addressed Codex feedback on latest head fd6c0d0:

  • translated the 4 rename-device keys across all non-English locales and regenerated l10n outputs
  • fixed offline unpair path to clear deviceName and deviceNameDeviceId

PR is ready for final maintainer review when you have a moment. Thanks!

@eulicesl eulicesl force-pushed the feat/rename-device branch from fd6c0d0 to b02097b Compare March 16, 2026 18:25
@eulicesl
Copy link
Copy Markdown
Author

Superseding this stale/conflicted PR with a fresh replacement based on current main to reduce reviewer burden and avoid unrelated merge drift.

Replacement draft PR:

The new PR keeps the scope tight around #2824:

  • rename device from settings
  • persist custom name locally
  • preserve name across reconnects for the same device
  • reset to hardware name when switching devices
  • clear stored mapping on unpair/forget

I’m leaving the replacement as draft until CI/build checks pass.

@eulicesl
Copy link
Copy Markdown
Author

Closing this in favor of #5952.

To keep the maintainer review path clean and unambiguous, I refreshed the device-rename work on a current branch and moved it to:

Why supersede this PR:

  • this branch is now stale/conflicted against current main
  • feat(app): allow users to rename their Omi device #5952 is the clean rebased branch on top of current main
  • targeted validation was re-run there
  • that PR now reflects the canonical review path for the rename-device feature and bounty evidence

User-visible feature scope remains the same:

  • rename a device from settings
  • preserve the custom name across reconnects for the same physical device
  • reset to the hardware/default name when switching devices
  • clear custom-name ownership mapping on forget/unpair

Closing this older thread to remove ambiguity for maintainers.

@eulicesl eulicesl closed this Mar 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Hey @eulicesl 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our roadmap and vision

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community! 💜

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.

rename my Omi device ($300)

3 participants