Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/mobile/src/components/ui/AppSymbol.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import IconArrowUpCircle from "@tabler/icons-react-native/IconArrowUpCircle";
import IconArrowUpRight from "@tabler/icons-react-native/IconArrowUpRight";
import IconArrowUpRightCircle from "@tabler/icons-react-native/IconArrowUpRightCircle";
import IconArrowsLeftRight from "@tabler/icons-react-native/IconArrowsLeftRight";
import IconArrowsSort from "@tabler/icons-react-native/IconArrowsSort";
import IconArrowsDiagonal2 from "@tabler/icons-react-native/IconArrowsDiagonal2";
import IconArrowsMinimize from "@tabler/icons-react-native/IconArrowsMinimize";
import IconBan from "@tabler/icons-react-native/IconBan";
Expand Down Expand Up @@ -172,6 +173,7 @@ const ANDROID_ICON_BY_SF_SYMBOL = {
"arrow.left": IconArrowLeft,
"arrow.right": IconArrowRight,
"arrow.left.arrow.right": IconArrowsLeftRight,
"arrow.up.arrow.down": IconArrowsSort,
"arrow.clockwise": IconRefresh,
"arrow.down": IconArrowDown,
"arrow.down.circle": IconArrowDownCircle,
Expand Down
38 changes: 11 additions & 27 deletions apps/mobile/src/features/home/AndroidHomeListFilters.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import type { HomeListSelection } from "./home-list-filter-menu";

const ALL_PROJECTS = "projects:all";
const PROJECT_DONE = "projects:done";
// Project scope keys carry a NUL separator, so ids travel as JSON rather than raw strings.
const actionId = (field: "environment" | "project", value: string | null) =>
JSON.stringify([field, value]);
Expand All @@ -40,7 +39,6 @@ export function AndroidHomeListFilters(
},
) {
const gt = useGT();
const [projectDraft, setProjectDraft] = useState<ReadonlyArray<string> | null>(null);
const [environmentSheetOpen, setEnvironmentSheetOpen] = useState(false);
const environment = props.environments.find(
(item) => item.environmentId === props.selectedEnvironmentId,
Expand All @@ -60,7 +58,7 @@ export function AndroidHomeListFilters(
projectCount > 1
? gt`${{ count: projectCount }} projects selected`
: (singleSelectedProject ?? gt`All projects`);
const selectedProjects = new Set(projectDraft ?? props.selectedProjectKeys);
const selectedProjects = new Set(props.selectedProjectKeys);
const hiddenProjectKeys =
props.selectedEnvironmentId === null ? [] : (props.hiddenProjectKeys ?? []);

Expand All @@ -83,7 +81,6 @@ export function AndroidHomeListFilters(
title: gt`All projects`,
state: selectedProjects.size === 0 ? ("on" as const) : ("off" as const),
},
{ id: PROJECT_DONE, title: gt`Done` },
...props.projects.map((project) => ({
id: actionId("project", project.key),
title: project.label,
Expand All @@ -110,31 +107,21 @@ export function AndroidHomeListFilters(
if (parsed[1] === null) props.onEnvironmentChange(null);
else if (selected) props.onEnvironmentChange(selected.environmentId);
};
const applyProjectDraft = () => {
if (projectDraft !== null) {
props.onProjectsChange([
...props.projects.filter((project) => selectedProjects.has(project.key)).map((p) => p.key),
...hiddenProjectKeys,
]);
}
setProjectDraft(null);
};
const selectProject = (id: string) => {
if (id === ALL_PROJECTS) {
setProjectDraft([]);
return;
}
if (id === PROJECT_DONE) {
applyProjectDraft();
props.onProjectsChange([...hiddenProjectKeys]);
return;
}
const parsed = parseActionId(id);
if (parsed?.[0] !== "project" || parsed[1] === null) return;
const key = parsed[1];
setProjectDraft((current) => {
const keys = current ?? props.selectedProjectKeys;
return keys.includes(key) ? keys.filter((item) => item !== key) : [...keys, key];
});
const nextSelected = new Set(props.selectedProjectKeys);
if (nextSelected.has(key)) nextSelected.delete(key);
else nextSelected.add(key);
props.onProjectsChange([
...props.projects.filter((project) => nextSelected.has(project.key)).map((p) => p.key),
...hiddenProjectKeys,
]);
};

return (
Expand Down Expand Up @@ -192,7 +179,7 @@ export function AndroidHomeListFilters(
className="min-w-0 max-w-full shrink"
title={gt`Filter projects`}
actions={projectActions}
keepOpen={(action) => action.id !== PROJECT_DONE}
keepOpen={(action) => action.id !== ALL_PROJECTS}
onPressAction={({ nativeEvent }) => selectProject(nativeEvent.event)}
>
{(open, expanded) => (
Expand All @@ -203,10 +190,7 @@ export function AndroidHomeListFilters(
expanded={expanded}
icon={props.compact ? "folder" : undefined}
pill={props.pill}
onPress={() => {
setProjectDraft(null);
open();
}}
onPress={open}
/>
)}
</AndroidAnchoredMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,22 +295,17 @@ it("applies environment and project scopes from anchored menus", () => {

click("Filter threads by project: " + longProject);
expect(menu()?.getAttribute("aria-label")).toBe("Filter projects");
expect(menu()?.textContent).not.toContain("Done");
expect(menuButton(longProject).getAttribute("aria-checked")).toBe("true");
expect(menuButton("Beta").getAttribute("aria-checked")).toBe("false");
clickInMenu("Beta");
expect(menu()).not.toBeNull();
expect(menuButton("Beta").getAttribute("aria-checked")).toBe("true");
expect(onProjectsChange).not.toHaveBeenCalled();
clickInMenu("Done");
expect(onProjectsChange).toHaveBeenLastCalledWith(["alpha", "beta", "remote"]);
expect(menu()).toBeNull();
expect(rootElement.querySelector("input")?.value).toBe("needle");

click("Filter threads by project: 2 projects selected");
clickInMenu("All projects");
expect(menu()).not.toBeNull();
expect(menuButton(longProject).getAttribute("aria-checked")).toBe("false");
clickInMenu("Done");
expect(menu()).toBeNull();
expect(onProjectsChange).toHaveBeenLastCalledWith(["remote"]);
button("Filter threads by project: All projects");

Expand All @@ -319,8 +314,11 @@ it("applies environment and project scopes from anchored menus", () => {
button("Filter threads by project: Remote project");
click("Filter threads by project: Remote project");
clickInMenu("Beta");
clickInMenu("Done");
expect(menu()).not.toBeNull();
expect(onProjectsChange).toHaveBeenLastCalledWith(["beta", "remote"]);
clickInMenu("Beta");
expect(menu()).not.toBeNull();
expect(onProjectsChange).toHaveBeenLastCalledWith(["remote"]);

click("More actions");
click("Manage environments");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ export function usePullRequestListFilters(props: {
];
const sortAction = {
id: "sort",
title: m(SORTS[value.sort]),
title: gt({ context: "noun, sort order menu" })`Sort`,
image: "arrow.up.arrow.down",
subactions: choices("sort", resolveOptions(SORTS, m), value.sort),
};
const reset = (withEnvironment: boolean): MenuProps["actions"][number] => ({
Expand Down
10 changes: 0 additions & 10 deletions apps/mobile/src/features/requirements/RequirementsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -735,16 +735,6 @@ function UnifiedRequirementBoard({
onPress: viewAction.onPress,
},
...managementItems,
...(Platform.OS === "android"
? [
{
id: "app-settings",
title: gt`Settings`,
icon: "gearshape" as const,
onPress: () => selectTab("settings"),
},
]
: []),
],
};

Expand Down
37 changes: 26 additions & 11 deletions apps/mobile/src/features/threads/ThreadSettingsSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,10 @@ type ThreadSettingsCatalogItem =
| {
readonly kind: "options";
readonly key: "options";
}
| {
readonly kind: "catalog";
readonly key: "catalog";
};

function ThreadSettingsModelListRow(props: {
Expand Down Expand Up @@ -1087,11 +1091,9 @@ function buildThreadSettingsCatalogItems(

function ThreadSettingsOptionsItem(props: {
readonly animationsReady: boolean;
readonly bottomInset: number;
readonly onOpenSubmenu: (submenu: ThreadSettingsSubmenuPage) => void;
}) {
const t = useUiTranslation();
const insets = useSafeAreaInsets();
const gt = useGT();
const m = useMessages();
const session = useThreadSettingsSession();
Expand All @@ -1103,7 +1105,7 @@ function ThreadSettingsOptionsItem(props: {
: null;

return (
<View style={{ paddingBottom: insets.bottom + props.bottomInset + 12 }}>
<View className="pb-2">
<ChatGptSharingStatus provider={selectedProvider} />
<Text className="px-5 pb-2 pt-2 text-sm font-t3-medium text-foreground-muted">
{t("Options")}
Expand Down Expand Up @@ -1173,7 +1175,17 @@ function ThreadSettingsOptionsItem(props: {
)}
</Animated.View>
</Animated.View>
</View>
);
}

function ThreadSettingsCatalogFooterItem(props: { readonly bottomInset: number }) {
const t = useUiTranslation();
const insets = useSafeAreaInsets();
const session = useThreadSettingsSession();

return (
<View style={{ paddingBottom: insets.bottom + props.bottomInset + 12 }}>
<Text className="px-5 pb-2 pt-7 text-sm font-t3-medium text-foreground-muted">
{t("Catalog")}
</Text>
Expand Down Expand Up @@ -1254,8 +1266,9 @@ function ThreadSettingsMainContent(props: {
session.providerFilter !== null ||
session.searchQuery.trim().length > 0;
const listItems = [
...(catalogItems.length === 0 ? ([{ kind: "empty", key: "empty" }] as const) : catalogItems),
{ kind: "options", key: "options" },
...(catalogItems.length === 0 ? ([{ kind: "empty", key: "empty" }] as const) : catalogItems),
{ kind: "catalog", key: "catalog" },
] satisfies ReadonlyArray<ThreadSettingsCatalogItem>;
// Rows recycle without an entering fade: keyed fades remounted every row scrolled into view and
// showed it half transparent. The list's item layout animation still moves rows on filter changes.
Expand Down Expand Up @@ -1298,13 +1311,15 @@ function ThreadSettingsMainContent(props: {
</View>
);
}
return (
<ThreadSettingsOptionsItem
animationsReady={animationsReady}
bottomInset={props.bottomInset}
onOpenSubmenu={props.onOpenSubmenu}
/>
);
if (item.kind === "options") {
return (
<ThreadSettingsOptionsItem
animationsReady={animationsReady}
onOpenSubmenu={props.onOpenSubmenu}
/>
);
}
return <ThreadSettingsCatalogFooterItem bottomInset={props.bottomInset} />;
};

return (
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/Drivers/antigravityUsageReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const MODEL_IDS: Record<number, string> = {
// Effort and routing variants share the base model's price.
export const antigravityRateModel = (model: string) => {
const base = model.replace(
/-(?:extra-low|low|medium|high|tiered|control|thinking|agent|orchestrator|trial|n|r)$/,
/(?:-(?:extra-low|xlow|low|medium|high|xhigh|extra-high|tiered|control|thinking|agent|orchestrator|trial|n|r))+$/,
"",
);
return /^gemini-3-flash-(?:agent(?:-[ab])?|[ab])$/.test(model)
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/usage/UsageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ export const make = Effect.gen(function* () {
const outputThroughput = yield* readUsageOutputThroughput(
input,
resolveModelAliases(settings.usageModelAliases),
scanned.buckets,
).pipe(
Effect.provideService(SqlClient.SqlClient, sql),
Effect.catch((error) =>
Expand Down
Loading
Loading