Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3d3b878
test(status-panel): snapshot contract specs and native panel fake
Nov 23, 2026
3ba32bd
test(status-panel): push, throttle, robustness, privacy and panel act…
Nov 23, 2026
673a78f
test(status-panel): pin that hiding the window does not stop a recording
Nov 23, 2026
992346d
test(status-panel): gate start before the state flips; widen real-tim…
Nov 23, 2026
95e8103
feat(status-panel): pure snapshot of what the menu bar panel shows
Nov 23, 2026
530f9ad
feat(status-panel): push the snapshot to the menu bar panel and run i…
Nov 23, 2026
7a32ebd
feat(status-panel): native menu bar item and non-activating panel
Nov 23, 2026
71461af
chore(status-panel): drop unused imports, format
Nov 23, 2026
eb32210
fix(status-panel): hide the window through windowShouldClose, keep Do…
Nov 23, 2026
2135b4f
Merge remote-tracking branch 'origin/main' into oats-menubar
Nov 23, 2026
24b180f
test(status-panel): untranscribed markers, quit stops owned servers w…
Nov 23, 2026
6aebfba
fix(status-panel): hide untranscribed markers from the panel tail
Nov 23, 2026
d0c6efa
feat(status-panel): quit stops the note and every owned server, bounded
Nov 23, 2026
1f6852f
feat(status-panel): route every quit through Dart; restyle the panel
Nov 23, 2026
5f3dae9
test(status-panel): quit keeps skipped text pending; suggest call; sh…
Nov 23, 2026
e11760e
Merge remote-tracking branch 'origin/main' into oats-menubar
Nov 23, 2026
dd2a1ab
fix(backfill): note a session pending before each attempt, uncounted
Nov 23, 2026
912a766
feat(status-panel): 'suggest' once per new suggestion; showStart key
Nov 23, 2026
5f9ee33
fix(status-panel): quit without the modal run loop; suggest popup; Ap…
Nov 23, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ final class GapBackfillRetry {
await _write(pending);
return false;
}
// Noté en attente AVANT la tentative, sans la compter : si l'app se
// termine pendant (Quitter passe la finalisation et arrête le serveur),
// le lancement suivant reprend la session et la tentative coupée ne
// compte pas.
if (!pending.containsKey(sessionId)) {
pending[sessionId] = 0;
await _write(pending);
}
final BackfillOutcome outcome = await _backfill.backfill(
sessionId,
recordingsDirectory: _directory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TranscriptBlock {

/// Un repère (perte ou passage non transcrit) reste seul : il n'est la
/// phrase de personne.
bool _isMarker(String text) =>
bool isTranscriptMarker(String text) =>
text.startsWith(LiveTranscriptionService.gapMarkerPrefix) ||
LiveTranscriptionService.isUntranscribedMarker(text);

Expand All @@ -47,8 +47,8 @@ List<TranscriptBlock> groupTranscript(
final bool sameSpeaker =
speaker == null || last.speaker == null || speaker == last.speaker;
final bool continues =
!_isMarker(last.segment.text) &&
!_isMarker(seg.text) &&
!isTranscriptMarker(last.segment.text) &&
!isTranscriptMarker(seg.text) &&
last.segment.source == seg.source &&
sameSpeaker &&
!_sentenceEnd.hasMatch(last.segment.text.trim()) &&
Expand Down
13 changes: 13 additions & 0 deletions apps/app_macos/lib/core/platform/owned_processes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,19 @@ final class OwnedProcessRegistry {
}
}

/// Quitter l'app : arrête tous les serveurs lancés par ce registre, en
/// parallèle (chacun borné comme [stop], ~15 s au pire). Un échec sur l'un
/// est noté et n'arrête pas les autres ; son entrée reste dans le fichier
/// d'état pour le nettoyage du lancement suivant. Ne lève jamais.
Future<void> stopAll() async {
await Future.wait(<Future<void>>[
for (final String role in _live.keys.toList())
stop(role).catchError((Object e) {
_log.warning('$role non arrêté en quittant: $e');
}),
]);
}

/// Sonde de santé, par l'hôte.
Future<bool> isHealthy(Uri url) => _host.isHealthy(url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart' show visibleForTesting;
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/services.dart';
import 'package:core_domain/domain/entities/english_feedback.entity.dart';
import 'package:core_domain/domain/entities/session.entity.dart';
import 'package:core_domain/domain/entities/session_calendar_link.dart';
import 'package:core_domain/domain/entities/transcript_segment.entity.dart';
import 'package:core_domain/domain/enum/audio_source.enum.dart';
Expand Down Expand Up @@ -243,8 +244,9 @@ class LiveTranscriptionViewModel extends _$LiveTranscriptionViewModel {
calendarLink: calendarLink,
);
_log.info('startTranscription OK');
final String? sessionId = _liveService?.currentSessionStream.value?.id;
if (sessionId != null) _answers.start(sessionId);
final SessionEntity? session = _liveService?.currentSessionStream.value;
state = state.copyWith(sessionTitle: session?.title);
if (session != null) _answers.start(session.id);
} catch (e) {
_log.error('ERREUR startTranscription: $e');
if (e is PlatformException && e.code == 'MIC_PERMISSION_DENIED') {
Expand Down Expand Up @@ -330,6 +332,7 @@ class LiveTranscriptionViewModel extends _$LiveTranscriptionViewModel {
segments: <TranscriptSegmentEntity>[],
duration: Duration.zero,
speakerLabels: <String, int>{},
sessionTitle: null,
);

// Sauvegarder la transcription en local
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:core_domain/domain/enum/audio_source.enum.dart';
import 'package:core_presentation/core_presentation.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
Expand All @@ -9,6 +8,7 @@ import 'package:ici_transcript/application/services/live_answers/live_question.d
import 'package:ici_transcript/core/providers/services/live_answers.service.provider.dart';
import 'package:ici_transcript/features/live_transcription/presentation/screens/live/live_transcription.state.dart';
import 'package:ici_transcript/features/live_transcription/presentation/screens/live/live_transcription.view_model.dart';
import 'package:ici_transcript/features/live_transcription/presentation/screens/live/widgets/transcript_line.widget.dart';
import 'package:ici_transcript/features/shared/presentation/widgets/question_answer.widget.dart';
import 'package:ici_transcript/generated/translations/locale_keys.g.dart';

Expand Down Expand Up @@ -217,11 +217,7 @@ class _QuestionCard extends StatelessWidget {
}

static String _speaker(LiveQuestion q, int? n) =>
q.source == AudioSource.input
? LocaleKeys.transcription_live_speaker_me.tr()
: n == null
? LocaleKeys.transcription_live_speaker_system.tr()
: LocaleKeys.transcription_live_speaker_n.tr(args: <String>['${n + 1}']);
liveSpeakerLabel(q.source, n);

// Le générateur d'easy_localization ne crée pas de constante pour une clé
// nommée « other » (mot réservé des pluriels).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:ici_transcript/generated/translations/locale_keys.g.dart';

/// Qui parle en direct : « Vous » au micro, « Interlocuteur n » quand le son
/// du Mac est attribué ([speaker] 0, 1, …), sinon « Interlocuteur ».
String liveSpeakerLabel(AudioSource source, int? speaker) =>
source == AudioSource.input
? LocaleKeys.transcription_live_speaker_me.tr()
: speaker == null
? LocaleKeys.transcription_live_speaker_system.tr()
: LocaleKeys.transcription_live_speaker_n.tr(
args: <String>['${speaker + 1}'],
);

/// Une ligne de transcription en direct : qui parle, quand, le texte, puis la
/// traduction éventuelle.
class TranscriptLineWidget extends StatelessWidget {
Expand Down Expand Up @@ -41,14 +52,7 @@ class TranscriptLineWidget extends StatelessWidget {
Widget build(BuildContext context) {
final Oats o = context.oats;
final bool isInput = segment.source == AudioSource.input;
final int? who = isInput ? null : speaker;
final String label = isInput
? LocaleKeys.transcription_live_speaker_me.tr()
: who != null
? LocaleKeys.transcription_live_speaker_n.tr(
args: <String>['${who + 1}'],
)
: LocaleKeys.transcription_live_speaker_system.tr();
final String label = liveSpeakerLabel(segment.source, speaker);
final String? t = translation?.trim();

return Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ import 'package:ici_transcript/generated/translations/locale_keys.g.dart';
/// Largeur de l'invite de réunion.
const double kMeetingSuggestionWidth = 340;

/// Titre d'une suggestion : l'événement, ou « Appel détecté ».
String suggestionTitle(MeetingSuggestion s) => switch (s.source) {
MeetingSource.calendar => s.event?.title ?? '',
MeetingSource.call => LocaleKeys.meeting_suggestion_call_title.tr(),
};

/// Détail d'une suggestion : « 10:00–10:30 », ou le nom de l'app d'appel.
String suggestionDetail(MeetingSuggestion s) => switch (s.source) {
MeetingSource.calendar when s.event != null =>
'${formatStartTime(s.event!.start)}–${formatStartTime(s.event!.end)}',
MeetingSource.call => s.appName ?? '',
_ => '',
};

/// Invite non bloquante « Démarrer la note / Ignorer », en bas à droite du
/// contenu ; rien quand il n'y a pas de suggestion.
class MeetingSuggestionPrompt extends ConsumerWidget {
Expand All @@ -24,16 +38,8 @@ class MeetingSuggestionPrompt extends ConsumerWidget {
meetingSuggestionControllerProvider.notifier,
);
final Oats o = context.oats;
final String title = switch (s.source) {
MeetingSource.calendar => s.event?.title ?? '',
MeetingSource.call => LocaleKeys.meeting_suggestion_call_title.tr(),
};
final String detail = switch (s.source) {
MeetingSource.calendar when s.event != null =>
'${formatStartTime(s.event!.start)}–${formatStartTime(s.event!.end)}',
MeetingSource.call => s.appName ?? '',
_ => '',
};
final String title = suggestionTitle(s);
final String detail = suggestionDetail(s);
return Semantics(
liveRegion: true,
container: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import 'package:core_domain/domain/entities/transcript_segment.entity.dart';
import 'package:ici_transcript/application/services/live_answers/live_question.dart';
import 'package:ici_transcript/application/services/transcript_grouping.dart';
import 'package:ici_transcript/application/services/meeting/meeting_rules.dart';
import 'package:ici_transcript/features/live_transcription/presentation/screens/live/live_transcription.state.dart';
import 'package:ici_transcript/features/live_transcription/presentation/screens/live/widgets/transcript_line.widget.dart';
import 'package:ici_transcript/features/shared/presentation/widgets/question_answer.widget.dart';
import 'package:ici_transcript/features/shell/presentation/meeting_suggestion.widget.dart';

/// Phrases finies montrées par le panneau de barre de menus.
const int kStatusPanelTranscriptLines = 3;

/// Ce que le panneau de barre de menus (Swift, canal
/// `com.icitranscript/status_panel`) affiche : seulement des String, int,
/// bool, null, List et Map. Contrat détaillé en tête de
/// test/features/status_panel/status_panel_snapshot_test.dart.
Map<String, Object?> statusPanelSnapshot({
required LiveTranscriptionState live,
required List<LiveQuestion> questions,
required MeetingSuggestion? suggestion,
required bool dictating,
}) {
final String status = live.finalisingRemaining != null
? 'finalising'
: live.isPaused
? 'paused'
: live.isRecording
? 'recording'
: 'idle';
return <String, Object?>{
'status': status,
'elapsedSeconds': live.duration.inSeconds,
'finalisingSeconds': live.finalisingRemaining?.inSeconds,
'title': status == 'idle' ? null : live.sessionTitle,
'transcript': _transcript(live),
'question': questions.isEmpty ? null : _question(questions.last),
'suggestion': suggestion == null ? null : statusPanelSuggestion(suggestion),
'dictating': dictating,
// Un seul « Démarrer la note » : celui de la suggestion s'il y en a une.
'showStart': status == 'idle' && suggestion == null,
};
}

/// Suggestion telle que le panneau l'affiche (`suggestion`, `suggest`).
Map<String, Object?> statusPanelSuggestion(MeetingSuggestion s) =>
<String, Object?>{
'kind': s.source.name,
'title': suggestionTitle(s),
'detail': suggestionDetail(s),
};

/// Phrase finie : ni phrase en cours, ni passage provisoire, ni repère
/// (perte ou passage non transcrit).
bool _finished(TranscriptSegmentEntity s) =>
!s.id.startsWith('current_') &&
!s.id.endsWith('_pending') &&
!isTranscriptMarker(s.text);

List<Object?> _transcript(LiveTranscriptionState live) {
final List<TranscriptSegmentEntity> done = live.segments
.where(_finished)
.toList();
return <Object?>[
for (final TranscriptSegmentEntity s in done.skip(
done.length > kStatusPanelTranscriptLines
? done.length - kStatusPanelTranscriptLines
: 0,
))
<String, Object?>{
'speaker': liveSpeakerLabel(s.source, live.speakerLabels[s.id]),
'source': s.source.name,
'text': s.text,
},
];
}

Map<String, Object?> _question(LiveQuestion q) => <String, Object?>{
'id': q.id,
'text': q.text,
'state': q.status.name,
'answer': answerPlainText(q.answer),
// Coupée au milieu d'une phrase OU lignes non montrées : pour le panneau,
// une seule mention « réponse raccourcie » (le contrat n'a qu'une clé).
'truncated': q.truncated || q.shortened,
'sources': <Object?>[for (final AnswerSource s in q.sources) s.title],
};
Loading
Loading