{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A user's chalky.town configuration, stored once at rkey `self` in whichever store its own `dataMode` names — the author's PDS repo in public mode, chalky.town's private per-DID store in private mode. So the record declaring a private preference is itself private, and nothing about the author's settings is world-readable when they asked for privacy. Read right after sign-in (both stores are checked, since the mode isn't known until the record is found) to route task data and to restore theme/preferences across devices. Two copies can only coexist if a mode switch was interrupted; `updatedAt` resolves that, and the loser is deleted.",
      "key": "literal:self",
      "record": {
        "properties": {
          "autoDone": {
            "description": "Mark a task done automatically once all its subtasks complete.",
            "type": "boolean"
          },
          "carryOver": {
            "description": "Auto-roll incomplete past tasks onto today on load.",
            "type": "boolean"
          },
          "colors": {
            "description": "The user's editable task-color palette, in display/hotkey order. Absent means the five built-in defaults. Hidden (removed) entries stay in this list so tasks that still reference them keep rendering their tint.",
            "items": {
              "ref": "#paletteColor",
              "type": "ref"
            },
            "maxLength": 32,
            "type": "array"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "dataMode": {
            "description": "Where the author's task records live. `public` = the author's own PDS repo (world-readable). `private` = chalky.town's per-DID private store, exportable on demand.",
            "enum": [
              "public",
              "private"
            ],
            "type": "string"
          },
          "hideStats": {
            "description": "Hide the Stats page (usage numbers) from the account menu.",
            "type": "boolean"
          },
          "somedayLabel": {
            "description": "Custom label for the unscheduled-tasks drawer; empty or absent means the default.",
            "maxGraphemes": 64,
            "maxLength": 256,
            "type": "string"
          },
          "somedayOpen": {
            "description": "Whether the Someday drawer is expanded.",
            "type": "boolean"
          },
          "sortStrategy": {
            "description": "How each day's tasks are auto-ordered. `none` keeps the manual drag order; `color` groups by the palette order (uncolored last); `completion` floats incomplete tasks up and sinks done ones by finish time; `color-completion` groups by color, then by completion within each group; `completion-color` leads with completion so every done task sinks below the unfinished ones, then orders each half by color.",
            "enum": [
              "none",
              "color",
              "completion",
              "color-completion",
              "completion-color"
            ],
            "type": "string"
          },
          "theme": {
            "description": "Preferred color mode.",
            "enum": [
              "light",
              "dark",
              "system"
            ],
            "type": "string"
          },
          "updatedAt": {
            "description": "Last edit; the last-write-wins clock for the config record.",
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "dataMode",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "paletteColor": {
      "properties": {
        "hex": {
          "description": "The color, as `#rrggbb`.",
          "maxLength": 7,
          "type": "string"
        },
        "hidden": {
          "description": "Removed from the active palette (toolbar/hotkeys/brush) but kept in the record so tasks still referencing it keep their tint.",
          "type": "boolean"
        },
        "id": {
          "description": "Stable slug for this color, also the `--hl-<id>` CSS-var suffix. Referenced by `town.chalky.task#color`.",
          "maxLength": 32,
          "type": "string"
        },
        "name": {
          "description": "Display name shown in tooltips and the color picker. Omitted means the swatch shows only its hotkey number.",
          "maxLength": 64,
          "type": "string"
        }
      },
      "required": [
        "id",
        "hex"
      ],
      "type": "object"
    }
  },
  "id": "town.chalky.config",
  "lexicon": 1
}
