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

UX: move templates to main LLM config tab, restyle #813

Merged
merged 9 commits into from
Sep 30, 2024

Conversation

awesomerobot
Copy link
Member

This updates the layout and styles of /admin/plugins/discourse-ai/ai-llms

These updates simplify the process a bit by showing the templates initially, and allows for more space to include details like the model description.

Before:

image

image

image

image

After:

image

image

image

<LinkTo
@route="adminPlugins.show.discourse-ai-llms.show"
class="btn btn-default"
@model={{or llm.id llm.llm.id}}
Copy link
Member Author

@awesomerobot awesomerobot Sep 27, 2024

Choose a reason for hiding this comment

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

After first configuring an LLM, when you save and it returns you to this list page the model is structured llm.llm.id and not llm.id so this avoids the error (which existed before this PR)

this fix doesn't seem ideal though, so if anyone has a suggestion I'd appreciate it!

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't check code locally for now, but I looked at the code quickly.

Can you show me what console.log(this.args.model) gives at this line https://github.com/discourse/discourse-ai/blob/main/assets/javascripts/discourse/components/ai-llm-editor-form.gjs#L95 please?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I borked the routing a bit when I separated that LLM route? Here is what the console.log gives:

image

Copy link
Member

Choose a reason for hiding this comment

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

I fixed this in my commit ... honestly I think it may be an issue with llms hallucinating code cause it had ai_persona there ... which is totally unrelated.

@SamSaffron
Copy link
Member

looking at this at the moment and cleaning some stuff (some issues around translation)

{{/if}}
<section class="ai-llms-list-editor__templates">
<div class="admin-page-subheader">
Copy link
Contributor

@martin-brennan martin-brennan Sep 30, 2024

Choose a reason for hiding this comment

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

</div>
</div>
<div class="ai-llms-list-editor__templates-list">
{{#each this.preConfiguredLlms as |llm|}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would really prefer these "section landing" tiles are reusable components, this is why I opened this draft PR https://github.com/discourse/discourse/pull/28477/files . At the least could you please extract this to a component in this PR then we can replace with a core version later?

Copy link
Member

Choose a reason for hiding this comment

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

lets do this in a followup, really want to land this. I addressed the rest of the feedback.

Fix list to handle models with no description
Remove hacky Or
Correct spec which was not confirming shape
Overloaded H3 semantics is a bit confusing, but we get to use
the component.
@SamSaffron
Copy link
Member

@martin-brennan fyi one little glitch here is that @awesomerobot wanted the element in the subheader to be an h2 ... I worked around it but now semantically stuff is a bit odd.

Not the end of the world but worth noting.

@SamSaffron SamSaffron merged commit 18ecc84 into main Sep 30, 2024
5 checks passed
@SamSaffron SamSaffron deleted the llms-settings-refactor branch September 30, 2024 07:15
@awesomerobot
Copy link
Member Author

@SamSaffron @martin-brennan ideally headings should always be sequential and we shouldn't be going from H1 to H3 on any pages

If H2 feels too large, we should adjust the size in the CSS rather than skipping sequence

@martin-brennan
Copy link
Contributor

@awesomerobot @SamSaffron will bring that feedback into dev for Ella. And I will make the section landing item component in core and use it here for the template list 👍

@martin-brennan
Copy link
Contributor

I have a PR now to use the section components from core #817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants