Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 17 additions & 0 deletions .changeset/update-collection-lexicon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@hypercerts-org/lexicon": minor
---

Updated `org.hypercerts.claim.collection` lexicon:

- Added optional `type` field to specify collection type (e.g., 'favorites', 'project')
- Renamed fields for consistency:
- `collectionTitle` → `title`
- `shortCollectionDescription` → `shortDescription`
- `collectionDescription` → `description`
- Changed `description` from string to Leaflet linear document reference (`pub.leaflet.pages.linearDocument#main`) to support rich-text descriptions

**Breaking changes**:

- Field names have been renamed (e.g., `collectionTitle` → `title`)
- The `description` field now expects a reference object instead of a plain string
Binary file modified ERD-with-fields.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ERD-with-fields.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ERD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions ERD.puml
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ dataclass rights {
' by creating a location record with the same TID
dataclass collection {
!if (SHOW_FIELDS == "true")
collectionTitle
shortCollectionDescription?
collectionDescription?
type?
title
shortDescription?
description? (Leaflet ref)
items[]
createdAt
!endif
Expand Down
2 changes: 1 addition & 1 deletion ERD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,14 @@ Hypercerts-specific lexicons for tracking impact work and claims.

#### Properties

| Property | Type | Required | Description | Comments |
| ---------------------------- | -------- | -------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `collectionTitle` | `string` | ✅ | The title of this collection | maxLength: 800, maxGraphemes: 80 |
| `shortCollectionDescription` | `string` | ❌ | Short summary of this collection, suitable for previews and list views | maxLength: 3000, maxGraphemes: 300 |
| `collectionDescription` | `string` | ❌ | Full description of this collection, suitable for detail views | maxLength: 3000, maxGraphemes: 300 |
| `items` | `array` | ✅ | Array of strong references to items in this collection | Items can be activities (`org.hypercerts.claim.activity`) and/or other collections (`org.hypercerts.claim.collection`). Enables recursive nesting. |
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
| Property | Type | Required | Description | Comments |
| ------------------ | -------- | -------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | `string` | ❌ | The type of this collection (e.g., 'favorites', 'project') | |
| `title` | `string` | ✅ | The title of this collection | maxLength: 800, maxGraphemes: 80 |
| `shortDescription` | `string` | ❌ | Short summary of this collection, suitable for previews and list views | maxLength: 3000, maxGraphemes: 300 |
| `description` | `ref` | ❌ | Rich-text description, represented as a Leaflet linear document | References must conform to `pub.leaflet.pages.linearDocument#main` |
| `items` | `array` | ✅ | Array of strong references to items in this collection | Items can be activities (`org.hypercerts.claim.activity`) and/or other collections (`org.hypercerts.claim.collection`). Enables recursive nesting. |
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |

#### Example: Creating a Collection with Nested Items

Expand All @@ -426,8 +427,8 @@ import { TID } from "@atproto/common";

const collectionRecord = {
$type: "org.hypercerts.claim.collection",
collectionTitle: "Climate Action Projects",
shortCollectionDescription:
title: "Climate Action Projects",
shortDescription:
"A collection of climate-related activities and sub-collections",
items: [
// Reference to an activity
Expand Down Expand Up @@ -481,7 +482,7 @@ const tid = TID.nextStr(); // Same TID for both records
// Base collection record
const collectionRecord = {
$type: "org.hypercerts.claim.collection",
collectionTitle: "Carbon Offset Initiative",
title: "Carbon Offset Initiative",
items: [
{
uri: "at://did:plc:alice/org.hypercerts.claim.activity/3k2abc",
Expand Down
19 changes: 11 additions & 8 deletions lexicons/org/hypercerts/claim/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,28 @@
"key": "tid",
"record": {
"type": "object",
"required": ["collectionTitle", "items", "createdAt"],
"required": ["title", "items", "createdAt"],
"properties": {
"collectionTitle": {
"type": {
"type": "string",
"description": "The type of this collection. Possible fields can be 'favorites', 'project', or any other type of collection."
},
"title": {
"type": "string",
"description": "The title of this collection",
"maxLength": 800,
"maxGraphemes": 80
},
"shortCollectionDescription": {
"shortDescription": {
"type": "string",
"maxLength": 3000,
"maxGraphemes": 300,
"description": "Short summary of this collection, suitable for previews and list views"
},
"collectionDescription": {
"type": "string",
"maxLength": 3000,
"maxGraphemes": 300,
"description": "Full description of this collection, suitable for detail views"
"description": {
"type": "ref",
"ref": "pub.leaflet.pages.linearDocument#main",
"description": "Rich-text description, represented as a Leaflet linear document."
Comment thread
holkexyz marked this conversation as resolved.
},
"items": {
"type": "array",
Expand Down