Skip to content

Extract common HTML templates and add address map links.#180

Merged
supermartzin merged 3 commits intomainfrom
issues/179-link-to-map-services
Jan 12, 2026
Merged

Extract common HTML templates and add address map links.#180
supermartzin merged 3 commits intomainfrom
issues/179-link-to-map-services

Conversation

@supermartzin
Copy link
Owner

Moved shared HTML templates to a new CommonHtmlTemplateElements class in a dedicated Templates project, referenced by both Email and File AdPostsHandlers. Enhanced the ad post template to include clickable map links (Google Maps, Mapy.com, Apple Maps) for addresses, updating both code and the sample HTML template. Updated project files and solution to include the new Templates project.

Moved shared HTML templates to a new CommonHtmlTemplateElements class in a dedicated Templates project, referenced by both Email and File AdPostsHandlers. Enhanced the ad post template to include clickable map links (Google Maps, Mapy.com, Apple Maps) for addresses, updating both code and the sample HTML template. Updated project files and solution to include the new Templates project.
@supermartzin supermartzin added this to the v2.0 milestone Jan 12, 2026
@supermartzin supermartzin self-assigned this Jan 12, 2026
@supermartzin supermartzin added the 📈 enhancement New feature or request label Jan 12, 2026
@supermartzin supermartzin linked an issue Jan 12, 2026 that may be closed by this pull request
@gemini-code-assist
Copy link

Summary of Changes

Hello @supermartzin, 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 significantly improves the modularity and user experience of the ad post handling system. By extracting shared HTML templates into a new, centralized project, it reduces code duplication and simplifies future template modifications. The addition of interactive map links directly within the ad post displays provides a valuable new feature for users, allowing for quick navigation to property locations.

Highlights

  • HTML Template Refactoring: Common HTML templates, previously duplicated in EmailNotifyingAdPostsHandler and LocalFileAdPostsHandler, have been extracted into a new dedicated project RealEstatesWatcher.AdPostsHandlers.Templates within the CommonHtmlTemplateElements class. This centralizes template definitions for improved reusability and maintainability.
  • Address Map Links Integration: The ad post HTML template has been enhanced to include clickable map links for addresses. These links provide direct access to Google Maps, Mapy.com, and Apple Maps, improving the utility of the displayed addresses. The links are conditionally displayed only when an address is available.
  • Project Structure Update: A new project, RealEstatesWatcher.AdPostsHandlers.Templates, has been added to the solution. Both the Email and File ad post handlers now reference this new project for their HTML template needs.

🧠 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

@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 refactors the HTML templates into a shared project, which is a great improvement for maintainability. The addition of map links for addresses is also a useful feature.

My review includes two main points:

  1. There is significant code duplication between EmailNotifyingAdPostsHandler and LocalFileAdPostsHandler for generating the HTML for a single ad post. This has already introduced several bugs. I've recommended extracting this logic into a shared helper method in the new Templates project.
  2. A minor security improvement to use https:// for the Apple Maps link.

Overall, this is a good change that will be even better after addressing the code duplication.

Replaced string.Replace chains with StringBuilder for building HTML post templates in both EmailNotifyingAdPostsHandler and LocalFileAdPostsHandler. Also updated Apple Maps link to use https instead of http in CommonHtmlTemplateElements and post-email-template.html for improved security.
Replaces 'postHtml' with 'postHtmlBuilder' in the fallback case for floor area replacement to ensure the correct variable is used for string replacement.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
16.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@supermartzin supermartzin merged commit cd19596 into main Jan 12, 2026
9 of 10 checks passed
@supermartzin supermartzin deleted the issues/179-link-to-map-services branch January 12, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📈 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add link to Google Maps/Mapy.com when address is available.

1 participant