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

Force auth frontend #435

Merged
merged 7 commits into from
May 2, 2023
Merged

Force auth frontend #435

merged 7 commits into from
May 2, 2023

Conversation

asim-shrestha
Copy link
Contributor

  • Add a dialog for when web search is disabled
  • Add a dialog for when users try to deploy without signing in
  • Refactor settings dialog a bit

Note this is all frontend only

  • In the case of web search, even if they hack to enable it, the backend won't support it
  • In the case of deploying, even if they hack to deploy without signing in, we're no worse off than before

@asim-shrestha asim-shrestha requested a review from awtkns May 2, 2023 20:43
@vercel
Copy link

vercel bot commented May 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agent-gpt ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2023 9:09pm

@@ -76,6 +78,18 @@ const ChatWindow = ({
}
});

const handleChangeWebSearch = (value: boolean) => {
// Change this value when we can no longer support web search
const WEB_SEARCH_ALLOWED = false;
Copy link
Member

Choose a reason for hiding this comment

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

might be best to make this feature flag: eg NEXT_PUBLIC_FF_WEB_SEARCH_ENABLED. That way we can toggle it just by changing an env var

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah can change it in the future if we need. We shouldn't have this check for long I imagine

Comment on lines +85 to +90
if (WEB_SEARCH_ALLOWED) {
setIsWebSearchEnabled(value);
} else {
openSorryDialog?.();
setIsWebSearchEnabled(false);
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (WEB_SEARCH_ALLOWED) {
setIsWebSearchEnabled(value);
} else {
openSorryDialog?.();
setIsWebSearchEnabled(false);
}
if (!WEB_SEARCH_ALLOWED) openSorryDialog?.();
setIsWebSearchEnabled(WEB_SEARCH_ALLOWED);

return (
<Dialog header="Sorry! 😭" isShown={show} close={close}>
<p>Due to costs, we&apos;ve had to momentarily disable web search 🌐</p>
<br />
Copy link
Member

Choose a reason for hiding this comment

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

nit: Ideally instead of
i think we can just use flex gap spacing. eg: flex flex-col gap-2

src/components/SorryDialog.tsx Outdated Show resolved Hide resolved
src/components/SorryDialog.tsx Outdated Show resolved Hide resolved
src/pages/index.tsx Show resolved Hide resolved
Co-authored-by: Adam Watkins <hello@awtkns.com>
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