Skip to content

Skylines: New City Selection Feature#395

Closed
rjison wants to merge 9 commits intotronbyt:mainfrom
rjison:SkyLineChanges
Closed

Skylines: New City Selection Feature#395
rjison wants to merge 9 commits intotronbyt:mainfrom
rjison:SkyLineChanges

Conversation

@rjison
Copy link
Contributor

@rjison rjison commented Mar 6, 2026

Allows you to pick from any random city, or select your own subset of cities to pick from (including just one if you want).
Also added/edited a few city skylines.

@rjison rjison requested a review from tavdog as a code owner March 6, 2026 16:18
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 enhances the user experience of the Skylines application by introducing a flexible city selection feature. Users can now either display a completely random city or curate their own list of preferred cities from which the application will randomly select. Additionally, the visual appeal of the skylines has been improved with a new twinkling star animation, and the underlying randomness generation has been made more robust.

Highlights

  • City Selection Feature: Implemented a new city selection mechanism, allowing users to choose between a completely random city or a custom subset of cities from which the application will randomly select.
  • Star Twinkling Animation: Introduced a dynamic twinkling animation for stars displayed in the skyline, enhancing visual appeal.
  • Improved Randomness: Enhanced the randomness generation within the application by incorporating additional canvas dimensions into the seed calculation.
  • Configuration Schema Refactoring: Refactored the configuration schema to replace a single city dropdown with individual toggle switches for each city, enabling multi-city selection.
Changelog
  • apps/skylines/skylines.star
    • Updated the display_type schema option from "Select a City" to "Pick from Selected" and changed its value from "Pick" to "List".
    • Enhanced the randomize function by incorporating canvas.width() * canvas.height() into the seed for improved randomness.
    • Refactored the draw_skyline function to initialize star_locations and removed some internal comments.
    • Implemented a star twinkling animation within draw_skyline and increased the duration of the final animation hold.
    • Added a new helper function get_safe_name to standardize city names for configuration IDs.
    • Revised the main function's logic to support selecting cities from a user-defined list of toggled options, falling back to a random city if no specific cities are chosen.
    • Optimized animation frame handling by introducing a last_frame variable.
    • Transformed the city selection UI in get_city_options from a dropdown to a series of toggle switches, enabling multi-city selection.
Activity
  • No activity has been recorded for this pull request.
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.

@rjison rjison closed this Mar 6, 2026
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 a new feature allowing users to select a subset of cities for random display, replacing the previous single-city picker. The implementation correctly uses Toggle schemas and includes a sensible fallback to a fully random city if no selection is made. Based on the security audit, no vulnerabilities of medium, high, or critical severity were identified. The code also includes several cleanups and micro-optimizations, and improves animation rendering by fixing a potential bug with mutable list references and enhancing the star animation with a twinkling effect. Minor low-severity issues were noted regarding stability and robustness, such as potential NoneType errors and use of an undefined canvas global, along with one minor style inconsistency.

for city in display_data:
choice_cities.append(schema.Option(display = "%s - %s" % (city["name"], city["description"]), value = city["name"]))
safe_name = get_safe_name(city["name"])
city_checkboxes.append(
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with other if statements in this file, remove the parentheses around the condition.

    if type == "List":

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