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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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

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

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

@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

@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.

Signed-off-by: Vedansh Saini <[email protected]>
@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.

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.

1 participant