fix(live): expose full refresh busy and phase progress
Ensure full refresh marks the live projection as building before source refresh awaits, and expose phase-specific counters so language detection progress is determinate. Covers #40 and #41. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -9,6 +9,7 @@ const router = express.Router();
|
||||
|
||||
function serializeState(state) {
|
||||
const emptyProjectionWithLiveInput = state.total_count > 0 && state.projected_count === 0;
|
||||
const isLayaPhase = state.phase === 'laya_identity' || state.phase === 'laya_language';
|
||||
return {
|
||||
status: state.status,
|
||||
stale: state.status !== 'success' || emptyProjectionWithLiveInput,
|
||||
@ -21,6 +22,8 @@ function serializeState(state) {
|
||||
total: state.total_count,
|
||||
layaProcessed: state.laya_processed_count,
|
||||
layaTotal: state.laya_total_count,
|
||||
phaseProcessed: isLayaPhase ? state.laya_processed_count : state.processed_count,
|
||||
phaseTotal: isLayaPhase ? state.laya_total_count : state.total_count,
|
||||
error: state.error
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user