Skip to content

Conversation

@jake-bassett
Copy link
Contributor

No description provided.

@netlify
Copy link

netlify bot commented Jul 25, 2025

Deploy Preview for harness-xd-review ready!

Name Link
🔨 Latest commit 0037a3e
🔍 Latest deploy log https://app.netlify.com/projects/harness-xd-review/deploys/6887e8d8a46bd1000851c63f
😎 Deploy Preview https://deploy-preview-2009--harness-xd-review.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for harness-design ready!

Name Link
🔨 Latest commit 0037a3e
🔍 Latest deploy log https://app.netlify.com/projects/harness-design/deploys/6887e8d86290820008e4b06b
😎 Deploy Preview https://deploy-preview-2009--harness-design.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jake-bassett jake-bassett marked this pull request as ready for review July 28, 2025 18:45
const { fullGitRef: baseRef } = useGitRef()

const mutation = useMutation(async ({ repoMetadata, baseRef, headRef }: AiPullRequestSummaryParams) => {
return fetch(getApiPath(`/api/v1/repos/${repoMetadata.path}/+/genai/change-summary`), {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this API not available on the Code service React query client?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. @abhinavrastogi-harness has called this out as a gap to the backend team.

}}
/>

{showAiLoader && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: Instead of blocking the textarea, should we display a loader within the button to indicate loading state?

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did try using the loading icon within the button as we discussed in our standup, but the behavior didn't really look right to me.

The loading spinner within the button appeared to the left of the AI icon. Since this is just an icon button, the width of the button remained the same and the two icons overflowed and were clipped. We could fix that and widen the button when the loader appears, but not sure that would be right either since it means all of the other buttons would then jog to the right while the loader appears.

Open to that behavior though if others feel that's what we want.

As for the blocking, I think we concluded we would block the editor for first cut to reduce corner cases like typing and changing the cursor selection index before the injected text returns from the async call. We can certainly workaround all those issues but figured we'd circle back after some feedback on whether it was worth the effort or not.

const isFirst = index === 0
return (
<Fragment key={`${comment}-${index}`}>
<Button
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we need to disable the button when AI call is in progress?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oooo. Good call out. Let me actually make this change before merging. Thanks!

jake-bassett and others added 2 commits July 28, 2025 14:07
…versation/pull-request-comment-box.tsx

Co-authored-by: praneshg239 <95267551+praneshg239@users.noreply.github.com>
@jake-bassett jake-bassett merged commit dda1b1f into main Jul 28, 2025
14 checks passed
@jake-bassett jake-bassett deleted the pull-request-ai-summary-button branch July 28, 2025 21:23
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.

3 participants