Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom label definitions and tune various behaviors #2237

Merged
merged 17 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 7 additions & 32 deletions lexicons/app/bsky/moderation/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"likeCount": { "type": "integer", "minimum": 0 },
"viewer": { "type": "ref", "ref": "#modServiceViewerState" },
"indexedAt": { "type": "string", "format": "datetime" },
Expand All @@ -34,15 +25,6 @@
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"policies": {
"type": "ref",
"ref": "app.bsky.moderation.defs#modServicePolicies"
Expand All @@ -64,29 +46,22 @@
},
"modServicePolicies": {
"type": "object",
"required": ["reportReasons", "labelValues"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm dropping the custom report reasons for now, we'll FF with it but I think we gotta eject for now

"required": ["labelValues"],
"properties": {
"description": {
"type": "string",
"maxGraphemes": 10000,
"maxLength": 100000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"reportReasons": {
"labelValues": {
"type": "array",
"description": "The label values which this labeler publishes. Be sure to prefix custom labels with 'x-'.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to check - we're doing away with both descriptions?

"items": {
"type": "ref",
"ref": "com.atproto.moderation.defs#reasonType"
"ref": "com.atproto.label.defs#labelValue"
}
},
"labelValues": {
"customLabelValues": {
"type": "array",
"description": "Label values created by this labeler and scoped exclusively to it.",
"items": {
"type": "ref",
"ref": "com.atproto.label.defs#labelValue"
"ref": "com.atproto.label.defs#labelValueDefinition"
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions lexicons/app/bsky/moderation/service.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
"type": "object",
"required": ["policies", "createdAt"],
"properties": {
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"policies": {
"type": "ref",
"ref": "app.bsky.moderation.defs#modServicePolicies"
Expand Down
53 changes: 53 additions & 0 deletions lexicons/com/atproto/label/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,59 @@
}
}
},
"labelValueDefinition": {
"type": "object",
"description": "Declares a label value and its expected interpertations and behaviors.",
"properties": {
"identifier": {
"type": "string",
"description": "The value of the label being defined. When a definition is created by a labeling service, an 'x-' prefix will automatically be applied whether that prefix is included in this value or not. That prefix indicates that it is a custom label created by the labeling service."
},
"severity": {
"type": "string",
"description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning.",
"knownValues": ["inform", "alert"]
},
"blurs": {
"type": "string",
"description": "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",
"knownValues": ["content", "media", "none"]
},
"defaultSetting": {
"type": "string",
"description": "The default preference for the client to use on this label, if the user hasn't chosen a preference.",
"knownValues": ["hide", "warn", "ignore"]
},
"locales": {
"type": "array",
"items": { "type": "ref", "ref": "#labelValueDefinitionStrings" }
}
}
},
"labelValueDefinitionStrings": {
"type": "object",
"description": "Strings which describe the label in the UI, localized into a specific language.",
"required": ["lang", "name", "description"],
"properties": {
"lang": {
"type": "string",
"description": "The code of the language these strings are written in.",
"format": "language"
},
"name": {
"type": "string",
"description": "A short human-readable name for the label.",
"maxGraphemes": 64,
"maxLength": 640
},
"description": {
"type": "string",
"description": "A longer description of what the label means and why it might be applied.",
"maxGraphemes": 10000,
"maxLength": 100000
}
}
},
"labelValue": {
"type": "string",
"knownValues": [
Expand Down
Loading