Skip to content

Commit

Permalink
feat: 🚩 Add default note visibility preference
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed Dec 25, 2024
1 parent d267f23 commit 6384f9a
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
3 changes: 2 additions & 1 deletion components/composer/composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ import Files from "./files.vue";
const { Control_Enter, Command_Enter } = useMagicKeys();
const ctrlEnterSend = useSetting(SettingIds.CtrlEnterToSend);
const defaultVisibility = useSetting(SettingIds.DefaultVisibility);
const { play } = useAudio();
const fileInput = ref<HTMLInputElement | null>(null);
Expand Down Expand Up @@ -178,7 +179,7 @@ const state = reactive({
contentType: "text/markdown" as "text/markdown" | "text/plain",
visibility: (relation?.type === "edit"
? relation.note.visibility
: "public") as Status["visibility"],
: (defaultVisibility.value.value ?? "public")) as Status["visibility"],
files: (relation?.type === "edit"
? relation.note.media_attachments.map((a) => ({
apiId: a.id,
Expand Down
5 changes: 4 additions & 1 deletion messages/en-pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
"tired_happy_lobster_pet": "Change the ship's language. Requires resetting yer sails to apply.",
"keen_aware_goldfish_thrive": "King's English",
"vivid_mellow_sawfish_approve": "Fancy French",
"these_awful_ape_reside": "Pirate",
"gray_clean_shark_comfort": "The following URI parameters be required:",
"grand_spry_goldfish_embrace": "Yer URI parameters be invalid",
"honest_factual_carp_aspire": "Be yer certain yer want to send this deck decoration to Davy Jones' locker?",
Expand All @@ -342,5 +343,7 @@
"inclusive_long_lizard_boost": "Gravatar",
"proud_next_elk_beam": "URL",
"lower_formal_kudu_lift": "Gravatar email",
"witty_honest_wallaby_support": "Preview"
"witty_honest_wallaby_support": "Preview",
"loud_tense_kitten_exhale": "Default Visibility",
"vivid_last_crocodile_offer": "The default visibility for new notes."
}
4 changes: 3 additions & 1 deletion messages/en-rot.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,5 +343,7 @@
"inclusive_long_lizard_boost": "Gravatar",
"proud_next_elk_beam": "URL",
"lower_formal_kudu_lift": "Gravatar email",
"witty_honest_wallaby_support": "Preview"
"witty_honest_wallaby_support": "Preview",
"loud_tense_kitten_exhale": "Default Visibility",
"vivid_last_crocodile_offer": "The default visibility for new notes."
}
4 changes: 3 additions & 1 deletion messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,7 @@
"inclusive_long_lizard_boost": "Gravatar",
"proud_next_elk_beam": "URL",
"lower_formal_kudu_lift": "Gravatar email",
"witty_honest_wallaby_support": "Preview"
"witty_honest_wallaby_support": "Preview",
"loud_tense_kitten_exhale": "Default Visibility",
"vivid_last_crocodile_offer": "The default visibility for new notes."
}
6 changes: 4 additions & 2 deletions messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,13 @@
"kind_deft_myna_hint": "Échec de l'ajout de l'emoji.",
"frail_great_marten_pet": "Ajoutez un nouvel emoji sur le serveur.",
"whole_icy_puffin_smile": "Ajouter un Emoji",
"dirty_inclusive_meerkat_nudge": "Annuler",
"due_hour_husky_prosper": "Changer l'image",
"suave_broad_albatross_drop": "Ajoutez une image, un e-mail Gravatar ou utilisez une URL.",
"inclusive_long_lizard_boost": "Gravatar",
"proud_next_elk_beam": "URL",
"lower_formal_kudu_lift": "E-mail Gravatar",
"witty_honest_wallaby_support": "Aperçu"
"witty_honest_wallaby_support": "Aperçu",
"dirty_inclusive_meerkat_nudge": "Annuler",
"loud_tense_kitten_exhale": "Visibilité par défaut",
"vivid_last_crocodile_offer": "La visibilité par défaut pour les nouvelles notes."
}
26 changes: 26 additions & 0 deletions settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export enum SettingIds {
NotificationsSidebar = "notifications-sidebar",
AvatarShape = "avatar-shape",
SidebarStyle = "sidebar-style",
DefaultVisibility = "default-visibility",
}

export const settings = (): Record<SettingIds, Setting> => {
Expand All @@ -99,6 +100,31 @@ export const settings = (): Record<SettingIds, Setting> => {
page: SettingPages.Behaviour,
notImplemented: true,
} as BooleanSetting,
[SettingIds.DefaultVisibility]: {
title: m.loud_tense_kitten_exhale,
description: m.vivid_last_crocodile_offer,
type: SettingType.Enum,
value: "public",
options: [
{
value: "public",
label: m.lost_trick_dog_grace,
},
{
value: "unlisted",
label: m.funny_slow_jannes_walk,
},
{
value: "private",
label: m.grassy_empty_raven_startle,
},
{
value: "direct",
label: m.pretty_bold_baboon_wave,
},
],
page: SettingPages.Behaviour,
} as EnumSetting,
[SettingIds.Language]: {
title: m.pretty_born_jackal_dial,
description: m.tired_happy_lobster_pet,
Expand Down

0 comments on commit 6384f9a

Please sign in to comment.