Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI Chat fullpage UI notices and polish #26678

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

petemill
Copy link
Member

@petemill petemill commented Nov 21, 2024

  • Shows a notice that the full-page feature is now available
  • Shows a notice when the conversation list is empty
  • Shows a notice when storage pref is disabled and offers an action to enable
  • Fixes FullPage showing as SidePanel mode when restoring browser state after startup
  • Optimizes loading by fetching initial properties as soon as JS is ready and not after first react render (seems to save up to 60ms on my machine, but that's in dev)
  • Shows a full-page loading indicator and other minor page-load visual polish
  • Fix "new conversation" button showing on collapsed navigation when conversation is already new
  • AI Chat conversation items get their intended max-width and line up with input box

image image image image image image

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@petemill petemill self-assigned this Nov 21, 2024
@petemill petemill requested a review from a team as a code owner November 21, 2024 03:27
@github-actions github-actions bot added CI/storybook-url Deploy storybook and provide a unique URL for each build puLL-Merge labels Nov 21, 2024
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@petemill petemill requested review from a team as code owners November 22, 2024 17:15
@github-actions github-actions bot added the CI/run-audit-deps Check for known npm/cargo vulnerabilities (audit_deps) label Nov 22, 2024
@petemill
Copy link
Member Author

Depends on brave/leo#912

@diracdeltas
Copy link
Member

does https://github.com/brave/reviews/issues/1703#issuecomment-2260662872 need to be addressed now or is this still all behind a feature flag?

Copy link
Member

@thypon thypon left a comment

Choose a reason for hiding this comment

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

security gtg

@petemill
Copy link
Member Author

@diracdeltas I'm not sure if this notice is enough to cover all that info, but yes it's still behind a feature flag and I'll ask if we've done enough when asking to remove that flag.

profile_prefs_->SetBoolean(prefs::kStorageEnabled, true);
}

void AIChatService::DismissStorageNotice() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We reach this if the user presses X on the top-right of the Conversation history popup in Leo, right? We also need an explicit "Don't do this" or "No thanks" button on that popup, otherwise this seems like a consent dark pattern. The language on that popup right now makes me think that the X will actually just dismiss the popup without actually opting me out of this feature change.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ShivanKaul The storage notice is dismissed either by clicking the X or after it's been viewed once for a few seconds.
As far as I understand, the opinion was that we did not need to present the opt-out preference inline as it's not going to affect any previous actions the user does, only the future actions. And that we don't need explicit opt-in permission from the user to store submitted conversations on their own computer (encrypted) for the AI chat feature. This seems more of a notice about the new feature. @mattmcalister

Conversation history
</message>
<message name="IDS_CHAT_UI_NOTICE_CONVERSATION_HISTORY_BODY" desc="Main text for the notice about conversation history">
Leo will now remember your previous conversations so you can go back to them. They are stored privately on your device, and you can delete them any time.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Leo will now remember your previous conversations so you can go back to them. They are stored privately on your device, and you can delete them any time.
Leo will now remember your conversations so you can go back to them. They are stored encrypted on your device, and you can delete them any time.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

<p>{getLocale('noticeConversationHistoryBody')}</p>
<p>
<a
href='#'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's make sure the help page for this feature gets reviewed before shipping.

Copy link
Member Author

Choose a reason for hiding this comment

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

this isn't the url it points to, it's the current Leo help page

Conversation history
</message>
<message name="IDS_CHAT_UI_NOTICE_CONVERSATION_HISTORY_BODY" desc="Main text for the notice about conversation history">
Leo will now remember your previous conversations so you can go back to them. They are stored privately on your device, and you can delete them any time.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe don't need the word previous here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

great minds @mkarolin

Copy link
Member Author

Choose a reason for hiding this comment

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

done

History is disabled
</message>
<message name="IDS_CHAT_UI_NOTICE_CONVERSATION_HISTORY_DISABLED_PREF" desc="Main text for a notice that the conversation history preference is disabled">
In order to view and search your previous conversations with Leo, you need to enable conversation history.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly here, I don't think we need the word "previous". Not blocking.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd argue previous in this case is necessary (although I'll remove the "and search" part because we don't have that). Feels a bit strange to be viewing a conversation (a non-stored one) with a notice saying "In order to view your conversations with Leo, you need to...".

@ShivanKaul
Copy link
Collaborator

It's hard to review this from a privacy/consent perspective just from the screenshots. I suggested changes for the text, but it's not clear to me if the intention is to block users from going back to the old behaviour on sidebar Leo (i.e. ephemeral-only chats). Does the "History is disabled" prompt block users from interacting with Leo?

@petemill petemill changed the title AI Chat fullpage notices AI Chat fullpage notices and polish Nov 23, 2024
@petemill petemill changed the title AI Chat fullpage notices and polish AI Chat fullpage UI notices and polish Nov 23, 2024
@petemill
Copy link
Member Author

Does the "History is disabled" prompt block users from interacting with Leo?

@ShivanKaul this prompt shows when the user has disabled the AI Chat history storage preference (which is enabled by default for all users). It does not block anything. It informs the user that conversations are ephemeral and won't show up in a list once the conversation is closed.

@petemill
Copy link
Member Author

It's hard to review this from a privacy/consent perspective just from the screenshots

@ShivanKaul In that case, I suggest we don't block this PR so that reviewers can easily use the feature end-to-end in nightly. Although if there are obvious required changes to these pieces then we should do them here. This also doesn't contain any initial opt-in changes that may be required.

Instead we can block feature flag removal unril privacy review is successful.

@brave brave deleted a comment from github-actions bot Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/run-audit-deps Check for known npm/cargo vulnerabilities (audit_deps) CI/storybook-url Deploy storybook and provide a unique URL for each build puLL-Merge
Projects
None yet
6 participants