Skip to content

Conversation

@gemdev111
Copy link
Contributor

  • Remove empty feature modules: WalletAvatar, PriceWidget, Currency, NameResolver
  • Rename TransactionService → TransactionStateService (module, type, and variable names)
  • Consolidate duplicate date formatters into shared RelativeDateFormatter in Formatters package
  • Remove ConnectionDateFormatter wrapper (now uses RelativeDateFormatter directly)
  • Remove deprecated StateLoadingView component (zero usages)
  • Remove empty/unused directories: Packages/JobRunner/, Services/
  • Add unit tests for RelativeDateFormatter

Replaces all usages and dependencies of TransactionService with TransactionStateService across the codebase, including environment values, factories, view models, and package manifests. Updates import paths, test kits, and related service initializations. Also moves and generalizes the relative date formatter to a shared Formatters package, updates usages, and adds tests. Removes deprecated StateLoadingView and refactors InputValidationField and FloatTextField to use onClean instead of onWillClean.
@gemdev111 gemdev111 self-assigned this Dec 24, 2025
@gemdev111 gemdev111 changed the title Cleanup Minor improvements, cleanup Dec 24, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gemdev111, 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 focuses on significant code cleanup and refactoring to enhance the project's maintainability, clarity, and overall efficiency. Key changes include the removal of unused components and modules, the standardization of naming conventions for a core service, and the centralization of common utility functions like date formatting. These efforts are aimed at reducing technical debt and making the codebase more understandable and extensible for future development.

Highlights

  • Module and Directory Cleanup: Eliminated several empty or unused feature modules (WalletAvatar, PriceWidget, Currency, NameResolver) and directories (Packages/JobRunner/, Services/), streamlining the project structure.
  • Transaction Service Renaming: The core TransactionService has been comprehensively renamed to TransactionStateService across the codebase, including module, type, and variable names, to more accurately reflect its responsibility for managing transaction states.
  • Date Formatter Consolidation: Duplicate date formatting logic has been consolidated into a new shared RelativeDateFormatter within the Formatters package. This replaces previous ad-hoc implementations and removes the redundant ConnectionDateFormatter wrapper.
  • Deprecated Component Removal: The StateLoadingView component, which was deprecated and had no active usages, has been completely removed from the codebase.
  • Input Field Callback Renaming: The onWillClean callback in FloatTextField and InputValidationField components has been renamed to onClean for clearer and more consistent semantic meaning.
  • New Unit Tests: Unit tests have been added for the newly introduced RelativeDateFormatter to ensure its correctness and reliability.

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

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

@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 introduces several valuable improvements and cleanups. The renaming of TransactionService to TransactionStateService is applied consistently across the codebase, enhancing clarity. Consolidating date formatting logic into a new shared RelativeDateFormatter is a great step towards reducing code duplication and improving maintainability. The removal of unused components and directories further streamlines the project.

I've identified a minor issue in the new RelativeDateFormatter where the includeTime parameter is not respected for 'today' and 'yesterday' dates. I've also suggested adding more test cases to cover this scenario. Apart from that, the changes are excellent. Well done!

Comment on lines +30 to 37
public func string(from date: Date, includeTime: Bool = true) -> String {
if Calendar.current.isDateInToday(date) {
return String(format: "%@, %@", Localized.Date.today, Self.time.string(from: date))
} else if Calendar.current.isDateInYesterday(date) {
return String(format: "%@, %@", Localized.Date.yesterday, Self.time.string(from: date))
}
return Self.dateAndTime.string(from: date)
return includeTime ? Self.dateAndTime.string(from: date) : Self.dateOnly.string(from: date)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The includeTime parameter is currently ignored for dates that are 'today' or 'yesterday'. This could lead to unexpected behavior where time is displayed even when it's not desired, for example in the chart view for yearly periods.

To ensure the includeTime flag is respected for all cases, you could refactor this method.

public func string(from date: Date, includeTime: Bool = true) -> String {
    if Calendar.current.isDateInToday(date) {
        let relativePart = Localized.Date.today
        return includeTime ? String(format: "%@, %@", relativePart, Self.time.string(from: date)) : relativePart
    } else if Calendar.current.isDateInYesterday(date) {
        let relativePart = Localized.Date.yesterday
        return includeTime ? String(format: "%@, %@", relativePart, Self.time.string(from: date)) : relativePart
    }
    return includeTime ? Self.dateAndTime.string(from: date) : Self.dateOnly.string(from: date)
}

#expect(!result.hasPrefix(Localized.Date.today))
#expect(!result.hasPrefix(Localized.Date.yesterday))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Great job adding tests for the new RelativeDateFormatter! To improve test coverage, it would be beneficial to add test cases for when includeTime is false. This would help verify the logic for 'today', 'yesterday', and older dates when the time component should be omitted.

    @Test
    func todayWithoutTime() {
        let result = formatter.string(from: Date(), includeTime: false)
        #expect(result == Localized.Date.today)
    }

    @Test
    func yesterdayWithoutTime() {
        let yesterday = Calendar.current.date(byAdding: .day, value: -1, to: Date())!
        let result = formatter.string(from: yesterday, includeTime: false)
        #expect(result == Localized.Date.yesterday)
    }

    @Test
    func olderDateWithoutTime() {
        let oldDate = Calendar.current.date(byAdding: .day, value: -7, to: Date())!
        let result = formatter.string(from: oldDate, includeTime: false)
        let expectedFormatter = DateFormatter()
        expectedFormatter.timeStyle = .none
        expectedFormatter.dateStyle = .long
        #expect(result == expectedFormatter.string(from: oldDate))
    }
}

@gemcoder21 gemcoder21 merged commit 51a74fc into main Dec 26, 2025
3 checks passed
@gemcoder21 gemcoder21 deleted the cleanup-b branch December 26, 2025 18:09
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.

3 participants