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

feat: force polling for t8 #184

Merged
merged 3 commits into from
Oct 10, 2024
Merged

feat: force polling for t8 #184

merged 3 commits into from
Oct 10, 2024

Conversation

williamsjokvist
Copy link
Owner

@williamsjokvist williamsjokvist commented Oct 10, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a refresh button in the tracking live updater, allowing users to manually refresh data with a 15-second cooldown.
    • Added a new polling action to enhance the tracking functionality across various trackers.
    • Expanded the GameTracker interface to include a ForcePoll method for improved polling capabilities.
    • Implemented tooltips for replay IDs in the Matches List page for better user guidance.
    • Enhanced localization support by adding "Refresh" and "Cooldown" terms in English, French, and Japanese.
  • Bug Fixes

    • Improved the layout of buttons in the tracking live updater for better user experience.
  • Documentation

    • Updated public entity declarations to reflect new methods and state variables.

Copy link
Contributor

coderabbitai bot commented Oct 10, 2024

Walkthrough

The changes introduce several enhancements across multiple files. A new method, ForcePoll, is added to various tracker structs and the CommandHandler, enabling polling actions. The TrackingLiveUpdater component is updated to include a refresh button that triggers the forcePoll action, with a new state variable to manage its enabled/disabled state. Additionally, localization files are updated to include translations for "Refresh" and "Cooldown" in multiple languages. These updates collectively improve the functionality related to polling within the application.

Changes

File Change Summary
cmd/cmd.go Added method ForcePoll() to CommandHandler.
gui/src/pages/tracking/tracking-live-updater.tsx Added state variable refreshDisabled and a refresh button that triggers forcePoll action.
gui/src/pages/matches.tsx Added Tooltip component for rendering replay ID with improved tooltip functionality.
gui/src/ui/tooltip.tsx Introduced new Tooltip component for displaying tooltip messages.
pkg/i18n/locales/en_GB.go Added Refresh and Cooldown entries to Localization struct.
pkg/i18n/locales/fr_FR.go Added Refresh ("Rafraîchir") and Cooldown ("Refroidir") entries to Localization struct.
pkg/i18n/locales/ja_JP.go Added Refresh ("リフレッシュ") and Cooldown ("クールダウン") entries to Localization struct.
pkg/i18n/locales/model.go Added fields Refresh and Cooldown to Localization struct.
pkg/tracker/sf6/track.go Added method ForcePoll() to SF6Tracker.
pkg/tracker/sfv/track.go Added method ForcePoll() to SFVTracker.
pkg/tracker/t8/track.go Updated T8Tracker: added forcePollChan, ForcePoll() method, Authenticate() method, and simplified poll() method.
pkg/tracker/tracker.go Added method ForcePoll() to GameTracker interface.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TrackingLiveUpdater
    participant TrackingActor
    participant TrackingMachine

    User->>TrackingLiveUpdater: Click Refresh Button
    TrackingLiveUpdater->>TrackingActor: Send forcePoll action
    TrackingActor->>TrackingMachine: Trigger forcePoll event
    TrackingMachine->>CommandHandler: Call ForcePoll()
    CommandHandler->>Tracker: Execute polling logic
Loading

🐰 In the meadow, a button does gleam,
To refresh the data, oh what a dream!
With a hop and a click, the tracker will chase,
Polling for updates, at a swift pace.
New methods abound, in code they do play,
A joyful enhancement, hip-hip-hooray! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3deec18 and 39279ce.

