Skip to content

Conversation

@miya
Copy link
Member

@miya miya commented Apr 25, 2025

Task

  • #165074 [GROWI AI Next][エディターアシスタント] QuickMenuList のボタン (この記事の要約をつくる)等) クリック時に markdown 全文を送信できる
  • #165075 [GROWI AI Next][エディターアシスタント] エディターアシスタント時は要約モードの switch を表示しない

@miya miya requested a review from yuki-takei April 25, 2025 09:54
@miya miya self-assigned this Apr 25, 2025
@changeset-bot
Copy link

changeset-bot bot commented Apr 25, 2025

⚠️ No Changeset found

Latest commit: f52bd2c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR


const clickQuickMenuHandler = async(quickMenu: string) => {
isQuickMenuReqRef.current = true;
await onSubmit({ input: quickMenu });
Copy link
Contributor

Choose a reason for hiding this comment

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

onSubmit への引数に、markdown データ取得の種類 (送らない / ユーザーが選択中の箇所を送る / 全文を送る) を選択して付与できない?

Copy link
Member Author

Choose a reason for hiding this comment

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

FB に基づいて改修しました

commit: 7b2d7b5

@miya miya requested review from Copilot and yuki-takei April 28, 2025 07:23
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

This PR hides the summary mode switch in editor assistant mode and refactors the related messaging functions to consistently use a FormData object rather than separate parameters. Key changes include updating service interfaces in both knowledge assistant and editor assistant, adding a new view to generate the summary mode switch for knowledge assistant, and conditionally rendering input controls in the sidebar based on the active assistant mode.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
apps/app/src/features/openai/client/services/knowledge-assistant.tsx Updated function signatures and added summary mode switch view
apps/app/src/features/openai/client/services/editor-assistant.tsx Refactored postMessage and added form/resetForm support
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/AiAssistantSidebar.tsx Adjusted sidebar form usage and conditional rendering to hide summary switch in editor mode
Comments suppressed due to low confidence (1)

apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/AiAssistantSidebar.tsx:102

  • The identifier 'formForForKnowledgeAssistant' appears to have a repeated 'For' which may be a typo. It is recommended to rename it to 'formForKnowledgeAssistant' for better clarity.
const form = isEditorAssistant ? formForForEditorAssistant : formForForKnowledgeAssistant;

@miya miya requested a review from Copilot April 28, 2025 07:30
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

This PR improves the AI assistant functionality by hiding the summary mode switch for the editor assistant while maintaining it for the knowledge assistant. Key updates include changes to the form data structure and request payloads, conditionally rendering the summary mode switch, and unifying form handling in the sidebar.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/app/src/features/openai/client/services/knowledge-assistant.tsx Updated form handling and request payload for knowledge assistant with summary mode switch view
apps/app/src/features/openai/client/services/editor-assistant.tsx Revised form data to support markdown types and removed the summary mode control for editor assistant
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/AiAssistantSidebar.tsx Unified form selection and conditionally hid the summary mode switch for the editor assistant
Comments suppressed due to low confidence (1)

apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/AiAssistantSidebar.tsx:102

  • [nitpick] The variable name 'form' is ambiguous when it conditionally represents data for different assistants. Consider renaming it (e.g. 'activeForm') to improve code clarity.
const form = isEditorAssistant ? formForEditorAssistant : formForKnowledgeAssistant;

// positionRef.current = 0;
}
}, [codeMirrorEditor, detectedDiff, selectedText, yDocs?.secondaryDoc]);
}, [detectedDiff]);
Copy link

Copilot AI Apr 28, 2025

Choose a reason for hiding this comment

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

The dependency array for this effect has been reduced to only 'detectedDiff', but the effect body also references codeMirrorEditor, isTextSelected, and yDocs?.secondaryDoc. To avoid potential stale data issues, consider adding these dependencies.

Suggested change
}, [detectedDiff]);
}, [detectedDiff, setSelectedText, setDetectedDiff, lineRef]);

Copilot uses AI. Check for mistakes.
mergify bot added a commit that referenced this pull request Apr 30, 2025
@mergify
Copy link
Contributor

mergify bot commented Apr 30, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

mergify bot added a commit that referenced this pull request May 1, 2025
@mergify mergify bot merged commit 77857eb into master May 1, 2025
23 checks passed
@mergify mergify bot deleted the imprv/165077-hide-summary-mode-switch-in-editor-assistant-mode branch May 1, 2025 02:46
@github-actions github-actions bot mentioned this pull request May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants