Skip to content

Add native input footer plugin point with high-usage model notice - #9816

Open
YoussefKeyrouz wants to merge 1 commit into
developfrom
feature/youssef/chat_limit_messaging
Open

YoussefKeyrouz wants to merge 1 commit into
developfrom
feature/youssef/chat_limit_messaging

Conversation

@YoussefKeyrouz

@YoussefKeyrouz YoussefKeyrouz commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1216355756234757?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/72649045549333/task/1218250488028912?focus=true
API Proposals URL(s) (if applicable):

Description

Stacked PR 1

In this one I introduce the infrastructure for the footer and I use it for an easy use case: hard coded high model usage, just for visual testing.

Adds an internal plugin point for footers under the native Duck.ai input, and ships the first plugin: an informational notice shown while a high-usage model (Opus 4.8, hardcoded for now) is selected. The footer host is mounted below the input card on every native-input surface (top/bottom address bar, contextual sheet, contextual webview, contextual entry dialog). Only the highest-priority visible footer is rendered. Dismissal is persisted per model.

Everything is behind the duckAiUsageWarnings flag, default off. Usage-limit notices come in a later PR.

Steps to test this PR

Setup

  • Internal build. Enable duckAiUsageWarnings in Feature Flag Inventory, and make sure native chat input is enabled
  • Have a pro subscription that includes access to Opus 4.8
  • Note: If you ever dismiss the footer, you will need to reinstall the app to see it again as it's persisted. Better debug capabilities will be added in future PRs.

Address bar, Duck.ai mode

  • Top address bar: open the native input on the NTP in Duck.ai mode, focus the field.
  • Select Opus 4.8
  • Notice appears under the card
  • Bottom address bar: same check, notice sits under the card above the keyboard
  • Mixed (top bar, bottom toolbar): same check
  • Switch to Search: notice hides. Switch back to Duck.ai: notice returns
  • Close the input (back / scrim): exit animation runs without the notice
  • Rotate while the notice is showing: still aligned with the card

Model switching

  • Switch from Opus 4.8 to another model: notice hides immediately
  • Switch back to Opus 4.8: notice returns

Contextual Duck.ai

  • Open the contextual sheet dialog on a page: notice shows under the input with Opus 4.8 selected
  • Send a prompt so the sheet moves to the chat: notice shows with the input, hides when the input card hides

Edit prompt

  • Edit a sent message: the existing "Editing will replace..." footer is unchanged and the high-usage notice does not show

Flag off

  • Disable duckAiUsageWarnings: no notice anywhere, input cards look exactly as on develop

Dismiss

  • Dismiss with the X, switch models back and forth: notice stays hidden for Opus 4.8 (persisted across app restarts)

UI changes

Screenshot_20260921_042339 Screenshot_20260921_042326 Screenshot_20260921_042308

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown
Collaborator Author

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

@YoussefKeyrouz
YoussefKeyrouz force-pushed the feature/youssef/chat_limit_messaging branch 2 times, most recently from 4900449 to b31bd9c Compare September 21, 2026 12:29
@YoussefKeyrouz

Copy link
Copy Markdown
Collaborator Author

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Beyond the inline finding, I checked two other spots in this PR for similar failure modes and ruled them out for this PR (though worth watching for the two follow-up plugins mentioned in the description): NativeInputFooterDockLayout's elevation-sync (syncFooterElevation) only keeps shadow continuity for footers whose root view is a MaterialCardView — fine for HighUsageModelFooterView today, but silently a no-op for a differently-rooted future footer. And in HighUsageModelFooterPlugin, the in-memory locallyDismissedModelIds resets each time createFooter runs while the persisted write happens on appCoroutineScope asynchronously, so a very fast dismiss-then-reopen could show the notice again before the store catches up — a narrow, self-healing race rather than a correctness bug.

Extended reasoning...

This run's confirmed finding (missing .catch on HighUsageModelNoticeDismissalStore.dismissedModelIds, which per androidx DataStore's documented contract emits an IOException instead of a value on read failure) was verified directly in the file and is significant enough that a top-level approval isn't appropriate; it is already queued as an inline comment so it isn't restated here. Given a prior review already exists on an earlier version of this PR and the instructions call for staying silent unless something new and non-redundant is being added, I limited this message to the narrow "ruled out" exception: two additional code paths — the dock layout's MaterialCardView-only elevation sync and the dismiss/reopen timing in HighUsageModelFooterPlugin — were read and confirmed as real but non-blocking for this PR's scope (single plugin, best-effort race), which is new information not visible elsewhere in the thread. No other privacy, lateinit, or architecture-convention violations were found in the reviewed files beyond what's already flagged.

@YoussefKeyrouz
YoussefKeyrouz force-pushed the feature/youssef/chat_limit_messaging branch from b31bd9c to ec3ff8a Compare September 21, 2026 17:42
@YoussefKeyrouz
YoussefKeyrouz added this pull request to stack #9824 September 22, 2026 09:32
@YoussefKeyrouz
YoussefKeyrouz force-pushed the feature/youssef/chat_limit_messaging branch from ec3ff8a to 4f58be7 Compare September 23, 2026 12:00

This branch has not been deployed

No deployments
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