Refactor intel.ts: Extract hotkey-based features into modular components#19
Draft
Copilot wants to merge 7 commits into
Draft
Refactor intel.ts: Extract hotkey-based features into modular components#19Copilot wants to merge 7 commits into
Copilot wants to merge 7 commits into
Conversation
Co-authored-by: anicolao <1145048+anicolao@users.noreply.github.com>
Co-authored-by: anicolao <1145048+anicolao@users.noreply.github.com>
Co-authored-by: anicolao <1145048+anicolao@users.noreply.github.com>
Co-authored-by: anicolao <1145048+anicolao@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] intel.ts contains a lot of code. each user-facing piece of functionality is hooked up to a hotkey via a defineHotkey call. Use that to split
Refactor intel.ts: Extract hotkey-based features into modular components
Aug 20, 2025
intel.ts into many files, one for each user facing feature, and do this one feature at a time in separate com...
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.
This PR begins the process of breaking down the massive 6,461-line
intel.tsfile into smaller, focused modules organized around user-facing features. Each feature is identified by itsdefineHotkeycall and extracted into its own module.Problem
The
intel.tsfile has grown to over 6,400 lines containing many different features mixed together, making it difficult to:Solution
This PR extracts 5 distinct feature groups into separate modules while maintaining all existing functionality:
Extracted Modules
ui-controls.ts- Core UI interaction functionsshowUI()(backtick hotkey) - Opens NPA UIshowOptions()(ctrl+backtick) - Opens options dialogconfigureColours()(ctrl+a) - Opens color configurationhelp.ts- Help and documentation functionsnpaHelp()(? hotkey) - Displays help screen with all hotkeysnpaControls()(~ hotkey) - Generates control referencefleet-routing.ts- Fleet management functionalityrouteEnemy()(x hotkey) - Creates fake enemy fleets for strategic planningscreenshot.ts- Screenshot upload functionalityscreenshot()(# hotkey) - Uploads map screenshots to imgbbcombat-controls.ts- Combat calculation adjustmentsincCombatHandicap()(. hotkey) - Increases enemy weapon advantagedecCombatHandicap()(, hotkey) - Decreases enemy weapon advantageImplementation Details
Results
intel.ts(6,461 → 6,281 lines, 2.8% reduction)Future Work
This establishes the pattern for continuing the modularization. The remaining 53 hotkey-based features can be extracted using the same approach, eventually reducing
intel.tsto primarily initialization and coordination logic.The modular structure will enable:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.