Skip to content

UI extension, standalone scrum report #76

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

Merged
merged 9 commits into from
Jun 1, 2025

Conversation

vedansh-5
Copy link
Contributor

@vedansh-5 vedansh-5 commented Apr 2, 2025

Standalone Scrum Report with Markdown Link Support

Description

This PR implements a standalone scrum report section as part of the GSoC problem statement. The key features include:

  • Added a contenteditable div for live preview of the scrum report
  • Implemented GitHub data fetching with preserved hyperlinks
  • Implemented copy functionality to convert HTML links to Markdown format [Title](link)
  • Maintained proper formatting with line breaks and list structure
  • Improved user experience with rich text preview before copying

Testing

The feature can be tested by:

  1. Opening the extension popup
  2. Generating a scrum report
  3. Verifying links are clickable in preview
  4. Copying the report and checking the Markdown format

This enhancement improves the user experience by providing a WYSIWYG preview while ensuring the copied text is in a format suitable for platforms that support Markdown.

readme.md is also updated listing the new features.

scrumhelper.standalone.mp4

Summary by Sourcery

Implement a standalone scrum report feature in the browser extension with enhanced reporting capabilities, including live preview, GitHub data fetching, and Markdown link conversion.

New Features:

  • Add a standalone popup interface for generating scrum reports
  • Implement live preview of scrum reports with rich text formatting
  • Create a copy-to-clipboard function that converts HTML links to Markdown format

Enhancements:

  • Improve GitHub data fetching with more robust error handling
  • Enhance user interface for scrum report generation
  • Add support for both email and popup-based report generation

Documentation:

  • Update README.md to document new features and capabilities

Tests:

  • Add interactive testing capabilities for the new scrum report feature

Copy link
Contributor

sourcery-ai bot commented Apr 2, 2025

Reviewer's Guide by Sourcery

This pull request introduces a standalone scrum report feature with live preview, GitHub data fetching, and Markdown link conversion. It enhances the user experience by providing a WYSIWYG preview and ensuring the copied text is in a format suitable for platforms that support Markdown. The pull request also includes improvements to GitHub data fetching and updates the README with new feature descriptions.

Sequence diagram for generating scrum report in popup

sequenceDiagram
    participant User
    participant Popup
    participant Extension
    participant GitHub API

    User->>Popup: Opens popup
    User->>Popup: Enters GitHub username
    User->>Popup: Clicks 'Generate Report'
    Popup->>Extension: Calls generateScrumReport()
    Extension->>Extension: allIncluded('popup')
    Extension->>GitHub API: Fetches issues and PRs
    GitHub API-->>Extension: Returns data
    Extension->>Extension: Processes data and generates HTML report
    Extension->>Popup: Updates scrumReport div with HTML content
    Popup->>User: Displays report preview
Loading

Sequence diagram for copying scrum report to clipboard

sequenceDiagram
    participant User
    participant Popup
    participant Extension

    User->>Popup: Clicks 'Copy Report'
    Popup->>Extension: Handles copyReport()
    Extension->>Extension: Converts HTML links to Markdown
    Extension->>Extension: Removes state buttons
    Extension->>Extension: Replaces <br> with \n
    Extension->>Extension: Adds '- ' to list items
    Extension->>Extension: Removes <ul> tags
    Extension->>Extension: Trims whitespace
    Extension->>Extension: Copies Markdown to clipboard
    Extension->>Popup: Displays success message
    Popup->>User: Report copied to clipboard
Loading

File-Level Changes

Change Details Files
Introduces a standalone popup for generating scrum reports with live preview and Markdown conversion.
  • Added a popup HTML file with input fields and a contenteditable div for the scrum report.
  • Implemented JavaScript to generate the scrum report and display it in the contenteditable div.
  • Added functionality to copy the report to the clipboard, converting HTML links to Markdown format.
  • Added styling for the scrum report preview area.
  • Modified the report generation logic to support both email and popup targets.
  • Added event listeners to the generate and copy buttons in the popup.
src/index.css
src/popup.html
src/scripts/popup.js
src/scripts/scrumHelper.js
Enhances GitHub data fetching and error handling.
  • Improved error handling for GitHub API requests.
  • Added checks for GitHub username before fetching data.
  • Refactored GitHub data processing to improve readability and maintainability.
src/scripts/scrumHelper.js
Updates the README with new features and capabilities.
  • Added descriptions for the standalone popup interface, enhanced formatting, and email client integration.
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @vedansh-5 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a more robust error handling strategy for the GitHub API requests, perhaps with retry logic or more informative user feedback.
  • The logic for converting HTML to Markdown could be improved to handle more complex HTML structures.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vedansh-5
Copy link
Contributor Author

