Extract shared geography primitives into _dependencies/common/geo.py#919
Merged
Conversation
added 3 commits
July 10, 2026 12:09
- Centralised FEDERAL_DISTRICTS, compact_region_name(), REGION_EMOJI_LEGEND
- RegionCallbackPayload dataclass with JSON serialisation
- paginate_regions() helper for paginated region lists
- NavButton constants (← назад, ещё →, Завершить и т.д.)
- get_fed_district_normalised/label() lookup helpers
- district_prompt() shared message builder
VK bot: removed duplicated _compact_region_name + emoji legend, now
imports from _dependencies.common.geo
MAX bot: same cleanup
ruff format + ruff check + mypy + 275 VK tests — all green.
…encies/common/geo.py - NavButton (BACK/NEXT/FINISH/BACK_TO_START) replaces duplicate BTN_* constants - FEDERAL_DISTRICTS replaces duplicate BTN_DISTRICT_* lists - paginate_regions() replaces manual pagination in paginated_regions_inline() - RegionCallbackPayload replaces hand-rolled callback payload dicts - CMD_* constants replace hardcoded cmd strings - REGION_EMOJI_LEGEND in MAX message_formatter now imported from geo.py - -87 lines net, 873 tests pass
…ants in VK - Remove unused NavButton.CHOOSE_OTHER, NavButton.FED_DIST_PICK_OTHER - Remove accidental '✅ завершённые поиски' from emoji legend/suffix map - Remove dead code: REGION_SELECTION_INTRO, REGION_LIST_PROMPT, district_prompt() - Fix REGION_TOGGLED_OFF_FMT: удалён → удален (match VK existing text) - Derive VK _KNOWN_DISTRICTS from FEDERAL_DISTRICTS (single source of truth) - Replace hardcoded strings in VK region_select_handlers with shared constants - Fix misplaced section comment in MAX message_formatter.py
60299ce to
c3c0854
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Centralised FEDERAL_DISTRICTS, compact_region_name(), REGION_EMOJI_LEGEND
RegionCallbackPayload dataclass with JSON serialisation
paginate_regions() helper for paginated region lists
NavButton constants (← назад, ещё →, Завершить и т.д.)
get_fed_district_normalised/label() lookup helpers
district_prompt() shared message builder
VK bot: removed duplicated _compact_region_name + emoji legend, now imports from _dependencies.common.geo
MAX bot: same cleanup