Просмотр исходного кода

fix(web): count the scoped mutate branch and draw the breadcrumb separator as a hairline

Awaiting inside each arm of the scope ternary left v8 with a negative else
count on the response check, which the coverage gate read as an uncovered
branch; the request is now chosen first and awaited once. The breadcrumb
separator was a 1px filled divider where every other neutral line is 0.5px.
Yichen Jiang 2 недель назад
Родитель
Сommit
e1c3ec00e2

+ 1 - 1
packages/client/ui-settings-plugin-manager/src/client/PluginManagerSettingsTab.module.css

@@ -487,7 +487,7 @@
 }
 
 .crumbSep {
-  width: 1px;
+  width: 0.5px;
   height: 12px;
   background: var(--dsw-alias-border-l3);
 }

+ 7 - 4
packages/client/ui-settings/src/client/settings-scope.ts

@@ -132,10 +132,13 @@ export class SettingsScopeController<T> implements SettingsScope<T> {
     return this.enqueue(async () => {
       const revision = expectedRevision ?? this.pendingRevision ?? this.getSnapshot().revision
       // The wire method takes an optional trailing scope; the global instance
-      // sends three arguments rather than an explicit undefined.
-      const response = this.spec.scope === undefined
-        ? await this.ctx.remote.settings.mutate(this.spec.namespace, ownedOps, revision)
-        : await this.ctx.remote.settings.mutate(this.spec.namespace, ownedOps, revision, this.spec.scope)
+      // sends three arguments rather than an explicit undefined. One await
+      // after the choice: awaiting inside each arm splits the continuation so
+      // that v8 counts the branch below it negative.
+      const request = this.spec.scope === undefined
+        ? this.ctx.remote.settings.mutate(this.spec.namespace, ownedOps, revision)
+        : this.ctx.remote.settings.mutate(this.spec.namespace, ownedOps, revision, this.spec.scope)
+      const response = await request
       if (!response.ok) {
         await this.recover(generation)
         return