Skip to content

refactor(frontend): remove unused imports, modules, and state - #9538

Open
aglinxinyuan wants to merge 3 commits into
apache:mainfrom
aglinxinyuan:refactor/frontend-unused-code-cleanup
Open

aglinxinyuan wants to merge 3 commits into
apache:mainfrom
aglinxinyuan:refactor/frontend-unused-code-cleanup

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Remove unused imports, redundant standalone module imports, dead helper/stub methods, unmatched SCSS rules, unused template refs, and unread component/service fields across the Angular frontend with no observable UI or runtime behavior change:

  • User/auth services and test stubs: Remove unused GuiConfigService injection in AuthGuardService, unused HttpClient injection and AppSettings import in UserService, unused Input import in RegistrationRequestModalComponent, and dead checkAffiliation/updateAffiliation methods on StubUserService.
  • Dashboard search, unread state, and dataset helpers: Remove unused #searchInput template references in SearchBarComponent, UserDatasetComponent, and UserModelComponent, unmatched .nz-input-group/.nz-prefix-icon SCSS rules in SearchBarComponent, unused getUid() and UserService injection in SearchResultsComponent (with its getUid-only unit tests), unread isLogin/currentUid state and UserService subscription in UserComputingUnitComponent (with its paired unit test), unread isLogin in LandingPageComponent (retaining currentUid and its assertions), unread map in MiniMapComponent, unread coeditorStates in CoeditorPresenceService, unread viewPort @ViewChild in ConsoleFrameComponent, unused DICT_PREFIX and of import in PresetService, and spec-only getPathsUnderOrEqualDatasetFileNode (with its unit tests).
  • Standalone and duplicate imports: Remove redundant FormsModule standalone imports alongside ReactiveFormsModule in AdminGmailComponent (and its spec), DatasetFileSelectorComponent, DatasetVersionSelectorComponent, SettingsComponent, PortPropertyEditFrameComponent, and OperatorPropertyEditFrameComponent, unused NzTooltipModule in HubSearchResultComponent, unused NzButtonModule in JupyterNotebookPanelComponent, and duplicate module imports in WarehouseActionsService, UserDatasetFileRendererComponent, and UiUdfParametersParserService.

Any related issues, documentation, discussions?

Closes #9537.

How was this PR tested?

Ran in frontend/ on 5202d9582b (Node 24, node .yarn/releases/yarn-4.14.1.cjs install --immutable --inline-builds):

node .yarn/releases/yarn-4.14.1.cjs format:ci
node .yarn/releases/yarn-4.14.1.cjs exec tsc -p src/tsconfig.app.json --noEmit
node .yarn/releases/yarn-4.14.1.cjs exec tsc -p src/tsconfig.spec.json --noEmit
node .yarn/releases/yarn-4.14.1.cjs build
node .yarn/releases/yarn-4.14.1.cjs test
  • format:ci (prettier-eslint --list-different and eslint ./src): passed.
  • tsc --noEmit (src/tsconfig.app.json and src/tsconfig.spec.json): passed.
  • build (production Angular AOT build): passed.
  • test (Vitest): 255 suites passed (7,379 passed, 0 failed, 1 pre-existing skipped in untouched operator-property-edit-frame.component.spec.ts).

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Antigravity (Gemini 4 Neon), Claude Code (Claude Opus 5.5)

Copilot AI balanced review requested due to automatic review settings November 19, 2026 06: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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added refactor Refactor the code frontend Changes related to the frontend GUI labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @tanishqgandhi1908, @Yicong-Huang, @Neilk1021
    You can notify them by mentioning @tanishqgandhi1908, @Yicong-Huang, @Neilk1021 in a comment.

@codecov-commenter

codecov-commenter commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.56%. Comparing base (f020980) to head (5202d95).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9538      +/-   ##
============================================
- Coverage     91.56%   91.56%   -0.01%     
  Complexity     5157     5157              
============================================
  Files          1300     1300              
  Lines         58092    58065      -27     
  Branches       7615     7614       -1     
============================================
- Hits          53194    53169      -25     
+ Misses         2959     2957       -2     
  Partials       1939     1939              
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø) Carriedforward from fc0129b
agent-service 99.56% <ø> (ø) Carriedforward from fc0129b
amber 85.42% <ø> (ø) Carriedforward from fc0129b
computing-unit-managing-service 63.88% <ø> (ø) Carriedforward from fc0129b
config-service 87.50% <ø> (ø) Carriedforward from fc0129b
file-service 82.16% <ø> (ø) Carriedforward from fc0129b
frontend 96.46% <100.00%> (+<0.01%) ⬆️
notebook-migration-service 83.77% <ø> (ø) Carriedforward from fc0129b
pyamber 98.38% <ø> (ø) Carriedforward from fc0129b
result-service 85.71% <ø> (ø) Carriedforward from fc0129b
workflow-compiling-service 78.30% <ø> (ø) Carriedforward from fc0129b

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bobbai00 bobbai00 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.

🟡 0 must-fix · 1 advisory · 1 polish: behavior-preserving cleanup; every removal checks out, with two optional nits.

Simplifications (1)

  • port-property-edit-frame.component.ts:28: the sibling operator property editor keeps the same redundant FormsModule (advisory, see inline)

Polish: 1 quick touch-up (see inline comments).

Verification trace

Each removal was checked for readers in templates, specs and other files at the head commit, with extra care for the standalone module imports, where a lost directive fails silently instead of breaking the build. FormsModule adds only NgModel, NgModelGroup and NgForm over ReactiveFormsModule; every <form> in the five affected templates has [formGroup], which the NgForm selector excludes, and none uses ngModel. hub-search-result.component.html has no tooltip. In the Jupyter panel, the only thing NzButtonModule still matched was ng-zorro's transition-patch directive on the two nz-icon elements, a no-op there because those icons have no CSS transition.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unused frontend imports, modules, helpers, and unread state

4 participants