-
Notifications
You must be signed in to change notification settings - Fork 79
Feature standalone popup #75
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
base: master
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request introduces a 'Standalone' tab to the SCRUM Helper extension, enabling users to generate and copy reports directly from the popup. The implementation includes a new UI section with a textarea and buttons for report generation and clipboard copying. A background script was added to forward messages from the popup to the content script. Sequence Diagram for Standalone Report GenerationsequenceDiagram
participant User
participant Popup
participant ChromeStorage
participant Clipboard
User->>Popup: Clicks 'Generate Report'
Popup->>ChromeStorage: Get stored data (username, project name, etc.)
ChromeStorage-->>Popup: Returns stored data
Popup->>Popup: Generates report
Popup->>Popup: Displays report in textarea
User->>Popup: Clicks 'Copy to Clipboard'
Popup->>Clipboard: Copies report to clipboard
Clipboard-->>Popup: Acknowledges copy
Popup->>User: Shows success message
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @yaxit24 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using a more robust state management solution for tab visibility instead of directly manipulating
display
styles. - The
generateStandaloneReport
function duplicates some logic from the content script; consider refactoring to share code.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -169,3 +169,128 @@ userReasonElement.addEventListener('keyup', handleUserReasonChange); | |||
document.addEventListener('DOMContentLoaded', handleBodyOnLoad); | |||
document.getElementById('codeheatTab').addEventListener('click', handleCodeheatClick); | |||
document.getElementById('gsocTab').addEventListener('click', handleGsocClick); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider creating a helper function for tab switching to reduce code duplication and improve readability by defining DOM references once and avoiding inline anonymous functions for click listeners, which significantly reduces complexity and improves maintainability without altering functionality
Consider extracting and reusing common functionality to reduce duplication and nesting. For example, you can create a helper function for tab switching instead of providing nearly identical inline click listeners. This refactoring also lets you define DOM references once in the DOMContentLoaded handler. For instance:
// Helper to switch tabs
function switchTab(showEl, hideEl) {
showEl.style.display = 'block';
hideEl.style.display = 'none';
}
document.addEventListener('DOMContentLoaded', function() {
// Initialize tabs if Materialize is available
if (typeof M !== 'undefined' && M.Tabs) {
const tabs = document.querySelectorAll('.tabs');
M.Tabs.init(tabs);
}
// Cache elements
const mainSettings = document.getElementById('main-settings');
const standalone = document.getElementById('standalone');
// Tab click event handlers using the helper function
document.getElementById('codeheatTab').addEventListener('click', () => {
switchTab(mainSettings, standalone);
});
document.getElementById('gsocTab').addEventListener('click', () => {
switchTab(mainSettings, standalone);
});
document.getElementById('standaloneTab').addEventListener('click', () => {
switchTab(standalone, mainSettings);
});
// Standalone report functionality remains unchanged
const generateReportBtn = document.getElementById('generate-report');
const copyReportBtn = document.getElementById('copy-report');
if (generateReportBtn) {
generateReportBtn.addEventListener('click', generateStandaloneReport);
}
if (copyReportBtn) {
copyReportBtn.addEventListener('click', copyToClipboard);
}
});
These changes extract duplicated logic into a single function, reduce inline anonymous functions, and make the flow easier to follow without altering any functionality.
@hongquan, @mariobehling, please review my changes. |
Changes made: I've added a standalone tab to the SCRUM Helper extension, enabling users to generate and copy reports directly from the popup without needing email clients. The implementation includes a clean, user-friendly interface with a text area for editing reports and buttons for convenient report generation and clipboard copying. The design follows the extension's existing style patterns, ensuring a seamless experience while giving users more flexibility in how they create and share their SCRUM reports.
Screenshots for the change:


Summary by Sourcery
Add a standalone report generation tab to the SCRUM Helper extension, allowing users to create and copy reports directly from the popup
New Features:
Enhancements:
Chores: