Skip to content

Re-arrange existing UI in AI Features screen #8935

Open
anikiki wants to merge 4 commits into
developfrom
feature/ana/rearrange_existing_ui_in_ai_features_screen
Open

Re-arrange existing UI in AI Features screen #8935
anikiki wants to merge 4 commits into
developfrom
feature/ana/rearrange_existing_ui_in_ai_features_screen

Conversation

@anikiki

@anikiki anikiki commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/1200581511062568/task/1215808956430402?focus=true
Tech Design URL (if applicable):

Description

Reorganizes the Duck Chat (AI Features) settings screen behind the aiFeaturesNativeControls feature flag.

The block of input-screen settings — the address-bar With AI / Without AI toggle, its description, "Default toggle position", Duck.ai shortcuts, automatic context attachment, and dividers — is extracted from activity_duck_chat_settings.xml into a reusable include_duck_ai_input_screen_settings.xml layout. This is a no-op refactor on its own (same views, same IDs, same behavior).

When aiFeaturesNativeControls is enabled, that block is relocated to the end of the settings screen (below the Search settings section) and gains its own "Duck.ai" section header with a top divider. The redundant searchSettingsSectionHeader is hidden in this mode. The new header + divider are only shown while the user has Duck.ai enabled. When the flag is disabled, the screen renders exactly as before.

Changes

  • include_duck_ai_input_screen_settings.xml (new) — extracted input-screen settings, root LinearLayout so it can be repositioned as a unit; adds duckAiSectionTopDivider + duckAiSectionHeader (both gone by default).
  • activity_duck_chat_settings.xml — replaces the inlined block with an <include android:id="@+id/inputScreenSettings">.
  • DuckChatSettingsViewModel.kt — adds ViewState.isNativeControlsEnabled, sourced from aiFeaturesNativeControls().isEnabled().
  • DuckChatSettingsActivity.kt — moves the block to the end once when the flag is on; gates header/divider visibility on flag + Duck.ai-enabled; hides the search section header in native-controls mode; routes the moved views through the include binding.
  • donottranslate.xml — new duckAiDuckAiSectionHeader ("Duck.ai") string.
  • DuckChatSettingsViewModelTest.kt — adds enabled/disabled coverage for isNativeControlsEnabled.

Steps to test this PR

Flag OFF (default / regression check)

  • Ensure aiChat → aiFeaturesNativeControls is disabled (remote config / dev settings).
  • Open Settings → AI Features (Duck.ai settings).
  • Verify the screen is unchanged: input-screen toggle, description, shortcuts, etc. appear right under the main "Duck.ai" enable toggle, in their original order. No "Duck.ai" section header appears.

Flag ON

  • Enable aiFeaturesNativeControls and reopen the AI Features settings screen.
  • Verify the input-screen settings block now appears at the bottom of the screen, below the Search settings section.
  • Verify a "Duck.ai" section header with a divider above it sits at the top of the relocated block.
  • Verify the old searchSettingsSectionHeader ("Search settings" header) is not shown.
  • Toggle the main Duck.ai enable switch off: the "Duck.ai" header and its top divider should disappear. Toggle it back on: they reappear.
  • Confirm the relocated controls still function (With AI / Without AI selection, Default toggle position dialog, shortcuts navigation, automatic context switch).

UI changes

Feature flag disabled (same as Prod) - Duck.ai enabled Feature flag enabled - Duck.ai enabled
Screenshot_20260619_120150 Screenshot_20260619_120244
Feature flag disabled (same as Prod) - Duck.ai disabled Feature flag enabled - Duck.ai disabled
Screenshot_20260619_120205 Screenshot_20260619_120254

Note

Low Risk
UI-only, feature-flagged layout reorder with no changes to settings storage or navigation; flag off preserves current production behavior.

Overview
Reorganizes the AI Features settings screen when aiFeaturesNativeControls is enabled, while keeping the default (flag off) layout unchanged.

Input-screen settings (With/Without AI toggle, default toggle position, shortcuts, automatic context, dividers) are extracted into include_duck_ai_input_screen_settings.xml and wired through IncludeDuckAiInputScreenSettingsBinding instead of the main activity layout. ViewState.isNativeControlsEnabled is added and sourced from duckChatFeature.aiFeaturesNativeControls().

When native controls are on, the activity moves that include to the bottom of the scroll content (below Search settings) once via moveInputScreenSettingsToEnd(), shows a Duck.ai section header and top divider only when Duck.ai is user-enabled, and hides the redundant Search settings section header. ViewModel tests cover the new flag state; setting persistence and navigation are unchanged.

Reviewed by Cursor Bugbot for commit 4a5c070. Bugbot is set up for automated code reviews on this repo. Configure here.

anikiki commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@anikiki anikiki changed the title Refactor Duck Chat settings UI to extract AI input screen settings layout. This will be used later. Re-arrange existing UI in AI Features screen Jun 19, 2026
@anikiki anikiki marked this pull request as ready for review June 19, 2026 11:06
@joshliebe joshliebe self-assigned this Jun 19, 2026

@joshliebe joshliebe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested, works as expected with the feature toggle enabled and disabled. LGTM! 🙂

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.

2 participants