Skip to content

🧹 Remove legacy otherClicks field from AppStats and DailyStats#66

Closed
debugtheworldbot wants to merge 1 commit intomainfrom
cleanup-legacy-fields-15659256569634042498
Closed

🧹 Remove legacy otherClicks field from AppStats and DailyStats#66
debugtheworldbot wants to merge 1 commit intomainfrom
cleanup-legacy-fields-15659256569634042498

Conversation

@debugtheworldbot
Copy link
Owner

This PR removes the legacy otherClicks field and its associated migration logic from the AppStats and DailyStats structures.

🎯 What: Removed otherClicks from CodingKeys and deleted the backward compatibility block in init(from:).
💡 Why: Improving code health by removing dead code and simplifying the data model. The migration from otherClicks to specific side click fields has served its purpose.
Verification: Manually reviewed the code and verified with grep that no references to otherClicks remain. (Full build was not possible due to missing xcodebuild in the environment, but the changes are purely additive-removal and have been double-checked for syntax).
Result: A cleaner and more maintainable data model.


PR created automatically by Jules for task 15659256569634042498 started by @debugtheworldbot

I've removed the `otherClicks` field from the `AppStats` and `DailyStats` data models. This field was originally used for backward compatibility with older builds where side clicks were stored together. Since this migration is no longer needed, removing it cleans up the data model and improves maintainability.

- Removed `otherClicks` case from `CodingKeys` in `KeyStats/AppStats.swift` and `KeyStats/StatsManager.swift`.
- Removed backward compatibility decoding logic in `init(from:)` for both structures.
- Verified that all references have been successfully removed from the codebase.

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

Co-authored-by: debugtheworldbot <62830430+debugtheworldbot@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @debugtheworldbot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the data models for AppStats and DailyStats by eliminating a deprecated field and its corresponding decoding logic. This change improves code maintainability and simplifies the structures, as the migration purpose for the legacy field has been fulfilled.

Highlights

  • Legacy Field Removal: The otherClicks field has been removed from the CodingKeys enum in both AppStats and DailyStats structures.
  • Backward Compatibility Logic Deletion: The associated backward compatibility decoding logic for otherClicks in the init(from:) methods of AppStats and DailyStats has been deleted.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • KeyStats/AppStats.swift
    • Removed the otherClicks case from the CodingKeys enum.
    • Deleted the backward compatibility block that conditionally decoded otherClicks in the init(from:) method.
  • KeyStats/StatsManager.swift
    • Removed the otherClicks case from the CodingKeys enum within the DailyStats struct.
    • Deleted the backward compatibility block that conditionally decoded otherClicks in the DailyStats init(from:) method.
Activity
  • PR created automatically by Jules for task 15659256569634042498 started by @debugtheworldbot.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fb350b89d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 75 to 76
sideBackClicks = try container.decodeIfPresent(Int.self, forKey: .sideBackClicks) ?? 0
sideForwardClicks = try container.decodeIfPresent(Int.self, forKey: .sideForwardClicks) ?? 0
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Preserve legacy otherClicks during stats decoding

In DailyStats.init(from:), the decoder now defaults sideBackClicks and sideForwardClicks to 0 without any fallback from the legacy otherClicks key (and AppStats.init(from:) was changed the same way in this commit). For users upgrading directly from builds that only stored otherClicks, historical side-click counts will be dropped on load and then permanently overwritten on the next save, which is an irreversible data-loss regression for existing installations.

Useful? React with 👍 / 👎.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully removes the legacy otherClicks field and its associated backward compatibility logic from AppStats and DailyStats structures. The changes are clean and directly address the goal of improving code health by removing dead code, leading to a cleaner and more maintainable data model. The removal of otherClicks from CodingKeys and the init(from:) methods in both AppStats.swift and StatsManager.swift is well-executed.

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