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

Add dummy preference descriptions to open AI config widget #15166

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

Conversation

colin-grant-work
Copy link
Contributor

What it does

Fixes #15160 by adding preferences whose descriptions redirect users to the config widget to enable them to perform more advanced AI configuration.

How to test

  1. Open the settings and look for settings under 'AI Features ... Agents', 'AI Features ... Models', and 'AI Features ... Prompt Templates'
  2. You will find a dummy preference with a link to open the configuration widget.
  3. Click the link, and the config widget should open.

The third segment (details) is to work around #15165

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

It fulfills the purpose but I'm not so happy about the result as the "Edit in settings.json" is wildly misleading.

image

We might need to register a custom preference render to avoid producing it.

And if we're doing that, we could instead have a custom renderer for these sections and within there render the hint. This would allow us to avoid declaring a non-existing preference.

Generally speaking, supporting a description text for sections would be nice but might be out of scope for this issue.

@colin-grant-work
Copy link
Contributor Author

Generally speaking, supporting a description text for sections would be nice but might be out of scope for this issue.

I had the same thought. One easy workaround would be a special renderer for preferences with declared type null that just doesn't have any interactable at all.

@colin-grant-work colin-grant-work force-pushed the feature/ai-settings-redirect branch from f22b371 to ffc6c1c Compare March 13, 2025 05:07
@colin-grant-work colin-grant-work force-pushed the feature/ai-settings-redirect branch from ffc6c1c to 9e34269 Compare March 13, 2025 05:10
@colin-grant-work
Copy link
Contributor Author

I've pushed a commit that adds a renderer for preferences whose only declared type is null and confirmed that that includes only the three that I've added here so that only the message appears.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

I'm a bit torn because it works, however in the end it's still a hack.

It's a hack because we have many unintended side effects:

  • we register preferences although there are none
  • we offer these preferences in the JSON Editor for autocomplete etc.
  • we offer UI to copy the preferences name, id, etc. although they are useless
  • they influence search in the preferences UI

Of course the overall impact is minimal, and I also don't see any collateral as I can't think of a real world use case for preferences of type null.


Overall it would be much nicer to enrich sections to allow optional descriptions. Then we could add this text to these sections and avoid registering additional preferences.


However I don't want to block the merge if we want to tackle this in a follow up then

@@ -0,0 +1,52 @@
// *****************************************************************************
// Copyright (C) 2025 Eclipse GmbH and others.
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
// Copyright (C) 2025 Eclipse GmbH and others.
// Copyright (C) 2025 EclipseSource GmbH and others.

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

Successfully merging this pull request may close these issues.

[Theia AI] Add reference to AI configuration view in the settings
2 participants