Skip to content

Conversation

@stormc
Copy link
Contributor

@stormc stormc commented Apr 4, 2025

Description

opts.visible is not respected for non-"system" roles in chat.

Related Issue(s)

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've updated the README and/or relevant docs pages
  • I've run make docs to update the vimdoc pages

For non-"system" roles, the condition is always true, hence
an opts.visible setting is not respected.
@olimorris
Copy link
Owner

Brilliant spot! Thanks for investigating and solving.

@olimorris olimorris merged commit ef9cdc6 into olimorris:main Apr 4, 2025
5 checks passed
@petobens
Copy link
Contributor

petobens commented Apr 5, 2025

Hi! Sorry but I don't quite get this change. Before the change if write a prompt like

 [' Bash Developer'] = {
            strategy = 'chat',
            description = 'Act as an expert Bash developer.',
            opts = {
                short_name = 'bash_role',
                is_slash_cmd = true,
                auto_submit = false,
                ignore_system_prompt = true,
            },
            prompts = {
                {
                    role = 'system',
                    content = [[
You are an expert Bash developer.
When giving code examples show the generated output.
]],
                    opts = { visible = true },
                },
                {
                    role = 'user',
                    content = [[]],
                },
            },
        }

and then as in the GIF invoke the action palette and run the prompt then i) the system prompt would be visible and ii) the opts = { visible = false } flag would make it invisible. However with the change in this commit the content is always invisible and the opts.visible flag doesn't seem to be honored.

Peek 2025-04-05 16-50

olimorris added a commit that referenced this pull request Apr 6, 2025
olimorris added a commit that referenced this pull request Apr 6, 2025
Revert "fix(ui): respect opts.visible for non-"system" roles (#1204)"

This reverts commit ef9cdc6.
@olimorris
Copy link
Owner

Yes I've noticed this has caused intended consequences with CodeCompanionChat. I've reverted this for now with #1218.

cleong14 pushed a commit to cleong14/codecompanion.nvim that referenced this pull request May 21, 2025
For non-"system" roles, the condition is always true, hence
an opts.visible setting is not respected.
cleong14 pushed a commit to cleong14/codecompanion.nvim that referenced this pull request May 21, 2025
…ris#1218)

Revert "fix(ui): respect opts.visible for non-"system" roles (olimorris#1204)"

This reverts commit ef9cdc6.
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.

[Bug]: opts.visible is not respected for non-"system" roles in chat

3 participants