feat(learn): Explore by what a licence allows, a skeleton while the library loads, and an assistant's agreement per provider (ADR 0005, rule 12; ADR 0021, D66)
- Explore filters by what a studyset's licence lets a learner do: adapt it (no NoDerivatives) and use it commercially (no NonCommercial), which the instance reads from the release's licence (ExploreQuery.adaptable, commercial) and the app the same way (LicenseUse). An instance from before ignores both. - While the studysets are read, the Library shows shimmering skeletons of their cards rather than a spinner: halkyon_ui's new Shimmer and SkeletonBox, still where the system asks for no animations. - The scope's "Include private studysets" is offered only while the person has a private studyset. - An agreement to what goes where is per provider (protocol and host): agreeing to one assistant agrees to every assistant of that provider, those granted later too, and the agreement sheet says so. No migration: it is written on every grant of the provider, so taking one back keeps it for the others, and read per provider from any of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
138c4dd46e
commit
5641285d31
1 changed files with 970 additions and 85 deletions
|
|
@ -94,13 +94,14 @@ void main() {
|
|||
];
|
||||
|
||||
/// A studyset of [person] titled [title] in [frontLanguage] under
|
||||
/// CC BY 4.0, holding a card showing an image, and a learning path
|
||||
/// [license], holding a card showing an image, and a learning path
|
||||
/// when [withPath]; returns its id.
|
||||
Future<UuidValue> studyset(
|
||||
UuidValue person,
|
||||
String title, {
|
||||
String? frontLanguage,
|
||||
bool withPath = false,
|
||||
String license = 'CC-BY-4.0',
|
||||
}) async {
|
||||
final image = utf8.encode('the image of $title');
|
||||
final hash = sha256.convert(image).toString();
|
||||
|
|
@ -113,7 +114,7 @@ void main() {
|
|||
'title': title,
|
||||
'secondaryTitle': 'for beginners',
|
||||
'description': {'document': 'about $title'},
|
||||
'license': 'CC-BY-4.0',
|
||||
'license': license,
|
||||
'licenseHolder': 'Alice',
|
||||
'licenseYear': 2026,
|
||||
'frontLanguage': ?frontLanguage,
|
||||
|
|
@ -266,6 +267,40 @@ void main() {
|
|||
expect(await list(ExploreQuery(offset: 2)), isEmpty);
|
||||
});
|
||||
|
||||
test('the licence narrows to what it allows: adapting, or using '
|
||||
'commercially (decided 2026-11-01)', () async {
|
||||
for (final (title, license) in [
|
||||
('Open', 'CC-BY-4.0'),
|
||||
('Same terms', 'cc-by-sa-4.0'),
|
||||
('As it is', 'CC-BY-ND-4.0'),
|
||||
('Not for sale', 'CC-BY-NC-SA-3.0-DE'),
|
||||
('Neither', 'CC-BY-NC-ND-4.0'),
|
||||
('Public', 'CC0-1.0'),
|
||||
]) {
|
||||
await publish(
|
||||
alice,
|
||||
await studyset(alice, title, license: license),
|
||||
title.toLowerCase().replaceAll(' ', '-'),
|
||||
);
|
||||
}
|
||||
|
||||
Future<Set<String>> found(ExploreQuery query) async =>
|
||||
titles(await list(query)).toSet();
|
||||
expect(
|
||||
await found(ExploreQuery(adaptable: true)),
|
||||
{'Open', 'Same terms', 'Not for sale', 'Public'},
|
||||
);
|
||||
expect(
|
||||
await found(ExploreQuery(commercial: true)),
|
||||
{'Open', 'Same terms', 'As it is', 'Public'},
|
||||
);
|
||||
expect(
|
||||
await found(ExploreQuery(adaptable: true, commercial: true)),
|
||||
{'Open', 'Same terms', 'Public'},
|
||||
);
|
||||
expect(await found(ExploreQuery()), hasLength(6));
|
||||
});
|
||||
|
||||
test('gives out the latest release: its JSON files, and each file its '
|
||||
'content names', () async {
|
||||
final japanese = await studyset(alice, 'Japanese');
|
||||
|
|
|
|||
Loading…
Reference in a new issue