Skip to content

Commit 7e6c6c6

Browse files
Update github-gist extension (#16729)
* Update github-gist extension * Update CHANGELOG.md and optimise images --------- Co-authored-by: raycastbot <[email protected]>
1 parent 3ecb95c commit 7e6c6c6

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

extensions/github-gist/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# GitHub Gist Changelog
22

3+
## [Update GitHub Gist] - 2025-02-02
4+
5+
- Add a new preference to set the default gist tag.
6+
37
## [Reduce GitHub Authentication] - 2024-07-16
48

59
- Reduce GitHub authentication permissions to access only GitHub Gist content

extensions/github-gist/package.json

+24-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"LunaticMuch",
1111
"pernielsentikaer",
1212
"stelo",
13-
"nbbaier"
13+
"nbbaier",
14+
"ridemountainpig"
1415
],
1516
"categories": [
1617
"Developer Tools",
@@ -68,6 +69,28 @@
6869
"description": "Show gist content details.",
6970
"default": true
7071
},
72+
{
73+
"name": "defaultGistTag",
74+
"type": "dropdown",
75+
"description": "Default filter tag for the gist item. If \"Remember Filter Tag\" is enabled, this will be ignored.",
76+
"required": false,
77+
"title": "Default Filter Tag",
78+
"default": "My Gists",
79+
"data": [
80+
{
81+
"title": "My Gists",
82+
"value": "My Gists"
83+
},
84+
{
85+
"title": "Starred Gists",
86+
"value": "Starred Gists"
87+
},
88+
{
89+
"title": "Public Gists",
90+
"value": "Public Gists"
91+
}
92+
]
93+
},
7194
{
7295
"name": "primaryAction",
7396
"type": "dropdown",

extensions/github-gist/src/search-gists.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useMemo, useState } from "react";
33
import { formatGistContentDetail } from "./util/utils";
44
import { GistAction } from "./components/gist-action";
55
import { ActionSettings } from "./components/action-settings";
6-
import { perPage, rememberTag, showDetail } from "./types/preferences";
6+
import { perPage, rememberTag, showDetail, defaultGistTag } from "./types/preferences";
77
import { useFrontmostApp } from "./hooks/useFrontmostApp";
88
import { withGitHubClient } from "./components/with-github-client";
99
import { useCachedPromise } from "@raycast/utils";
@@ -80,7 +80,10 @@ function SearchGists() {
8080
setTag(newValue as GithubGistTag);
8181
}}
8282
>
83-
{githubGistTags.map((tag) => {
83+
{[
84+
...githubGistTags.filter((tag) => tag.value === defaultGistTag),
85+
...githubGistTags.filter((tag) => tag.value !== defaultGistTag),
86+
].map((tag) => {
8487
return <List.Dropdown.Item key={tag.title} title={tag.title} value={tag.value} icon={tag.icon} />;
8588
})}
8689
</List.Dropdown>

extensions/github-gist/src/types/preferences.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ interface Preferences {
55
perPage: string;
66
"remember-tag": boolean;
77
detail: boolean;
8+
defaultGistTag: string;
89
primaryAction: string;
910
}
1011
export const {
1112
"access-token": personalAccessTokens,
1213
perPage,
1314
"remember-tag": rememberTag,
1415
detail: showDetail,
16+
defaultGistTag: defaultGistTag,
1517
primaryAction,
1618
} = getPreferenceValues<Preferences>();

0 commit comments

Comments
 (0)