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

Tag ordering is defined as a number between 0 and 1, not strings #1139

Merged
merged 3 commits into from
Mar 5, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/client_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Unreleased changes
(`#1109 <https://github.com/matrix-org/matrix-doc/pull/1109>`_).
- Fix the representation of ``m.presence`` events
(`#1137 <https://github.com/matrix-org/matrix-doc/pull/1137>`_).
- Clarify that ``m.tag`` ordering is done with numbers, not strings
(`#1139 <https://github.com/matrix-org/matrix-doc/pull/1139>`_).

- Changes to the API which will be backwards-compatible for clients:

Expand Down
2 changes: 1 addition & 1 deletion event-schemas/examples/m.tag
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "m.tag",
"content": {
"tags": {
"work": {"order": 1}
"u.work": {"order": 1}
Copy link
Member Author

Choose a reason for hiding this comment

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

The spec recommends u.work, so I thought I'd throw that in here.

}
}
}
11 changes: 5 additions & 6 deletions specification/modules/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ the tags are for.
Each tag has an associated JSON object with information about the tag, e.g how
to order the rooms with a given tag.

Ordering information is given under the ``order`` key as a string. The string
are compared lexicographically by unicode codepoint to determine which should
displayed first. So a room with a tag with an ``order`` key of ``"apples"``
would appear before a room with a tag with an ``order`` key of ``"oranges"``.
If a room has a tag without an ``order`` key then it should appear after the
rooms with that tag that have an ``order`` key.
Ordering information is given under teh ``order`` key as a number between 0 and
1. The numbers are compared such that 0 is displayed first. Therefore a room
with an ``order`` of ``0.2`` would be displayed before a room with an ``order``
of ``0.7``. If a room has a tag without an ``order`` key then it should appear
after the rooms with that tag that have an ``order`` key.

The name of a tag MUST not exceed 255 bytes.

Expand Down