authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 00:09:25-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 00:09:25-07:00
logc1e279eca52e02ee3fb9c8d133057a30526f282c
tree2ab27406cec66101f872f9dcccb1a2ba479b61d6
parent1568b3fd083e198a08bb12353820c1ef99fb3420
signature Signed by PGP key B5690EEEBB952194

refactor(mobile): remove unused provider option summary (#9971)


2 files changed, 2 insertions(+), 34 deletions(-)

apps/mobile/src/lib/providerOptions.test.ts+2-16
...@@ -2,11 +2,7 @@ import { describe, expect, it } from "vite-plus/test";...@@ -2,11 +2,7 @@ import { describe, expect, it } from "vite-plus/test";
22
3import type { ModelCapabilities } from "@t3tools/contracts";3import type { ModelCapabilities } from "@t3tools/contracts";
44
5import {5import { applyProviderOptionSelection, resolveProviderOptionDescriptors } from "./providerOptions";
6 applyProviderOptionSelection,
7 providerOptionValueLabels,
8 resolveProviderOptionDescriptors,
9} from "./providerOptions";
106
11const CODEX_CAPABILITIES: ModelCapabilities = {7const CODEX_CAPABILITIES: ModelCapabilities = {
12 optionDescriptors: [8 optionDescriptors: [
...@@ -34,15 +30,6 @@ const CODEX_CAPABILITIES: ModelCapabilities = {...@@ -34,15 +30,6 @@ const CODEX_CAPABILITIES: ModelCapabilities = {
34};30};
3531
36describe("mobile provider options", () => {32describe("mobile provider options", () => {
37 it("summarizes the option values currently in effect", () => {
38 const descriptors = resolveProviderOptionDescriptors({
39 capabilities: CODEX_CAPABILITIES,
40 selections: undefined,
41 });
42
43 expect(providerOptionValueLabels(descriptors)).toEqual(["Medium", "Standard"]);
44 });
45
46 it("updates generic select options without knowing provider-specific ids", () => {33 it("updates generic select options without knowing provider-specific ids", () => {
47 const descriptors = resolveProviderOptionDescriptors({34 const descriptors = resolveProviderOptionDescriptors({
48 capabilities: CODEX_CAPABILITIES,35 capabilities: CODEX_CAPABILITIES,
...@@ -62,7 +49,7 @@ describe("mobile provider options", () => {...@@ -62,7 +49,7 @@ describe("mobile provider options", () => {
62 expect(applyProviderOptionSelection(descriptors, { id: "unknown", value: "high" })).toBeNull();49 expect(applyProviderOptionSelection(descriptors, { id: "unknown", value: "high" })).toBeNull();
63 });50 });
6451
65 it("treats an unspecified boolean capability as off", () => {52 it("updates generic boolean options", () => {
66 const descriptors = resolveProviderOptionDescriptors({53 const descriptors = resolveProviderOptionDescriptors({
67 capabilities: {54 capabilities: {
68 optionDescriptors: [{ id: "fastMode", label: "Fast Mode", type: "boolean" }],55 optionDescriptors: [{ id: "fastMode", label: "Fast Mode", type: "boolean" }],
...@@ -70,7 +57,6 @@ describe("mobile provider options", () => {...@@ -70,7 +57,6 @@ describe("mobile provider options", () => {
70 selections: undefined,57 selections: undefined,
71 });58 });
7259
73 expect(providerOptionValueLabels(descriptors)).toEqual([]);
74 expect(applyProviderOptionSelection(descriptors, { id: "fastMode", value: true })).toEqual([60 expect(applyProviderOptionSelection(descriptors, { id: "fastMode", value: true })).toEqual([
75 { id: "fastMode", value: true },61 { id: "fastMode", value: true },
76 ]);62 ]);
apps/mobile/src/lib/providerOptions.ts-18
...@@ -5,7 +5,6 @@ import type {...@@ -5,7 +5,6 @@ import type {
5} from "@t3tools/contracts";5} from "@t3tools/contracts";
6import {6import {
7 buildProviderOptionSelectionsFromDescriptors,7 buildProviderOptionSelectionsFromDescriptors,
8 getProviderOptionCurrentLabel,
9 getProviderOptionDescriptors,8 getProviderOptionDescriptors,
10} from "@t3tools/shared/model";9} from "@t3tools/shared/model";
1110
...@@ -22,23 +21,6 @@ export function resolveProviderOptionDescriptors(input: {...@@ -22,23 +21,6 @@ export function resolveProviderOptionDescriptors(input: {
22 });21 });
23}22}
2423
25/**
26 * Labels for the option values currently in effect (select values plus
27 * enabled booleans), used to summarize the thread configuration in the
28 * composer trigger pill.
29 */
30export function providerOptionValueLabels(
31 descriptors: ReadonlyArray<ProviderOptionDescriptor>,
32): ReadonlyArray<string> {
33 return descriptors.flatMap((descriptor) => {
34 if (descriptor.type === "boolean") {
35 return descriptor.currentValue ? [descriptor.label] : [];
36 }
37 const label = getProviderOptionCurrentLabel(descriptor);
38 return label ? [label] : [];
39 });
40}
41
42/**24/**
43 * Applies one option change (by descriptor id) and returns the full selection25 * Applies one option change (by descriptor id) and returns the full selection
44 * list to store on the model selection, or null when the change doesn't match26 * list to store on the model selection, or null when the change doesn't match