Skip to content

Restructure app for best practices and simplicity#7

Draft
kertal wants to merge 4 commits into
mainfrom
claude/restructure-app-best-practices-sryEJ
Draft

Restructure app for best practices and simplicity#7
kertal wants to merge 4 commits into
mainfrom
claude/restructure-app-best-practices-sryEJ

Conversation

@kertal

@kertal kertal commented Dec 29, 2025

Copy link
Copy Markdown
Owner

High-impact restructuring to reduce complexity and improve maintainability:

CONSOLIDATED UTILITIES (24 files → 6 files):

  • summary.ts: Merged summaryConstants, summaryGrouping, summaryHelpers
  • filtering.ts: Merged filterUtils, viewFiltering, resultsUtils
  • githubData.ts: Merged rawDataUtils, prEnrichment
  • storage.ts: Merged storageUtils, indexedDB, usernameCache

BENEFITS:

  • Fewer files to navigate (easier to find code)
  • Logical grouping by domain (summary, filtering, data, storage)
  • Cleaner imports (one import instead of many)
  • Foundation for fast iterations

All imports updated across codebase and test files.

High-impact restructuring to reduce complexity and improve maintainability:

CONSOLIDATED UTILITIES (24 files → 6 files):
- summary.ts: Merged summaryConstants, summaryGrouping, summaryHelpers
- filtering.ts: Merged filterUtils, viewFiltering, resultsUtils
- githubData.ts: Merged rawDataUtils, prEnrichment
- storage.ts: Merged storageUtils, indexedDB, usernameCache

BENEFITS:
- Fewer files to navigate (easier to find code)
- Logical grouping by domain (summary, filtering, data, storage)
- Cleaner imports (one import instead of many)
- Foundation for fast iterations

All imports updated across codebase and test files.
@kertal
kertal requested a review from Copilot December 29, 2025 05:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates utility files to improve code organization and maintainability by merging 24 utility files into 6 domain-focused modules (summary, filtering, githubData, storage), making the codebase easier to navigate and reducing import complexity.

Key Changes:

  • Merged summary-related utilities (summaryConstants, summaryGrouping, summaryHelpers) into summary.ts
  • Merged filtering utilities (filterUtils, viewFiltering, resultsUtils) into filtering.ts
  • Merged GitHub data utilities (rawDataUtils, prEnrichment) into githubData.ts
  • Merged storage utilities (storageUtils, indexedDB, usernameCache) into storage.ts

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/views/Summary.tsx Updated imports to use consolidated filtering and summary modules
src/views/IssuesAndPRsList.tsx Updated imports to use consolidated filtering module
src/views/EventView.tsx Updated imports to use consolidated filtering module
src/utils/summary.ts New consolidated file containing all summary-related constants, grouping logic, and helper functions
src/utils/filtering.ts New consolidated file containing all filtering, search parsing, and sorting utilities
src/utils/githubData.ts New consolidated file containing event transformation, raw data processing, and PR enrichment
src/utils/storage.ts New consolidated file containing localStorage, IndexedDB, and username cache utilities
src/utils/viewFiltering.ts Deleted - functionality moved to filtering.ts
src/utils/summaryHelpers.ts Deleted - functionality moved to summary.ts
src/utils/summaryConstants.ts Deleted - functionality moved to summary.ts
src/utils/storageUtils.ts Deleted - functionality moved to storage.ts
src/utils/usernameCache.ts Deleted - functionality moved to storage.ts
src/utils/prEnrichment.ts Deleted - functionality moved to githubData.ts
src/utils/indexedDB.ts Deleted - functionality moved to storage.ts
src/utils/filterUtils.ts Deleted - functionality moved to filtering.ts
Various test files Updated imports to reference new consolidated modules
src/hooks/* Updated imports to reference new consolidated modules
src/components/SettingsDialog.tsx Updated imports to reference new consolidated modules

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/storage.ts
Comment on lines +796 to +797
const { needValidation: needsVal } = categorizeUsernames(usernames, validatedCache, invalidCache);
return needsVal.length > 0;

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

Variable name needsVal is abbreviated and unclear. Rename to needsValidationList or usernamesNeedingValidation for clarity.

Suggested change
const { needValidation: needsVal } = categorizeUsernames(usernames, validatedCache, invalidCache);
return needsVal.length > 0;
const { needValidation: needsValidationList } = categorizeUsernames(usernames, validatedCache, invalidCache);
return needsValidationList.length > 0;

Copilot uses AI. Check for mistakes.
Comment thread src/utils/summary.ts
*/
export const parseUsernames = (username: string): string[] => {
return username.split(',').map(u => u.trim().toLowerCase());
return username.split(',').map((u) => u.trim().toLowerCase());

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

Parameter name u is too generic. Rename to username or user for better readability.

Suggested change
return username.split(',').map((u) => u.trim().toLowerCase());
return username.split(',').map((user) => user.trim().toLowerCase());

Copilot uses AI. Check for mistakes.
@kertal

kertal commented Jan 1, 2026

Copy link
Copy Markdown
Owner Author

@copilot it seems the build fails now with Error: src/hooks/useLocalStorage.ts(141,59): error TS2307: Cannot find module '../utils/storageUtils' or its corresponding type declarations.
Error: src/utils/githubData.ts(53,61): error TS2339: Property 'assignee' does not exist on type '{}'.
Error: src/utils/githubData.ts(54,62): error TS2339: Property 'assignees' does not exist on type '{}'.
Error: Process completed with exit code 2.

Copilot AI commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

@kertal I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits January 1, 2026 12:59
Co-authored-by: kertal <463851+kertal@users.noreply.github.com>
Fix build errors from incomplete import path updates
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 1, 2026

Copy link
Copy Markdown

Deploying git-vegas with  Cloudflare Pages  Cloudflare Pages

Latest commit: ac5edea
Status:🚫  Build failed.

View logs

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.

4 participants