fix: disable proper noun detection by default (too many false positives)
Proper noun detection (flagging capitalized phrases like "Getting Started", "Generate Design", "Introduction Getting Started") now disabled by default. Enable via popup → Options tab → Detect proper nouns. The pattern-based detection (IPs, emails, API keys, addresses, paths, etc.) remains always-on and reliable. The capitalized phrase heuristic was producing too many false positives on normal UI phrases, headings, and instructions — adding words to the filter was a losing game. Added detectProperNouns toggle to popup Options tab. Updated README to note it's opt-in. https://claude.ai/code/session_01SWSwDfMVij53bCTNSCLMwn
This commit is contained in:
@@ -604,9 +604,11 @@
|
||||
}
|
||||
|
||||
// Proper noun heuristic — catch names, company names, project names
|
||||
// that aren't configured in identity
|
||||
const properNouns = detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
// Disabled by default (too many false positives). Enable in Options.
|
||||
if (settings.detectProperNouns) {
|
||||
const properNouns = detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
}
|
||||
|
||||
// Deduplicate by value
|
||||
const seen = new Set();
|
||||
|
||||
@@ -136,7 +136,7 @@ const AutoDetect = {
|
||||
*
|
||||
* Returns array of { name, value, hint, category, index }
|
||||
*/
|
||||
scan(text, identity) {
|
||||
scan(text, identity, options) {
|
||||
if (!text || text.length < 5) return [];
|
||||
|
||||
const hasContext = CONTEXT_WORDS.test(text);
|
||||
@@ -194,8 +194,11 @@ const AutoDetect = {
|
||||
}
|
||||
|
||||
// Proper noun heuristic — catch names, company names, project names
|
||||
const properNouns = this._detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
// Disabled by default (too many false positives). Pass detectProperNouns: true to enable.
|
||||
if (options?.detectProperNouns) {
|
||||
const properNouns = this._detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
}
|
||||
|
||||
// Deduplicate overlapping matches
|
||||
findings.sort((a, b) => (a.index || 0) - (b.index || 0));
|
||||
|
||||
@@ -236,6 +236,14 @@
|
||||
<label class="toggle"><input type="checkbox" id="optDocPreview" checked><span class="toggle-slider"></span></label>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-label">
|
||||
<strong>Detect proper nouns</strong>
|
||||
<span class="setting-desc">Flag capitalized phrases (names, companies) — may produce false positives</span>
|
||||
</div>
|
||||
<label class="toggle"><input type="checkbox" id="optProperNouns"><span class="toggle-slider"></span></label>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:12px;padding-top:10px;border-top:1px solid #e5e7eb">
|
||||
<button class="btn" id="btnOpenFullOptions" style="width:100%;font-size:12px">Open Full Options Page</button>
|
||||
<p class="help-text" style="margin-top:6px;text-align:center">Sync, encryption, org, version history, import/export, and more</p>
|
||||
|
||||
@@ -225,6 +225,7 @@ async function initUnlockedUI() {
|
||||
$('#optAutoRedact').checked = settings.autoRedactDetected !== false;
|
||||
$('#optHighlights').checked = settings.showHighlights || false;
|
||||
$('#optDocPreview').checked = settings.docScanPreview !== false;
|
||||
$('#optProperNouns').checked = settings.detectProperNouns || false;
|
||||
|
||||
// Options tab change handlers
|
||||
const optHandlers = [
|
||||
@@ -233,6 +234,7 @@ async function initUnlockedUI() {
|
||||
['optAutoRedact', 'autoRedactDetected'],
|
||||
['optHighlights', 'showHighlights'],
|
||||
['optDocPreview', 'docScanPreview'],
|
||||
['optProperNouns', 'detectProperNouns'],
|
||||
];
|
||||
for (const [id, key] of optHandlers) {
|
||||
$(`#${id}`).addEventListener('change', async (e) => {
|
||||
|
||||
Reference in New Issue
Block a user