1
0
Fork 0

feat(preferences): add xpDisplayMini preference and update action

Add the xpDisplayMini checkbox to user display preferences, regenerate types, and accept it in updatePreferences.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Jason Fraley 2026-08-23 18:51:59 -04:00
parent a0c4eaabcf
commit b581670e72
3 changed files with 39 additions and 30 deletions

View file

@ -207,6 +207,7 @@ export async function updatePreferences(input: {
leadOrActual: "lead" | "actual";
discordEnabled: boolean;
discordMutedTypes: string[];
xpDisplayMini: boolean;
}): Promise<ActionResult> {
try {
const { payload, user } = await authenticate();
@ -219,7 +220,7 @@ export async function updatePreferences(input: {
(MUTEABLE_NOTIFICATION_VALUES as readonly string[]).includes(t),
);
await payload.update({
await payload.update({
collection: "users",
id: userId,
data: {
@ -229,6 +230,7 @@ export async function updatePreferences(input: {
showCallsign: input.showCallsign,
showVersionOverlay: input.showVersionOverlay,
leadOrActual: input.leadOrActual,
xpDisplayMini: input.xpDisplayMini,
},
discord: {
enabled: input.discordEnabled,

View file

@ -268,35 +268,41 @@ export const Users: CollectionConfig = {
},
],
},
{
name: "display",
label: "Display",
type: "group",
fields: [
{
name: "showCallsign",
label: "Show callsign (username) instead of display name in the sidebar",
type: "checkbox",
defaultValue: false,
},
{
name: "leadOrActual",
label: 'Use "Lead" or "Actual" when reviewing the unit roster',
type: "select",
options: [
{ label: "Lead", value: "lead" },
{ label: "Actual", value: "actual" },
],
defaultValue: "lead",
},
{
name: "showVersionOverlay",
label: "Show version overlay at top of page",
type: "checkbox",
defaultValue: true,
},
],
},
{
name: "display",
label: "Display",
type: "group",
fields: [
{
name: "showCallsign",
label: "Show callsign (username) instead of display name in the sidebar",
type: "checkbox",
defaultValue: false,
},
{
name: "leadOrActual",
label: 'Use "Lead" or "Actual" when reviewing the unit roster',
type: "select",
options: [
{ label: "Lead", value: "lead" },
{ label: "Actual", value: "actual" },
],
defaultValue: "lead",
},
{
name: "showVersionOverlay",
label: "Show version overlay at top of page",
type: "checkbox",
defaultValue: true,
},
{
name: "xpDisplayMini",
label: "Use mini mode for XP display",
type: "checkbox",
defaultValue: false,
},
],
},
{
name: "discord",
label: "Discord",

View file

@ -1313,6 +1313,7 @@ export interface User {
showCallsign?: boolean | null;
leadOrActual?: ('lead' | 'actual') | null;
showVersionOverlay?: boolean | null;
xpDisplayMini?: boolean | null;
};
discord?: {
enabled?: boolean | null;