📒 Files selected for processing (1)
  • pkg/tracker/t8/track.go (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/tracker/t8/track.go

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Outside diff range and nitpick comments (9)
pkg/tracker/tracker.go (1)

12-12: LGTM! Consider adding a comment for the new method.

The addition of the ForcePoll() method to the GameTracker interface is appropriate and aligns with the PR objectives. It provides a clear way to trigger polling on demand.

Consider adding a brief comment to describe the purpose of the ForcePoll() method, for example:

// ForcePoll triggers an immediate poll action, regardless of the regular polling interval.
ForcePoll()

This would improve the documentation and make the interface more self-explanatory for future developers.

gui/src/state/tracking-machine.ts (3)

33-35: Consider adding error handling to the forcePoll action.

The new forcePoll action is correctly implemented and placed within the actions object. However, it might be beneficial to add error handling to the ForcePoll function call.

Consider updating the action to include error handling:

forcePoll: ({ self }) => {
  ForcePoll().catch(error => self.send({ type: 'error', error }))
},

This change would make the error handling consistent with other actions in the file, such as startTracking and stopTracking.


96-98: LGTM: New event handler added correctly.

The forcePoll event handler is correctly implemented within the tracking state and triggers the forcePoll action when the event is received.

Consider adding a guard to ensure that force polling is only triggered when appropriate. For example:

forcePoll: {
  guard: 'canForcePoll',
  actions: ['forcePoll']
},

You would need to implement the canForcePoll guard in the guards section of the machine setup. This could prevent unnecessary polling and improve the overall efficiency of the application.


Line range hint 1-124: Summary: Force polling feature implemented correctly with room for minor improvements.

The changes to implement the force polling feature are well-structured and integrate seamlessly with the existing state machine. The new import, action, and event handler are all correctly implemented.

However, there are a few areas where the implementation could be further improved:

  1. Adding error handling to the forcePoll action.
  2. Implementing a guard for the forcePoll event to ensure it's only triggered when appropriate.

These improvements would enhance the robustness and efficiency of the force polling feature.

Consider implementing a rate limiting mechanism for the force poll action to prevent potential abuse or excessive server load. This could be done by adding a cooldown period after each force poll, implemented either in the state machine or at the API level.

pkg/tracker/sfv/track.go (1)

103-104: Consider integrating ForcePoll with the existing polling mechanism.

The ForcePoll method is currently isolated from the rest of the tracking logic. Consider how it should interact with the existing poll method and the isTracking state.

Some considerations for integration:

  1. Should ForcePoll be able to trigger a poll even when isTracking is false?
  2. How should ForcePoll interact with the regular polling interval in the poll method?
  3. Should there be a cooldown period between forced polls to prevent excessive API calls?

Example integration (to be adapted based on your specific requirements):

func (t *SFVTracker) ForcePoll() {
    if !t.isTracking {
        log.Println("Cannot force poll: tracking is not active")
        return
    }
    
    // Trigger an immediate poll
    go t.refreshMatchHistory(context.Background(), t.mh.CFN, false)
    
    // Optionally, reset the polling interval
    // This would require modifying the `poll` method to use a resettable timer
}

Remember to handle any potential race conditions and ensure thread safety when implementing this functionality.

gui/src/pages/tracking/tracking-live-updater.tsx (2)

120-142: LGTM: Good layout for new buttons, with a minor suggestion.

The new button layout using flexbox is well-structured and provides a good user experience. The refresh button is properly implemented with disabled state handling.

For consistency, consider using the t function for internationalization on the "Refresh" text, similar to how it's used for the "Stop" button:

-                Refresh
+                {t('refresh')}

This will ensure that the "Refresh" text can be easily translated in the future if needed.


124-130: LGTM: Refresh functionality implemented well, with suggestions for improvement.

The refresh functionality is implemented correctly, with a good approach to prevent rapid successive clicks. However, there are a few points to consider for improvement:

  1. The 15-second cooldown is hardcoded. Consider making this a configurable constant or prop.
  2. The use of setTimeout could potentially lead to memory leaks if the component unmounts before the timeout completes. Consider using useEffect for cleanup:
React.useEffect(() => {
  let timeoutId: number;
  if (refreshDisabled) {
    timeoutId = window.setTimeout(() => setRefreshDisabled(false), 15000);
  }
  return () => {
    if (timeoutId) window.clearTimeout(timeoutId);
  };
}, [refreshDisabled]);
  1. Consider adding error handling for the trackingActor.send call, in case the action fails.

Would you like me to provide a more detailed implementation of these suggestions?

cmd/cmd.go (1)

225-229: LGTM! Consider adding error handling.

The ForcePoll method is a good addition that aligns with the PR objective of forcing polling for t8. The nil check on ch.tracker is a good practice to prevent nil pointer dereference.

Consider adding error handling to propagate any errors that might occur during the poll:

-func (ch *CommandHandler) ForcePoll() {
+func (ch *CommandHandler) ForcePoll() error {
 	if ch.tracker != nil {
-		ch.tracker.ForcePoll()
+		return ch.tracker.ForcePoll()
 	}
+	return nil
}

This change assumes that ForcePoll() on the tracker returns an error. If it doesn't, you may need to modify the tracker interface to include error handling.

pkg/tracker/sf6/track.go (1)

324-324: Consider the integration of ForcePoll with the existing polling mechanism.

The addition of ForcePoll introduces a new way to interact with the polling mechanism. To ensure proper integration and avoid potential conflicts, consider the following suggestions:

  1. Update the SF6Tracker struct to include a mutex for thread-safe access to shared resources:
type SF6Tracker struct {
    // ... existing fields ...
    pollMutex sync.Mutex
}
  1. Modify the Start, Stop, and poll methods to use this mutex:
func (t *SF6Tracker) Start(ctx context.Context, userCode string, restore bool, pollRate time.Duration) error {
    t.pollMutex.Lock()
    defer t.pollMutex.Unlock()
    // ... existing implementation ...
}

func (t *SF6Tracker) Stop() {
    t.pollMutex.Lock()
    defer t.pollMutex.Unlock()
    t.stopPolling()
}

func (t *SF6Tracker) poll(ctx context.Context, userCode string, pollRate time.Duration) {
    t.pollMutex.Lock()
    defer t.pollMutex.Unlock()
    // ... existing implementation ...
}
  1. Implement ForcePoll to work harmoniously with the existing polling mechanism:
func (t *SF6Tracker) ForcePoll(ctx context.Context) error {
    t.pollMutex.Lock()
    defer t.pollMutex.Unlock()

    if !t.isAuthenticated {
        return errors.New("tracker not authenticated")
    }

    bl, err := t.fetchBattleLog(t.user.Code)
    if err != nil {
        return fmt.Errorf("failed to fetch battle log: %w", err)
    }

    return t.updateSession(ctx, bl)
}
  1. Consider adding a state variable to track whether polling is active, and use it in ForcePoll:
type SF6Tracker struct {
    // ... existing fields ...
    pollMutex sync.Mutex
    isPolling bool
}

func (t *SF6Tracker) ForcePoll(ctx context.Context) error {
    t.pollMutex.Lock()
    defer t.pollMutex.Unlock()

    if !t.isAuthenticated {
        return errors.New("tracker not authenticated")
    }

    if !t.isPolling {
        return errors.New("polling is not active")
    }

    // ... rest of the implementation ...
}

These changes will help ensure that ForcePoll integrates well with the existing polling mechanism and maintains thread-safety.

Would you like assistance in implementing these changes or further refining the polling mechanism?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 01a7d11 and e62ac59.

📒 Files selected for processing (7)
  • cmd/cmd.go (1 hunks)
  • gui/src/pages/tracking/tracking-live-updater.tsx (3 hunks)
  • gui/src/state/tracking-machine.ts (3 hunks)
  • pkg/tracker/sf6/track.go (1 hunks)
  • pkg/tracker/sfv/track.go (1 hunks)
  • pkg/tracker/t8/track.go (7 hunks)
  • pkg/tracker/tracker.go (1 hunks)
🧰 Additional context used
🔇 Additional comments (7)
pkg/tracker/tracker.go (1)

12-12: Verify implementation of ForcePoll() across the codebase

The addition of the ForcePoll() method to the GameTracker interface requires updates to all its implementations. Let's verify this change has been properly propagated.

Run the following script to check for GameTracker implementations and their ForcePoll() methods:

This script will help us ensure that:

  1. All GameTracker implementations have been updated with the ForcePoll() method.
  2. The ForcePoll() method is being used appropriately in the codebase.

Please review the script output and make any necessary adjustments to ensure full implementation and proper usage of the new method.

gui/src/state/tracking-machine.ts (1)

4-4: LGTM: New import added correctly.

The ForcePoll function is imported from the @cmd module, which is consistent with the existing import style and is used in the new forcePoll action.

gui/src/pages/tracking/tracking-live-updater.tsx (2)

34-35: LGTM: New state variable for managing refresh button state.

The addition of the refreshDisabled state variable is a good approach for managing the enabled/disabled state of the refresh button. The naming is clear and the initial value of false is appropriate.


Line range hint 1-143: Overall, good implementation of the refresh functionality with room for minor improvements.

The changes to the TrackingLiveUpdater component successfully implement the new refresh functionality. The code is well-structured and follows React best practices. Here's a summary of the main points:

  1. The new state variable refreshDisabled is appropriately used to manage the refresh button's state.
  2. The button layout is well-designed using flexbox.
  3. The refresh functionality is correctly implemented with a cooldown mechanism.

Consider the following improvements:

  1. Use internationalization for the "Refresh" button text.
  2. Make the cooldown duration configurable.
  3. Implement proper cleanup for the setTimeout using useEffect.
  4. Add error handling for the trackingActor.send call.

These changes will enhance the maintainability and robustness of the component.

cmd/cmd.go (2)

225-229: Summary: ForcePoll method addition enhances CommandHandler functionality.

The addition of the ForcePoll method to the CommandHandler struct is a well-implemented feature that aligns with the PR objective of forcing polling for t8. It integrates seamlessly with the existing code structure and enhances the flexibility of the tracking system.

Key points:

  1. The method correctly checks for a nil tracker before calling ForcePoll().
  2. It provides a way to manually trigger a poll action, complementing existing tracking functionality.
  3. The change doesn't introduce any breaking changes to the existing code structure.

Suggestions for improvement:

  1. Consider adding error handling to propagate any errors that might occur during the poll.
  2. Verify that the GameTracker interface includes the ForcePoll method to ensure consistency across the codebase.

Overall, this is a solid addition that enhances the CommandHandler's capabilities.


225-229: Verify GameTracker interface includes ForcePoll method.

The new ForcePoll method integrates well with the existing CommandHandler functionality. It enhances the tracking system by allowing manual poll triggers without introducing breaking changes.

Please run the following script to verify that the GameTracker interface includes the ForcePoll method:

If the script doesn't find a match, you may need to update the GameTracker interface to include the ForcePoll method.

pkg/tracker/t8/track.go (1)

114-117: ⚠️ Potential issue

Separate OS signal handling from force polling

Using t.forcePollChan to handle both OS interrupts and force polling can cause confusion and potential conflicts. Receiving an OS interrupt might unintentionally trigger a forced poll.

Modify the select case to work with the updated channel type:

 for {
     select {
-    case <-t.forcePollChan:
+    case <-t.forcePollChan:
         i++
         log.Println("forced poll", i)
         t.pollFn(ctx, session)

Ensure that OS signals are handled separately if needed.

Likely invalid or redundant comment.

pkg/tracker/sfv/track.go Show resolved Hide resolved
pkg/tracker/sf6/track.go Show resolved Hide resolved
pkg/tracker/t8/track.go Outdated Show resolved Hide resolved
pkg/tracker/t8/track.go Show resolved Hide resolved
pkg/tracker/t8/track.go Outdated Show resolved Hide resolved
pkg/tracker/t8/track.go Show resolved Hide resolved
pkg/tracker/t8/track.go Show resolved Hide resolved
pkg/tracker/t8/track.go Outdated Show resolved Hide resolved
pkg/tracker/t8/track.go Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (4)
gui/src/ui/tooltip.tsx (1)

8-21: LGTM: Well-structured component with good use of conditional rendering and animations.

The component structure is clean and makes good use of conditional rendering for the tooltip. The use of Framer Motion for animations is a nice touch for smooth transitions.

Consider adding an aria-label or title attribute to the wrapper div for improved accessibility, especially when the tooltip is disabled.

 <div
   className="group z-[9999] relative inline-flex justify-center"
+  aria-label={props.disabled ? undefined : props.text}
 >
pkg/i18n/locales/en_GB.go (1)

65-66: LGTM! Consider adding comments for context.

The new entries for "Refresh" and "Cooldown" are correctly added and appropriately translated for British English. These additions align well with the PR's objective of implementing force polling.

For consistency and to aid future maintenance, consider adding comments to explain the context or usage of these new entries, similar to how some other entries in this file might have comments (if applicable). For example:

// Used for the refresh button in the polling interface
Refresh: "Refresh",
// Indicates the cooldown period between polls
Cooldown: "Cooldown",
gui/src/pages/tracking/tracking-live-updater.tsx (2)

56-56: LGTM: Improved layout structure.

The new flex container improves the overall layout and allows for better positioning of the new refresh button.

Consider adding a comment explaining the calculation h-[calc(100%-32px)] for better maintainability.


121-137: LGTM: Well-implemented refresh button with cooldown logic.

The refresh button is correctly implemented with proper state management, cooldown logic, and integration with the trackingActor. The use of Tooltip for cooldown indication enhances the user experience.

Consider extracting the cooldown duration (15000ms) into a constant or configuration value for easier maintenance and potential future customization.

+ const REFRESH_COOLDOWN_MS = 15000;
  // ...
- setTimeout(() => setRefreshDisabled(false), 15000)
+ setTimeout(() => setRefreshDisabled(false), REFRESH_COOLDOWN_MS)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e62ac59 and 3deec18.

📒 Files selected for processing (8)
  • gui/src/pages/matches.tsx (2 hunks)
  • gui/src/pages/tracking/tracking-live-updater.tsx (6 hunks)
  • gui/src/ui/tooltip.tsx (1 hunks)
  • pkg/i18n/locales/en_GB.go (1 hunks)
  • pkg/i18n/locales/fr_FR.go (1 hunks)
  • pkg/i18n/locales/ja_JP.go (1 hunks)
  • pkg/i18n/locales/model.go (1 hunks)
  • pkg/tracker/t8/track.go (5 hunks)
🧰 Additional context used
🔇 Additional comments (12)
gui/src/ui/tooltip.tsx (2)

1-2: LGTM: Imports are correct and necessary.

The imports for React and Framer Motion's motion component are appropriate for this Tooltip component.


4-7: LGTM: Well-structured component declaration with proper typing.

The Tooltip component is correctly exported and uses appropriate TypeScript typing for its props. The use of React.PropsWithChildren is a good practice for components that wrap other elements.

pkg/i18n/locales/ja_JP.go (1)

65-66: LGTM! Translations are correct and consistent.

The added translations for "Refresh" (リフレッシュ) and "Cooldown" (クールダウン) are correct and commonly used in Japanese. They are consistent with the style of other entries in the file, using appropriate katakana for foreign-derived words. These additions align well with the new polling feature mentioned in the PR title.

pkg/i18n/locales/fr_FR.go (1)

65-66: Approve "Refresh" translation and suggest improvement for "Cooldown"

The translation for "Refresh" as "Rafraîchir" is correct and appropriate. However, the translation for "Cooldown" as "Refroidir" might not be the most suitable in this context.

For "Cooldown", consider using "Temps de recharge" or "Récupération" instead of "Refroidir". These terms are more commonly used in French gaming contexts to represent a cooldown period.

Suggested change:

 Refresh:                  "Rafraîchir",
-Cooldown:                 "Refroidir",
+Cooldown:                 "Temps de recharge",

To ensure consistency across other language files, you can run the following command:

This will help verify if other language files have a translation for "Cooldown" and how it's translated.

✅ Verification successful

Update "Cooldown" translation for better accuracy

The current translation for "Cooldown" as "Refroidir" may not accurately reflect its intended meaning in this context. Consider using "Temps de recharge" instead.

Suggested change:

 Refresh:                  "Rafraîchir",
-Cooldown:                 "Refroidir",
+Cooldown:                 "Temps de recharge",
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for the presence and translation of "Cooldown" in other language files
rg --type go -i 'cooldown.*:' pkg/i18n/locales

Length of output: 319

gui/src/pages/matches.tsx (3)

12-12: LGTM: New import for Tooltip component

The new import for the Tooltip component is correctly placed and follows good practices for importing internal components.


122-124: Great improvement: Simplified tooltip implementation

The changes to the replay ID cell rendering are a significant improvement:

  1. The code is more concise and readable by using the dedicated Tooltip component.
  2. Passing the tooltip text as a prop enhances maintainability.
  3. The span for the replay ID correctly handles overflow with appropriate CSS classes.
  4. The functionality for copying the replay ID is preserved.

These changes align well with React best practices and improve the overall code quality.


Line range hint 1-134: Overall assessment: Excellent improvements

The changes in this file are well-implemented and improve both the code quality and user experience:

  1. The introduction of the Tooltip component enhances the UI functionality.
  2. The refactoring of the replay ID cell rendering simplifies the code and improves maintainability.
  3. These changes are seamlessly integrated without disrupting the existing functionality.

Great job on these improvements!

pkg/i18n/locales/model.go (1)

65-66: LGTM! Consider verifying related files.

The addition of Refresh and Cooldown fields to the Localization struct looks good. The naming and JSON tags are consistent with the existing convention.

To ensure completeness, please verify that corresponding translations have been added to all language-specific localization files. Run the following script to check for the new keys in all JSON files:

This will help ensure that all necessary translations have been added for the new fields.

gui/src/pages/tracking/tracking-live-updater.tsx (4)

10-10: LGTM: New import for Tooltip component.

The import for the Tooltip component is correctly placed and will be used for the new refresh button functionality.


35-36: LGTM: New state variable for refresh button.

The refreshDisabled state variable is correctly implemented using the useState hook. Its purpose is clear, and it will be used to manage the disabled state of the new refresh button.


138-143: LGTM: Stop button properly integrated into new layout.

The stop button has been correctly repositioned within the new flex container, maintaining its original functionality while aligning with the updated layout.


Line range hint 1-180: Overall: Well-implemented refresh functionality with minor suggestions for improvement.

The changes to the TrackingLiveUpdater component effectively implement the new refresh functionality while maintaining the existing structure and functionality. The code is well-organized and follows React best practices. Consider implementing the suggested improvements for even better maintainability and flexibility.

gui/src/ui/tooltip.tsx Outdated Show resolved Hide resolved
pkg/tracker/t8/track.go Show resolved Hide resolved
pkg/tracker/t8/track.go Outdated Show resolved Hide resolved
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.

2 participants