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";
22
33import type { ModelCapabilities } from "@t3tools/contracts";
44
5import {
6 applyProviderOptionSelection,
7 providerOptionValueLabels,
8 resolveProviderOptionDescriptors,
9} from "./providerOptions";
5import { applyProviderOptionSelection, resolveProviderOptionDescriptors } from "./providerOptions";
106
117const CODEX_CAPABILITIES: ModelCapabilities = {
128 optionDescriptors: [
......@@ -34,15 +30,6 @@ const CODEX_CAPABILITIES: ModelCapabilities = {
3430};
3531
3632describe("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
4633 it("updates generic select options without knowing provider-specific ids", () => {
4734 const descriptors = resolveProviderOptionDescriptors({
4835 capabilities: CODEX_CAPABILITIES,
......@@ -62,7 +49,7 @@ describe("mobile provider options", () => {
6249 expect(applyProviderOptionSelection(descriptors, { id: "unknown", value: "high" })).toBeNull();
6350 });
6451
65 it("treats an unspecified boolean capability as off", () => {
52 it("updates generic boolean options", () => {
6653 const descriptors = resolveProviderOptionDescriptors({
6754 capabilities: {
6855 optionDescriptors: [{ id: "fastMode", label: "Fast Mode", type: "boolean" }],
......@@ -70,7 +57,6 @@ describe("mobile provider options", () => {
7057 selections: undefined,
7158 });
7259
73 expect(providerOptionValueLabels(descriptors)).toEqual([]);
7460 expect(applyProviderOptionSelection(descriptors, { id: "fastMode", value: true })).toEqual([
7561 { id: "fastMode", value: true },
7662 ]);
apps/mobile/src/lib/providerOptions.ts-18
......@@ -5,7 +5,6 @@ import type {
55} from "@t3tools/contracts";
66import {
77 buildProviderOptionSelectionsFromDescriptors,
8 getProviderOptionCurrentLabel,
98 getProviderOptionDescriptors,
109} from "@t3tools/shared/model";
1110
......@@ -22,23 +21,6 @@ export function resolveProviderOptionDescriptors(input: {
2221 });
2322}
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
4224/**
4325 * Applies one option change (by descriptor id) and returns the full selection
4426 * list to store on the model selection, or null when the change doesn't match