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

fix: [PIPE-24077]: pull request changes page diff viewer comments and filters #634

Merged
merged 5 commits into from
Jan 6, 2025

Conversation

shaurya-harness
Copy link
Contributor

pull request changes page diff viewer comments and filters

  1. activities data converted to comment threads - parent and reply comments for changes page - diff viewer
  2. save new comments using renderWidgetLine for changes page - diff viewer
  3. split/unified filter
  4. commits filter - shift select multiple commits
  5. copy comment link - scroll comment into view based on commentID
  6. mark / unmark diff files as viewed
Screenshot 2025-01-07 at 12 40 22 AM Screenshot 2025-01-07 at 12 41 59 AM Screenshot 2025-01-07 at 12 39 55 AM

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for harness-xd-review ready!

Name Link
🔨 Latest commit ee0f992
🔍 Latest deploy log https://app.netlify.com/sites/harness-xd-review/deploys/677c6027f6d48900089a5f74
😎 Deploy Preview https://deploy-preview-634--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 site configuration.

parentCommentId={parent.id}
handleSaveComment={handleSaveComment}
isLast={true}
contentClassName="px-4 py-2 w-[calc(100%-38px)]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this number 38px as a separate css variable? It'll help with readability and purpose of it.

}

// TODO: workon on filter and files viewed
export const PullRequestChangesFilter: React.FC<FilterViewProps> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: As suggested, component and it's props need to have naming convention in a similar manner. PullRequestChangesFilterProps

refetchActivities()
})
.catch(error => {
console.error('Failed to delete comment:', error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should show error inline in the UI, instead of dumping them in the console

refetchActivities()
})
.catch(error => {
console.error('Failed to update comment:', error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same


const handleUnmarkViewed = (filePath: string) => {
if (diffs) {
const newDiffs = diffs.map(diff => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this business logic be moved to the store instead?

@abhinavrastogi-harness abhinavrastogi-harness merged commit 3fdcb8d into main Jan 6, 2025
10 checks passed
@abhinavrastogi-harness abhinavrastogi-harness deleted the PR-changes-diffViewer branch January 6, 2025 23: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.

4 participants