Skip to content

Commit 0261fe5

Browse files
authored
Merge pull request #133 from mustan-ali/main
Ensure consistent text color for modal overlay across themes
2 parents 51721cf + 6fb02c1 commit 0261fe5

File tree

2 files changed

+86
-76
lines changed

2 files changed

+86
-76
lines changed

static/index-nodejs.html

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
--text: #1e293b;
2727
--text-secondary: #64748b;
2828
--text-muted: #94a3b8;
29+
--text-modal: #4a5568;
2930
--border: #e2e8f0;
3031
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
3132
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
@@ -424,6 +425,10 @@
424425
padding: 1rem;
425426
}
426427

428+
.modal-overlay {
429+
color: var(--text-modal);
430+
}
431+
427432
.modal-content {
428433
background: var(--bg);
429434
border-radius: 0.75rem;
@@ -945,7 +950,7 @@ <h4>Workflow Diagram</h4>
945950
const selectedCategory = e.target.value;
946951
console.log(`Category filter changed to: ${selectedCategory}`);
947952
console.log('Current category map size:', this.state.categoryMap.size);
948-
953+
949954
this.state.filters.category = selectedCategory;
950955
this.state.currentPage = 1;
951956
this.resetAndSearch();
@@ -1018,7 +1023,7 @@ <h4>Workflow Diagram</h4>
10181023
if (e.key === 'Escape') {
10191024
this.closeModal();
10201025
}
1021-
1026+
10221027
// Zoom shortcuts when diagram is visible
10231028
if (!this.elements.diagramSection.classList.contains('hidden')) {
10241029
if (e.key === '+' || e.key === '=') {
@@ -1084,10 +1089,10 @@ <h4>Workflow Diagram</h4>
10841089
// Load categories first, then stats and workflows
10851090
console.log('Loading categories...');
10861091
await this.loadCategories();
1087-
1092+
10881093
console.log('Categories loaded, populating filter...');
10891094
this.populateCategoryFilter();
1090-
1095+
10911096
// Load stats and workflows in parallel
10921097
console.log('Loading stats and workflows...');
10931098
const [stats] = await Promise.all([
@@ -1106,29 +1111,29 @@ <h4>Workflow Diagram</h4>
11061111
async loadCategories() {
11071112
try {
11081113
console.log('Loading categories from API...');
1109-
1114+
11101115
// Load categories and mappings in parallel from API
11111116
const [categoriesResponse, mappingsResponse] = await Promise.all([
11121117
this.apiCall('/categories'),
11131118
this.apiCall('/category-mappings')
11141119
]);
1115-
1120+
11161121
// Set categories from API
11171122
this.state.categories = categoriesResponse.categories || ['Uncategorized'];
1118-
1123+
11191124
// Build category map from API mappings
11201125
const categoryMap = new Map();
11211126
const mappings = mappingsResponse.mappings || {};
1122-
1127+
11231128
Object.entries(mappings).forEach(([filename, category]) => {
11241129
categoryMap.set(filename, category || 'Uncategorized');
11251130
});
1126-
1131+
11271132
this.state.categoryMap = categoryMap;
1128-
1133+
11291134
console.log(`Successfully loaded ${this.state.categories.length} categories from API:`, this.state.categories);
11301135
console.log(`Loaded ${categoryMap.size} category mappings from API`);
1131-
1136+
11321137
return { categories: this.state.categories, mappings: mappings };
11331138
} catch (error) {
11341139
console.error('Failed to load categories from API:', error);
@@ -1141,24 +1146,24 @@ <h4>Workflow Diagram</h4>
11411146

11421147
populateCategoryFilter() {
11431148
const select = this.elements.categoryFilter;
1144-
1149+
11451150
if (!select) {
11461151
console.error('Category filter element not found');
11471152
return;
11481153
}
1149-
1154+
11501155
console.log('Populating category filter with:', this.state.categories);
1151-
1156+
11521157
// Clear existing options except "All Categories"
11531158
while (select.children.length > 1) {
11541159
select.removeChild(select.lastChild);
11551160
}
1156-
1161+
11571162
if (this.state.categories.length === 0) {
11581163
console.warn('No categories available to populate filter');
11591164
return;
11601165
}
1161-
1166+
11621167
// Add categories in alphabetical order
11631168
this.state.categories.forEach(category => {
11641169
const option = document.createElement('option');
@@ -1167,7 +1172,7 @@ <h4>Workflow Diagram</h4>
11671172
select.appendChild(option);
11681173
console.log(`Added category option: ${category}`);
11691174
});
1170-
1175+
11711176
console.log(`Category filter populated with ${select.options.length - 1} categories`);
11721177
}
11731178

@@ -1182,35 +1187,35 @@ <h4>Workflow Diagram</h4>
11821187
try {
11831188
// If category filtering is active, we need to load all workflows to filter properly
11841189
const needsAllWorkflows = this.state.filters.category !== 'all' && reset;
1185-
1190+
11861191
let allWorkflows = [];
11871192
let totalCount = 0;
11881193
let totalPages = 1;
1189-
1194+
11901195
if (needsAllWorkflows) {
11911196
// Load all workflows in batches for category filtering
11921197
console.log('Loading all workflows for category filtering...');
11931198
allWorkflows = await this.loadAllWorkflowsForCategoryFiltering();
1194-
1199+
11951200
// Apply client-side category filtering
11961201
console.log(`Filtering ${allWorkflows.length} workflows for category: ${this.state.filters.category}`);
11971202
console.log('Category map size:', this.state.categoryMap.size);
1198-
1203+
11991204
let matchCount = 0;
12001205
const filteredWorkflows = allWorkflows.filter(workflow => {
12011206
const workflowCategory = this.getWorkflowCategory(workflow.filename);
12021207
const matches = workflowCategory === this.state.filters.category;
1203-
1208+
12041209
// Debug: log first few matches/non-matches
12051210
if (matchCount < 5 || (!matches && matchCount < 3)) {
12061211
console.log(`${workflow.filename}: ${workflowCategory} ${matches ? '===' : '!=='} ${this.state.filters.category}`);
12071212
}
1208-
1213+
12091214
if (matches) matchCount++;
1210-
1215+
12111216
return matches;
12121217
});
1213-
1218+
12141219
console.log(`Filtered from ${allWorkflows.length} to ${filteredWorkflows.length} workflows`);
12151220
allWorkflows = filteredWorkflows;
12161221
totalCount = filteredWorkflows.length;
@@ -1253,7 +1258,7 @@ <h4>Workflow Diagram</h4>
12531258
const allWorkflows = [];
12541259
let currentPage = 1;
12551260
const maxPerPage = 100; // API limit
1256-
1261+
12571262
while (true) {
12581263
const params = new URLSearchParams({
12591264
q: this.state.searchQuery,
@@ -1266,16 +1271,16 @@ <h4>Workflow Diagram</h4>
12661271

12671272
const response = await this.apiCall(`/workflows?${params}`);
12681273
allWorkflows.push(...response.workflows);
1269-
1274+
12701275
console.log(`Loaded page ${currentPage}/${response.pages} (${response.workflows.length} workflows)`);
1271-
1276+
12721277
if (currentPage >= response.pages) {
12731278
break;
12741279
}
1275-
1280+
12761281
currentPage++;
12771282
}
1278-
1283+
12791284
console.log(`Loaded total of ${allWorkflows.length} workflows for filtering`);
12801285
return allWorkflows;
12811286
}
@@ -1320,17 +1325,17 @@ <h4>Workflow Diagram</h4>
13201325
const count = this.state.totalCount;
13211326
const query = this.state.searchQuery;
13221327
const category = this.state.filters.category;
1323-
1328+
13241329
let text = `${count.toLocaleString()} workflows`;
1325-
1330+
13261331
if (query && category !== 'all') {
13271332
text += ` found for "${query}" in "${category}"`;
13281333
} else if (query) {
13291334
text += ` found for "${query}"`;
13301335
} else if (category !== 'all') {
13311336
text += ` in "${category}"`;
13321337
}
1333-
1338+
13341339
this.elements.resultsCount.textContent = text;
13351340
}
13361341

@@ -1493,7 +1498,7 @@ <h4 class="integrations-title">Integrations (${workflow.integrations.length})</h
14931498
// Re-initialize Mermaid for the new diagram
14941499
if (typeof mermaid !== 'undefined') {
14951500
mermaid.init(undefined, this.elements.diagramViewer.querySelector('.mermaid'));
1496-
1501+
14971502
// Store reference to SVG and reset zoom
14981503
setTimeout(() => {
14991504
this.diagramSvg = this.elements.diagramViewer.querySelector('.mermaid svg');
@@ -1510,10 +1515,10 @@ <h4 class="integrations-title">Integrations (${workflow.integrations.length})</h
15101515

15111516
zoomDiagram(factor) {
15121517
if (!this.diagramSvg) return;
1513-
1518+
15141519
this.diagramZoom *= factor;
15151520
this.diagramZoom = Math.max(0.1, Math.min(10, this.diagramZoom)); // Limit zoom between 10% and 1000%
1516-
1521+
15171522
this.applyDiagramTransform();
15181523
}
15191524

@@ -1525,7 +1530,7 @@ <h4 class="integrations-title">Integrations (${workflow.integrations.length})</h
15251530

15261531
applyDiagramTransform() {
15271532
if (!this.diagramSvg) return;
1528-
1533+
15291534
const transform = `scale(${this.diagramZoom}) translate(${this.diagramPan.x}px, ${this.diagramPan.y}px)`;
15301535
this.diagramSvg.style.transform = transform;
15311536
this.diagramSvg.style.transformOrigin = 'center center';
@@ -1610,7 +1615,7 @@ <h4 class="integrations-title">Integrations (${workflow.integrations.length})</h
16101615
stopDragging() {
16111616
this.isDragging = false;
16121617
this.elements.diagramContainer.classList.remove('dragging');
1613-
} updateLoadMoreButton() {
1618+
} updateLoadMoreButton() {
16141619
const hasMore = this.state.currentPage < this.state.totalPages;
16151620

16161621
if (hasMore && this.state.workflows.length > 0) {

0 commit comments

Comments
 (0)