@sourcery-ai review on actual code

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @vedansh-5 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider creating a separate function to handle the GitHub API calls to improve readability.
  • The logic for generating the scrum report is quite complex; consider breaking it down into smaller, more manageable functions.
Here's what I looked at during the review
  • 🟡 General issues: 4 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vedansh-5
Copy link
Contributor Author

@hongquan, I’d really appreciate your feedback on these changes. Also, is there any other platform besides Glitter where I can discuss functionalities and any obstacles I encounter?

@vedansh-5
Copy link
Contributor Author

@hongquan Follow up on this PR, please have a look whenever you have some free time. Thanks.

@hpdang
Copy link
Member

hpdang commented May 30, 2025

@vedansh-5 the generated report looks very good! I tested it on the Gmail tab, but the content in the report and my Gmail draft don’t match. Do you know why?
scrum-generate-screen

@vedansh-5
Copy link
Contributor Author

@vedansh-5 the generated report looks very good! I tested it on the Gmail tab, but the content in the report and my Gmail draft don’t match. Do you know why? scrum-generate-screen

Thanks for pointing that out! That's new to me, I'll skim through the code and see what might be causing the mismatch between the report and the Gmail draft. I’ll let you know what I find.

@vedansh-5
Copy link
Contributor Author

@hpdang I could not reproduce the error of unmatched content but I did some potential fixes. Could you check if the bug persists or not? Thanks!

Signed-off-by: Vedansh Saini <[email protected]>
@hpdang
Copy link
Member

hpdang commented Jun 1, 2025

The problem only occurs when I uncheck the box for “Show past 1 day from today.” The issue was there when I defined a custom date range, the generated report content does not match the gmail prefilled data

Additionally, I’ve observed some unexpected behavior when using the extension on the Gmail tab:

  1. If the Scrum Helper prefills the Gmail draft first, the pop-up window does not generate the standalone scrum report screen. I have to either reload the page or close and reopen the popup to see it.

  2. Conversely, if I generate the scrum report in the popup first and then click Compose in Gmail, the scrum content is not auto-filled into the draft anymore. I need to reload the Gmail tab for the update to appear.

Does it mean the popup and Gmail draft prefill may be running independently, and can't work together in real-time without a reload?

These issue were not there in the approach of PR 79

@Preeti9764 could you please test this PR and confirm whether you face similar issues?

@Preeti9764
Copy link
Contributor

The problem only occurs when I uncheck the box for “Show past 1 day from today.” The issue was there when I defined a custom date range, the generated report content does not match the gmail prefilled data

Additionally, I’ve observed some unexpected behavior when using the extension on the Gmail tab:

  1. If the Scrum Helper prefills the Gmail draft first, the pop-up window does not generate the standalone scrum report screen. I have to either reload the page or close and reopen the popup to see it.
  2. Conversely, if I generate the scrum report in the popup first and then click Compose in Gmail, the scrum content is not auto-filled into the draft anymore. I need to reload the Gmail tab for the update to appear.

Does it mean the popup and Gmail draft prefill may be running independently, and can't work together in real-time without a reload?

These issue were not there in the approach of PR 79

@Preeti9764 could you please test this PR and confirm whether you face similar issues?

Thank you for pointing this out, @hpdang . I’ll look into this and test the PR to verify the behavior. I’ll share my observations shortly.

@hpdang
Copy link
Member

hpdang commented Jun 1, 2025

@Preeti9764 I tested again with the recent push, popup and gmail prefill can run now together but the unmatched issue is still there

@Preeti9764
Copy link
Contributor

Thanks for testing it again, @hpdang . I'm glad to hear the popup and Gmail prefill now work together. I'll investigate the remaining mismatch issue between the standalone preview and the Gmail content and work on aligning them correctly.

@vedansh-5
Copy link
Contributor Author

Thanks for testing it again, @hpdang . I'm glad to hear the popup and Gmail prefill now work together. I'll investigate the remaining mismatch issue between the standalone preview and the Gmail content and work on aligning them correctly.

@Preeti9764 Are you facing the same issues?

@hpdang hpdang assigned Preeti9764 and unassigned Preeti9764 Jun 1, 2025
@hpdang hpdang requested a review from Preeti9764 June 1, 2025 15:46
@vedansh-5 vedansh-5 self-assigned this Jun 1, 2025
@hpdang
Copy link
Member

hpdang commented Jun 1, 2025

@vedansh-5 please resolve conflicts

@vedansh-5
Copy link
Contributor Author

@vedansh-5 please resolve conflicts

Resolved the conflicts, good to merge!

@hpdang hpdang self-requested a review June 1, 2025 17:02
@hpdang hpdang merged commit 8e743ab into fossasia:master Jun 1, 2025
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