Skip to content

Feat/9 submodule size support#247

Open
envico801 wants to merge 2 commits into
AminoffZ:mainfrom
envico801:feat/9-submodule-size-support
Open

Feat/9 submodule size support#247
envico801 wants to merge 2 commits into
AminoffZ:mainfrom
envico801:feat/9-submodule-size-support

Conversation

@envico801

@envico801 envico801 commented May 7, 2026

Copy link
Copy Markdown

This PR adds support for displaying Git submodule sizes directly in the parent repository view.

Previously, submodules would always display ... because their paths point to a different repository and fail the normal tree lookup logic.

What changed

  • Detect submodule links by checking whether the linked owner/repo differs from the current repository.
  • Fetch the submodule repository tree and calculate the size using the same logic already used by the extension for normal repositories.
  • Lazy load submodule sizes so the rest of the file list renders immediately without waiting for external requests.
  • Cache in-flight requests to avoid duplicate API calls caused by GitHub rendering separate mobile/desktop anchors.

Submodules now initially render as Loading... and update automatically once the request completes.

This can be reproduced with:


Files changed

  • Added getExternalRepoSize() in api.ts
  • Updated the main loop in dom-manipulation.ts

Closes #9

Before:

Before image

After:

After image

envico801 added 2 commits May 7, 2026 10:14
Detects submodules via external repository links, calculates their working-tree size for consistency, and lazy-loads the results into the UI using a Promise cache to prevent blocking the main thread and duplicate API requests.
@envico801

Copy link
Copy Markdown
Author

Worth mentioning that submodules are not considered in the total size sum of the parent repository, as they are references basically

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.

Support Submodules

1 participant