MCPcopy Create free account
hub / github.com/Noumena-Network/code / recordGapFillAnalysis

Function recordGapFillAnalysis

src/ink/logUpdateRenderStats.ts:356–409  ·  view source on GitHub ↗
(
  stats:
    | {
        fillableCells: number
        blocker:
          | 'none'
          | 'active-hyperlink'
          | 'invalid-range'
          | 'content-end'
          | 'non-space-char'
          | 'space-metadata'
          | 'default-style-mismatch'
          | 'fg-style-mismatch'
      }
    | null,
)

Source from the content-addressed store, hash-verified

354}
355
356export function recordGapFillAnalysis(
357 stats:
358 | {
359 fillableCells: number
360 blocker:
361 | 'none'
362 | 'active-hyperlink'
363 | 'invalid-range'
364 | 'content-end'
365 | 'non-space-char'
366 | 'space-metadata'
367 | 'default-style-mismatch'
368 | 'fg-style-mismatch'
369 }
370 | null,
371): void {
372 if (!stats) {
373 return
374 }
375
376 logUpdateRenderStats.totalGapAnalysisCalls += 1
377
378 if (stats.blocker === 'none') {
379 return
380 }
381
382 if (stats.fillableCells > 0) {
383 logUpdateRenderStats.totalPartialGapFillCandidateCalls += 1
384 logUpdateRenderStats.totalPartialGapFillCandidateCells += stats.fillableCells
385 }
386
387 switch (stats.blocker) {
388 case 'active-hyperlink':
389 logUpdateRenderStats.totalGapBlockedByActiveHyperlink += 1
390 return
391 case 'content-end':
392 logUpdateRenderStats.totalGapBlockedByContentEnd += 1
393 return
394 case 'non-space-char':
395 logUpdateRenderStats.totalGapBlockedByNonSpaceChar += 1
396 return
397 case 'space-metadata':
398 logUpdateRenderStats.totalGapBlockedBySpaceMetadata += 1
399 return
400 case 'default-style-mismatch':
401 logUpdateRenderStats.totalGapBlockedByDefaultStyleMismatch += 1
402 return
403 case 'fg-style-mismatch':
404 logUpdateRenderStats.totalGapBlockedByFgStyleMismatch += 1
405 return
406 case 'invalid-range':
407 return
408 }
409}
410
411export function recordBufferedGapFill(cells: number): void {
412 if (cells <= 0) {

Callers 1

renderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected