Skip to content

Commit 5059835

Browse files
refactor(mobile): remove unused provider option summary
1 parent d2c3e2e commit 5059835

2 files changed

Lines changed: 2 additions & 34 deletions

File tree

‎apps/mobile/src/lib/providerOptions.test.ts‎

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ import { describe, expect, it } from "vite-plus/test";
22

33
import type { ModelCapabilities } from "@t3tools/contracts";
44

5-
import {
6-
applyProviderOptionSelection,
7-
providerOptionValueLabels,
8-
resolveProviderOptionDescriptors,
9-
} from "./providerOptions";
5+
import { applyProviderOptionSelection, resolveProviderOptionDescriptors } from "./providerOptions";
106

117
const CODEX_CAPABILITIES: ModelCapabilities = {
128
optionDescriptors: [
@@ -34,15 +30,6 @@ const CODEX_CAPABILITIES: ModelCapabilities = {
3430
};
3531

3632
describe("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,15 +49,14 @@ 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" }],
6956
},
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‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type {
55
} from "@t3tools/contracts";
66
import {
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-
*/
30-
export 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

0 commit comments

Comments
 (0)