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

Refactor settings into a single component across Chat/Ask #2111

Merged

Conversation

bnodir
Copy link
Contributor

@bnodir bnodir commented Nov 3, 2024

Purpose

We had a refactoring conversation below. In this PR, I tried that.

#2021 (comment)
I wish that I had refactored these settings to be in a single component, as now we have duplicated code each time we add a new setting. This is fine for this PR, but eventually I want to try a single Settings.tsx across Chat/Ask.

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.

[ ] Yes
[x] No

Does this require changes to learn.microsoft.com docs?

This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.

[ ] Yes
[x] No

Type of change

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

Code quality checklist

See CONTRIBUTING.md for more details.

  • The current tests all pass (python -m pytest).
  • I added tests that prove my fix is effective or that my feature works
  • I ran python -m pytest --cov to verify 100% coverage of added lines
  • I ran python -m mypy to check for type errors
  • I either used the pre-commit hooks or ran ruff and black manually on my code.

@zedhaque
Copy link
Contributor

zedhaque commented Nov 3, 2024

@bnodir - Nice work! Would it be worth exploring a single menu in the top-right main navigation (black header) for options like "Clear Chat," "Manage Uploads," and "Dev Settings"? These menu items could appear only when their respective settings are activated.

@pamelafox
Copy link
Collaborator

Is this a WIP as you're still testing it? You could add playwright tests to click each of the settings and check that the subsequent /chat or /ask network request had the expected options. Am not sure how much that'd slow the tests down to test each of them - you could do just one test that touched all the options, so it'd be one for chat and one for ask.

@pamelafox
Copy link
Collaborator

The code change looks good! I don't think this PR needs any additional UI changes, per @zedhaque's comments, as this is currently one that folks could merge fairly cleanly.

@zedhaque Are you finding the top-right links getting a bit cluttersome?

@zedhaque
Copy link
Contributor

zedhaque commented Nov 4, 2024

@pamelafox - The issue I was referring to is specifically with the “menu items” — options like “clear chat” or “upload file” quickly disappear as your chat progresses on both mobile and desktop. Having these items on a sticky navigation would allow users to start a new chat more easily. I understand the menu could get crowded on mobile, but we could use icons only on mobile and icons with text on desktop.

Yes, I totally agree it should be a different PR as it will be fairly straightforward to rollout. Cheers

@bnodir bnodir changed the title WIP: Refactor settings into a single component across Chat/Ask Refactor settings into a single component across Chat/Ask Nov 5, 2024
@bnodir
Copy link
Contributor Author

bnodir commented Nov 5, 2024

I have manually tested the changes, not with Playwright, and they were working as expected. Therefore, I removed WIP from the title.

Regarding document updates, at least data_ingestion.md needs to be edited with the Settings.tsx file path. Should I wait for #2118 to be merged?

Copy link

github-actions bot commented Nov 5, 2024

Check Broken Paths

We have automatically detected the following broken relative paths in your files.
Review and fix the paths to resolve this issue.

Check the file paths and associated broken paths inside them. For more details, check our Contributing Guide.

File Full Path Issues
docs/data_ingestion.md
#LinkLine Number
1../app/frontend/src/components/settings/Settings.tsx49

Copy link

github-actions bot commented Nov 5, 2024

Check Broken URLs

We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.

Check the file paths and associated broken URLs inside them. For more details, check our Contributing Guide.

File Full Path Issues
README.md
#LinkLine Number
1https://aka.ms/entgptsearchblog270
2https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/access-control-in-generative-ai-applications-with-azure/ba-p/3956408274
docs/deploy_lowcost.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/392916743
docs/customization.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/3929167120
docs/productionizing.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/azure-architecture-blog/azure-openai-landing-zone-reference-architecture/ba-p/388210286
docs/deploy_features.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers209
docs/data_ingestion.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers75
samples/data-ingestion/README.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers88
samples/chat/README.md
#LinkLine Number
1https://aka.ms/entgptsearchblog272
2https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/access-control-in-generative-ai-applications-with-azure/ba-p/3956408276

Copy link

github-actions bot commented Nov 5, 2024

Check Broken Paths

We have automatically detected the following broken relative paths in your files.
Review and fix the paths to resolve this issue.

Check the file paths and associated broken paths inside them. For more details, check our Contributing Guide.

File Full Path Issues
docs/data_ingestion.md
#LinkLine Number
1../app/frontend/src/components/settings/Settings.tsx60

Copy link

github-actions bot commented Nov 5, 2024

Check Broken URLs

We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.

Check the file paths and associated broken URLs inside them. For more details, check our Contributing Guide.

File Full Path Issues
README.md
#LinkLine Number
1https://aka.ms/entgptsearchblog291
2https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/access-control-in-generative-ai-applications-with-azure/ba-p/3956408295
docs/deploy_lowcost.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/392916743
docs/customization.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/3929167120
docs/productionizing.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/azure-architecture-blog/azure-openai-landing-zone-reference-architecture/ba-p/388210286
docs/deploy_features.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers209
docs/data_ingestion.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers78

@pamelafox
Copy link
Collaborator

The techcommunity link breakage is expected due to an ongoing upgrade of that site.
I am just adding a bit more to the playwright test on settings and will push that soon.
No changes needed from you @bnodir, as I also made the docs change.

Copy link

github-actions bot commented Nov 5, 2024

Check Broken Paths

We have automatically detected the following broken relative paths in your files.
Review and fix the paths to resolve this issue.

Check the file paths and associated broken paths inside them. For more details, check our Contributing Guide.

File Full Path Issues
docs/data_ingestion.md
#LinkLine Number
1/app/frontend/src/components/settings/Settings.tsx60

Copy link

github-actions bot commented Nov 5, 2024

Check Broken URLs

We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.

Check the file paths and associated broken URLs inside them. For more details, check our Contributing Guide.

File Full Path Issues
README.md
#LinkLine Number
1https://aka.ms/entgptsearchblog291
2https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/access-control-in-generative-ai-applications-with-azure/ba-p/3956408295
docs/deploy_lowcost.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/392916743
docs/customization.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/3929167120
docs/productionizing.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/azure-architecture-blog/azure-openai-landing-zone-reference-architecture/ba-p/388210286
docs/deploy_features.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers209
docs/data_ingestion.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers78

Copy link

github-actions bot commented Nov 5, 2024

Check Broken Paths

We have automatically detected the following broken relative paths in your files.
Review and fix the paths to resolve this issue.

Check the file paths and associated broken paths inside them. For more details, check our Contributing Guide.

File Full Path Issues
docs/data_ingestion.md
#LinkLine Number
1/app/frontend/src/components/settings/Settings.tsx60

Copy link

github-actions bot commented Nov 5, 2024

Check Broken URLs

We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.

Check the file paths and associated broken URLs inside them. For more details, check our Contributing Guide.

File Full Path Issues
README.md
#LinkLine Number
1https://aka.ms/entgptsearchblog291
2https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/access-control-in-generative-ai-applications-with-azure/ba-p/3956408295
docs/deploy_lowcost.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/392916743
docs/customization.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/3929167120
docs/productionizing.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/azure-architecture-blog/azure-openai-landing-zone-reference-architecture/ba-p/388210286
docs/deploy_features.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers209
docs/data_ingestion.md
#LinkLine Number
1https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers78

@pamelafox
Copy link
Collaborator

I believe all the broken links are either due to techcommunity blog outage or due to Settings.tsx not being in main branch yet, so I'll merge this.

Thanks @bnodir!

@pamelafox pamelafox merged commit 86b6dad into Azure-Samples:main Nov 5, 2024
12 of 14 checks passed
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.

3 participants