Skip to content

Conversation

@ultmaster
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 14, 2025 09:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds interactive chat capabilities to the POML VSCode extension by introducing a prompt gallery, new chat participant integration, and passing inline context through the language server.

  • Extend PreviewParams with inlineContext and wire it through the LSP server
  • Register a new Prompt Gallery view with Add/Delete/Edit commands
  • Implement poml.runner chat participant and update activation/contribution points

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/poml-vscode/panel/types.ts Added inlineContext to PreviewParams for passing chat context
packages/poml-vscode/lsp/server.ts Initialized server-side context from inlineContext
packages/poml-vscode/extension.ts Registered prompt gallery, chat participant, and prompt commands
packages/poml-vscode/command/promptGallery.ts Implemented Add/Delete/Edit prompt commands
packages/poml-vscode/command/index.ts Exported new prompt gallery commands
packages/poml-vscode/chat/participant.ts Created chat participant handler to route chat requests
packages/poml-vscode/chat/gallery.ts Added PromptGalleryProvider and tree view registration
package.json Bumped engine, added activationEvents, views, commands, chatParticipant
gallery/chat.poml Added default POML chat template
Comments suppressed due to low confidence (3)

packages/poml-vscode/command/promptGallery.ts:12

  • [nitpick] New prompt gallery commands (AddPromptCommand, DeletePromptCommand, EditPromptCommand) lack unit tests; consider adding coverage for user inputs, validation, and state updates.
export class AddPromptCommand implements Command {

packages/poml-vscode/chat/participant.ts:2

  • The import path for getClient uses the package name instead of a relative path; update it to use a relative import (e.g., '../extension') to ensure the module resolves correctly.
import { getClient } from 'poml-vscode/extension';

packages/poml-vscode/chat/participant.ts:3

  • The types import should be relative ('../panel/types') rather than 'poml-vscode/panel/types' to match the extension's file structure and prevent resolution errors.
import { PreviewMethodName, PreviewParams, PreviewResponse } from 'poml-vscode/panel/types';

throw new Error(`Error rendering POML: ${errorMessage}`);
} else {
console.log('Rendered POML:', response.content);
// stream.button('View Rendered Prompt', )
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

[nitpick] This commented-out placeholder appears unfinished; consider removing it or implementing the intended button action to keep the codebase clean and clear.

Suggested change
// stream.button('View Rendered Prompt', )

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +26
getChildren(): PromptEntry[] {
return this.entries;
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

The getChildren method signature should accept an optional element parameter (getChildren(element?: PromptEntry)), matching the TreeDataProvider interface to avoid type errors.

Suggested change
getChildren(): PromptEntry[] {
return this.entries;
getChildren(element?: PromptEntry): PromptEntry[] {
if (!element) {
return this.entries; // Return root-level items
}
// Currently, no nested items are supported. Return an empty array for child items.
return [];

Copilot uses AI. Check for mistakes.
cursor[bot]

This comment was marked as outdated.

@ultmaster ultmaster enabled auto-merge (squash) July 14, 2025 09:18
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Prompt Comparison Fails with Object Recreation

The removePrompt and updatePrompt methods in PromptGalleryProvider rely on object reference equality to identify PromptEntry objects. This fails when PromptEntry objects are recreated (e.g., from storage) as they will be different instances. They should instead compare entries by a unique property, such as name.

packages/poml-vscode/chat/gallery.ts#L41-L49

removePrompt(entry: PromptEntry) {
this.update(this.entries.filter(e => e !== entry));
}
updatePrompt(entry: PromptEntry, newEntry: PromptEntry) {
const list = this.entries.map(e => (e === entry ? newEntry : e));
this.update(list);
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@ultmaster ultmaster merged commit 039303c into main Jul 14, 2025
4 checks passed
@ultmaster ultmaster deleted the chat-sample-removed branch August 27, 2025 00:52
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