Skip to content

[Feature] new UI #83

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

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

[Feature] new UI #83

wants to merge 10 commits into from

Conversation

vedansh-5
Copy link
Contributor

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

Closes #67
stand alone popup UI

Summary by Sourcery

Implement a standalone popup UI for the Scrum Helper extension with enhanced functionality and a new design using Tailwind CSS

New Features:

  • Added a new popup interface with a generate and copy report functionality
  • Introduced a new option to generate reports for yesterday's contributions
  • Implemented a standalone report generation mechanism for the popup

Enhancements:

  • Redesigned the UI using Tailwind CSS for a more modern look
  • Improved error handling and logging in GitHub data fetching
  • Added more flexible report generation with different output targets

Build:

  • Added Tailwind CSS and related build dependencies
  • Updated package.json to include new development dependencies

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

sourcery-ai bot commented Apr 9, 2025

Reviewer's Guide by Sourcery

This pull request introduces a new popup UI for the scrum helper extension, refactors the scrum report generation logic to support both email and popup contexts, and updates the project's dependencies to include Tailwind CSS for improved styling. It also adds a new script for handling popup-specific interactions, including generating and copying the scrum report.

Sequence Diagram for Generating Scrum Report in Popup

Loading
sequenceDiagram
    participant User
    participant PopupUI
    participant ScrumHelper
    participant GitHubAPI

    User->>PopupUI: Opens popup
    PopupUI->>User: Displays configuration options
    User->>PopupUI: Configures options (username, dates, etc.)
    User->>PopupUI: Clicks "Generate Report"
    PopupUI->>ScrumHelper: Calls generateScrumReport()
    ScrumHelper->>ScrumHelper: allIncluded('popup')
    alt GitHub Username is provided
        ScrumHelper->>GitHubAPI: Fetches issues and PRs
        GitHubAPI-->>ScrumHelper: Returns data
    else GitHub Username is not provided
        ScrumHelper->>PopupUI: Displays 'Please enter your GitHub username' message
    end
    ScrumHelper->>ScrumHelper: Processes data and formats report
    ScrumHelper->>PopupUI: Updates scrumReport element with content
    PopupUI->>User: Displays generated report

File-Level Changes

Change Details Files
Refactors the allIncluded function to support generating scrum reports for both email and popup contexts, and includes handling for GitHub username input and date range selection.
  • Modified the allIncluded function to accept an outputTarget parameter, defaulting to 'email'.
  • Added logic to display a toast message in the popup if the GitHub username is missing.
  • Adjusted date handling to include a 'yesterday' option.
  • Modified the date range selection logic to exclude dates if lastWeekContribution or yesterday is enabled.
  • Added error handling for GitHub data fetching.
  • Refactored the scrum report content generation to support both email and popup targets.
  • Added a generateScrumReport function to trigger report generation for the popup.
  • Added a click listener to the 'New conversation' button to trigger allIncluded function.
src/scripts/scrumHelper.js
Implements a new popup UI using Tailwind CSS for improved styling and user experience, including form elements for project name, GitHub username, date range selection, and scrum report generation.
  • Replaced Materialize CSS with Tailwind CSS for styling.
  • Implemented a new layout with form elements for project name, GitHub username, and date range selection.
  • Added a switch for enabling/disabling the scrum helper.
  • Implemented a tabbed interface for CodeHeat and GSoC settings.
  • Added a checkbox for showing open/closed labels.
  • Added an input field for the user's reason for blockers.
  • Implemented a scrum report display area with a generate button.
  • Added a note section with information about PR fetching and potential discrepancies.
  • Added a link to the GitHub repository.
  • Added JavaScript files for main functionality, scrum helper, and popup interactions.
src/popup.html
Updates the project's dependencies and configuration to include Tailwind CSS and related tooling, and includes basic styling.
  • Added Tailwind CSS, Autoprefixer, and PostCSS as dev dependencies.
  • Added a Tailwind CSS CLI dependency.
  • Created a tailwindcss.css file with Tailwind CSS imports and basic styling.
  • Updated the package.json file with new scripts for Tailwind CSS.
package.json
src/index.css
src/tailwindcss.css
Adds a new script for handling popup-specific interactions, including generating and copying the scrum report.
  • Added event listeners to the generate and copy buttons.
  • Implemented the generate button functionality to trigger scrum report generation.
  • Implemented the copy button functionality to copy the scrum report to the clipboard.
  • Implemented markdown formatting for links in the copied report.
  • Removed state buttons from the copied report.
  • Replaced line breaks with newlines in the copied report.
  • Added list item formatting for the copied report.
  • Trimmed whitespace from the copied report.
src/scripts/popup.js

Assessment against linked issues

Issue Objective Addressed Explanation
#67 Implement a standalone popup UI independent of email clients.

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

@vedansh-5
Copy link
Contributor Author

This PR has correct fetch logic but lacks some basic and some important tweaks.

Signed-off-by: Vedansh Saini <[email protected]>
@vedansh-5
Copy link
Contributor Author

Fine tuned ui.

Signed-off-by: Vedansh Saini <[email protected]>
Signed-off-by: Vedansh Saini <[email protected]>
@vedansh-5
Copy link
Contributor Author

In these latest changes I have added a toggleRadio function and fixed the enable disable toggle.

Signed-off-by: Vedansh Saini <[email protected]>
Signed-off-by: Vedansh Saini <[email protected]>
Signed-off-by: Vedansh Saini <[email protected]>
@vedansh-5
Copy link
Contributor Author

In the latest changes I fixed the toggleRadio functionality and improved the enable disable toggle.

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.

[Feature] Implement a standalone pop-up UI.
1 participant