Skip to content

Commit 1307d97

Browse files
myftijaclaude
andauthored
fix(webapp): match environment when searching env variables (#3302)
Temporary workaround that enables filtering by environment in the envvars page, without changing any UI. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a340728 commit 1307d97

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Extended the search filter on the environment variables page to match on environment type (production, staging, development, preview) and branch name, not just variable name and value.

apps/webapp/app/hooks/useFuzzyFilter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { matchSorter } from "match-sorter";
88
*
99
* @param params - The parameters object
1010
* @param params.items - Array of objects to filter
11-
* @param params.keys - Array of object keys to perform the fuzzy search on
11+
* @param params.keys - Array of object keys to perform the fuzzy search on (supports dot-notation for nested properties)
1212
* @returns An object containing:
1313
* - filterText: The current filter text
1414
* - setFilterText: Function to update the filter text
@@ -28,7 +28,7 @@ export function useFuzzyFilter<T extends Object>({
2828
keys,
2929
}: {
3030
items: T[];
31-
keys: Extract<keyof T, string>[];
31+
keys: (Extract<keyof T, string> | (string & {}))[];
3232
}) {
3333
const [filterText, setFilterText] = useState("");
3434

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export default function Page() {
256256
const { filterText, setFilterText, filteredItems } =
257257
useFuzzyFilter<EnvironmentVariableWithSetValues>({
258258
items: environmentVariables,
259-
keys: ["key", "value"],
259+
keys: ["key", "value", "environment.type", "environment.branchName"],
260260
});
261261

262262
// Add isFirst and isLast to each environment variable

0 commit comments

Comments
 (0)