Repository navigation
Conversation
8399ba7 to
c1ad9f4
Compare
- Compress billing.png and resources.png by 88% and add lazy loading - Remove deprecated @angular/animations and unused Material modules - Deduplicate alpha/crash/qa console builds and add Gradle task caching - Migrate remaining @input, @output, and @ViewChild decorators to signals
c1ad9f4 to
5231d95
Compare
CydeWeys
left a comment
There was a problem hiding this comment.
Thanks for the bundle/build optimizations and signal-API cleanup! The signal migrations (input/output/viewChild), unused Material/CDK removals, and the domainList paginator detachment look solid overall.
A few items need attention before merging (details inline):
- [Blocker / CI] Adding
MatSortModuleenablesmat-sort-headeron the registrars table, which breaksConsoleScreenshotTest.globalRole_registrars(kokoro-foss/kokoro-internal, 2,539 px diff). Please visually verify the header layout, regenerate the golden, and note in the PR description that column sorting is now active. - [Should-fix] The registrar-switch resets in
DomainListComponent,UsersComponent,ContactComponent, andHistoryComponentclear state synchronously but do not cancel in-flight HTTP requests, so a slow response for registrar A can still overwrite registrar B's state and stop B's loading indicator. For admins onDomainListComponent, this is especially risky becauseConsoleBulkDomainActionruns EPP withisSuperuser = isAdmin(bypassing EPP'sverifyResourceOwnership). - [Should-fix]
RdapComponent's effect keys onregistrar()instead ofregistrarId()and lacks a unit test. - [Should-fix] The
crash/qa==alphabuild alias inconsole-webapp/build.gradleis enforced only by a comment — an automated Gradle check would prevent silent drift.
Also, it would be helpful to update the PR description to mention the user-visible behavior changes included here (column sorting enabled, registrar-switch state resets, history load split, lists hidden while loading, domainList server-side paginator fix, and ./gradlew test now running runConsoleWebappUnitTests). Note also that the Gradle changes configure incremental up-to-date checks rather than build caching (Exec/Copy disable build caching by default).
| MatRippleModule, | ||
| MatSelectModule, | ||
| MatSidenavModule, | ||
| MatSortModule, |
There was a problem hiding this comment.
[Blocker] Adding MatSortModule activates the existing matSort / mat-sort-header directives on registrarsTable.component.html and usersList.component.html (which were previously inert). This changes the table header layout and is causing ConsoleScreenshotTest.globalRole_registrars to fail in CI (2,539 px diff against chrome-linux/ConsoleScreenshotTest_globalRole_registrars_registrarsPage.png).
Please visually inspect the new header rendering, regenerate the screenshot golden, and note in the PR description that column sorting is now live.
| /** | ||
| * Clears registrar-scoped table, selection, and service state so stale data | ||
| * cannot bleed across registrars when switching context. | ||
| */ |
There was a problem hiding this comment.
[Should-fix] This comment says stale data "cannot bleed across registrars", but the synchronous reset does not cancel in-flight HTTP requests from the previous registrar. If a user switches from registrar A to registrar B while A's retrieveDomains() or retrieveLocks() request is still pending:
- A's late response writes A's domains /
checkpointTime/ locks into state while B is selected. - A's
finalize/completeclears B'sisLoadingandGlobalLoader(which is keyed by component instance).
For admin users this is especially hazardous: if A's domains repopulate the table while B is selected and the admin runs a bulk delete/suspend, ConsoleBulkDomainAction only checks permission on registrarId (B) and executes EPP with isSuperuser = isAdmin, which bypasses verifyResourceOwnership in DomainDeleteFlow / DomainUpdateFlow.
The same in-flight cancellation gap affects users.component.ts (loadUsers), contact.component.ts (fetchContacts), and history.component.ts (fetchHistory).
Fix: cancel prior subscriptions on registrar change via effect((onCleanup) => { const sub = ...; onCleanup(() => sub.unsubscribe()); }) or toObservable(registrarId).pipe(switchMap(...)), and add a unit test that emits the stale Subject after switching registrars.
| ) {} | ||
| ) { | ||
| effect(() => { | ||
| if (this.registrarService.registrar()) { |
There was a problem hiding this comment.
[Should-fix] Keying this effect on registrarService.registrar() (which is a computed over registrars().find(...)) means it will also fire whenever the registrars array is reloaded/updated (loadRegistrars, updateRegistrar, createRegistrar), and it skips resetting editing when registrar() is undefined.
Consider tracking this.registrarService.registrarId() directly and resetting unconditionally, plus adding a unit test in rdap.component.spec.ts.
| createConsoleBuildTask(env) | ||
| } | ||
|
|
||
| // 'crash' and 'qa' share the exact same unoptimized build configuration as 'alpha' |
There was a problem hiding this comment.
[Should-fix] Right now crash and qa still have their own configurations in angular.json (and are still referenced by release/build_nomulus_for_env.sh), so relying solely on this comment means a future crash-only or qa-only edit in angular.json would silently ship alpha's output.
Could we add a small Gradle configuration/task assertion (parsing angular.json with JsonSlurper) that fails the build if the alpha, crash, and qa configurations diverge?
| task npmInstallDeps(type: Exec) { | ||
| workingDir "${consoleDir}/" | ||
| inputs.files("${consoleDir}/package.json", "${consoleDir}/package-lock.json") | ||
| outputs.dir("${consoleDir}/node_modules") |
There was a problem hiding this comment.
Nit: declaring the entire node_modules directory as an output causes Gradle to fingerprint tens of thousands of files on every run. Using outputs.file("${consoleDir}/node_modules/.package-lock.json") is much faster and still invalidates on clean or install changes.
| <img | ||
| src="./assets/billing.png" | ||
| alt="Generic billing image" | ||
| loading="lazy" |
There was a problem hiding this comment.
Nit: loading="lazy" on above-the-fold hero images (here and in resources.component.html) doesn't save bandwidth and can delay LCP.
Also, billing.png and resources.png were downscaled from 1600x1600 RGBA to 300x300 RGB (flattening transparency to white). Since the CSS caps them at 300px, 300x300 is 1x-only and looks soft on 2x/HiDPI displays — consider 600x600 WebP/PNG with alpha preserved.
| <h1>No records found</h1> | ||
| </div> | ||
| } @else { | ||
| } @else if (!isLoading()) { |
There was a problem hiding this comment.
Nit: because HistoryComponent shares a single isLoading signal across both tabs, searching user history now blanks out the already-loaded Registrar history tab while the user query is in flight.
| const globalRole = this.userDataService?.userData()?.globalRole || 'NONE'; | ||
| if (this.elementId === null) { | ||
| const elementId = this.elementId(); | ||
| if (elementId === null) { |
There was a problem hiding this comment.
Nit: if elementId ever transitions from a restricted value to null, returning early here leaves style.display = 'none' stuck. Resetting this.el.nativeElement.style.display = '' before returning keeps the reactive behavior consistent.
| </div> | ||
| <div class="console-app__contacts"> | ||
| @if (contactService.contacts().length === 0) { | ||
| @if (!isLoading()) { @if (contactService.contacts().length === 0) { |
There was a problem hiding this comment.
Nit: this nested @if (!isLoading()) { @if (...) { can be flattened to @if (isLoading()) { } @else if (contactService.contacts().length === 0) { ... } @else { ... } for readability.
| const first: Registrar = { | ||
| ...sampleRegistrar, | ||
| registrarId: 'reg-1', | ||
| registrarName: 'zeta Corp', |
There was a problem hiding this comment.
Nit: 'zeta Corp' vs 'Alpha Corp' sorts Alpha before zeta even under a case-sensitive comparison ('A' < 'z'). Using 'Zeta Corp' vs 'alpha Corp' would actually exercise case-insensitive sorting.
This change is