feat(app,learn): shared spaces' members on the device
Step 4 (e) of ADR 0044, its first part, for every app's screens. - halkyon_app: `SharedSpaceGateway` on the module's `sharedSpace` endpoint (the spaces, their members and roles, inviting, handing on, leaving), refusals as `SpaceRefused`; `SharedKeys.trustIn` gives each member's safety code and whether it was compared or their keys changed, `markCompared`, and `trustNewKeys`, which pins the keys whose code was compared and never those the instance hands next. `FakeSharedSpaceServer` keeps the module's rules for tests, in step with `FakeSharedKeysServer`, which now knows members' handles. - Learn's sharing makes its space through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
4b900aa930
commit
02bb24428c
1 changed files with 688 additions and 10 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:halkyon_app/halkyon_app.dart'
|
||||
show SharedSpaceGateway, SpaceInfo, SpaceMember, SpaceRole;
|
||||
import 'package:halkyon_app/testing.dart'
|
||||
show FakeFileServerGateway, MemoryFileCache;
|
||||
import 'package:halkyon_editor/halkyon_editor.dart';
|
||||
|
|
@ -18,7 +20,6 @@ import 'package:halkyon_learn_flutter/src/feature/learning_path/data/path_progre
|
|||
import 'package:halkyon_learn_flutter/src/feature/note/data/note_repository.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/pdf_source/data/pdf_source_repository.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/publish/model/publication.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/sharing/data/shared_space_gateway.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/sharing/data/studyset_sharing.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/study/data/review_repository.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/study/model/rating.dart';
|
||||
|
|
@ -303,7 +304,8 @@ class _Spaces() implements SharedSpaceGateway {
|
|||
final deleted = <String>[];
|
||||
|
||||
@override
|
||||
Future<String> create() async {
|
||||
Future<String> create(String kind) async {
|
||||
expect(kind, 'studyset');
|
||||
final space = 'space-${made.length + 1}';
|
||||
made.add(space);
|
||||
return space;
|
||||
|
|
@ -311,6 +313,32 @@ class _Spaces() implements SharedSpaceGateway {
|
|||
|
||||
@override
|
||||
Future<void> delete(String space) async => deleted.add(space);
|
||||
|
||||
@override
|
||||
Future<List<SpaceInfo>> mine() => throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future<List<SpaceMember>> members(String space) => throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future<SpaceMember> invite(String space, String handle, SpaceRole role) =>
|
||||
throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future<void> setRole(String space, String member, SpaceRole role) =>
|
||||
throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future<void> remove(String space, String member) =>
|
||||
throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future<void> handOn(String space, String member) =>
|
||||
throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future<void> leave(String space, {String? nextOwner}) =>
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
/// The device's side of a new space: the spaces readied and the studysets
|
||||
|
|
|
|||
Loading…
Reference in a new issue