From ad7da62e5bf46b22f02f0017e6d64ea837c040ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 09:44:43 +0000 Subject: [PATCH 1/2] Initial plan From a66da914184da0ce909fac68498886b5756ce27e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 09:49:56 +0000 Subject: [PATCH 2/2] Fix table_filters.js path matching to prevent filters on individual demo pages Co-authored-by: cpholguera <29175115+cpholguera@users.noreply.github.com> --- docs/javascripts/table_filters.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/javascripts/table_filters.js b/docs/javascripts/table_filters.js index 742eeb0a8..6eef86565 100644 --- a/docs/javascripts/table_filters.js +++ b/docs/javascripts/table_filters.js @@ -276,6 +276,25 @@ history.replaceState(null, null, value ? ('#' + value) : '#'); } + // Helper function to check if a path represents an index page + function isIndexPage(path, configPath) { + // Exact match + if (path === configPath) return true; + + // Index page variations + if (path === configPath + 'index' || path === configPath + 'index.html') return true; + + // Check if path is exactly the config path with no additional segments + // For /MASTG/demos/, we want to match /MASTG/demos/ but not /MASTG/demos/android/ + if (path.startsWith(configPath)) { + const remainder = path.substring(configPath.length); + // Allow only empty string, 'index', or 'index.html' after the config path + return remainder === '' || remainder === 'index' || remainder === 'index.html'; + } + + return false; + } + // Main initializer: find all candidate tables and enhance function configureDynamicTables() { // Clean previously registered custom filters (from prior SPA navigations) @@ -288,7 +307,7 @@ // Activate only on specific index pages defined in PAGE_CONFIG let pageGroups = null; for (const [key, groups] of Object.entries(PAGE_CONFIG)) { - if (path.indexOf(key) !== -1) { pageGroups = groups; break; } + if (isIndexPage(path, key)) { pageGroups = groups; break; } } if (!pageGroups) return;