feat: surface crawl exclude settings in viewer summary - #262
Merged
Conversation
…able Sibling exclude-setting fields already fall back via getJSON's default argument, but maxExcludedDepth is a plain integer column with no such guard, so a NULL row would leak through as null despite the Config type declaring number.
Add excludes, excludeKeywords, excludeUrls, and maxExcludedDepth to SummaryResult so getSummary() and getViewerSummary() report the same crawl-exclusion config already visible as baseUrl/roots. Both follow the existing baseUrl/roots convention: the fields are merged in from accessor.getConfig() at read time rather than stored in the viewer_summary read model, since they are config-derived and independent of the pages aggregation.
Render excludes, excludeKeywords, excludeUrls, and maxExcludedDepth below the existing roots list, matching its <p> row style. Each row is suppressed when its value is empty or zero, since most archives crawl without exclusions. Also guard the on-disk summary cache against artefacts written by an older nitpicker build: the cache's content-hash key does not change on a version upgrade, so a pre-upgrade summary.json missing the new fields would otherwise be replayed as-is and crash the view's data.excludes.length read. getOrComputeOnDisk now accepts an optional isValid callback, treating a failed check the same as corrupt JSON.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
excludes,excludeKeywords,excludeUrls,maxExcludedDepth) on the viewer summary screen, next to the existingrootslist — closes viewer summary does not surface crawl exclude settings (excludes/excludeKeywords/excludeUrls/maxExcludedDepth) #261SummaryResultgains the four fields;getSummary()/getViewerSummary()merge them in fromaccessor.getConfig()at read time, following the existingbaseUrl/rootsconvention (noviewer_summaryread-model schema change or version bump needed)summary.jsonmissing the new fields could otherwise be replayed as-is and crash the view.getOrComputeOnDisknow accepts an optionalisValidcallback, treated the same as corrupt JSON on failuremaxExcludedDepthto0whenNULLin theinfotable, matching the fallback already applied to its sibling exclude fieldsTest plan
yarn lint— 0 errorsyarn build(withNX_WORKSPACE_ROOT_PATHset for the worktree)yarn test— 602 files / 4372 tests passedget-summary.spec.ts,get-viewer-summary.spec.ts(both empty-default and non-empty passthrough),database.spec.ts(NULLmaxExcludedDepthfallback),precomputed-disk-cache.spec.ts/summary-cache.spec.ts(stale-cache-shape guard)create-app.spec.ts'sGET /api/summarytest now asserts exclude settings survive the fullarchive.setConfig()→getSummaryFastPath→ HTTP JSON pipeline🤖 Generated with Claude Code