Skip to content

Next release#1697

Merged
jokob-sk merged 15 commits into
mainfrom
next_release
Jul 4, 2026
Merged

Next release#1697
jokob-sk merged 15 commits into
mainfrom
next_release

Conversation

@jokob-sk

@jokob-sk jokob-sk commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Improved the settings-missing notice with the missing path and clearer “initializing” context.
    • Prevented “undefined” translation labels during cold startup by deferring initial data loading on app/workflow/multi-edit screens until core and plugin strings are ready.
    • Refined plugin and language-string caching/warm-reload validation to avoid deadlocks and correctly retry after cache clears.
    • Strengthened readiness checks to require additional required language/plugin strings.
  • Tests
    • Added Selenium UI coverage for cold vs warm translation loading, cache-flag behavior, and the “no undefined text” regression.
  • Documentation
    • Updated README badge and revised intro description.
  • Style
    • Adjusted modal/header/sidebar/footer layering via z-index.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates app startup so core and plugin strings are initialized before page data loads, adds a separate plugin-string cache step, adds UI translation tests, renames and reorders scan-device handling, updates one missing-settings log message, refreshes README text, adjusts stacking styles, and changes the sync devices file path.

Changes

Settings Log Message Update

Layer / File(s) Summary
Log message update for missing settings file
server/helper.py
Changes the FileNotFoundError log message in get_setting to include the settingsFile path and an initialization note.

App Initialization and Plugin String Caching

Layer / File(s) Summary
Cache plugin strings separately
front/js/cache.js
Adds shared plugin-data state, changes warm-load cache behavior, and moves plugin language strings into a dedicated cachePluginStrings step that stores plugin entries and controls retry behavior.
Block startup on plugin string readiness
front/js/app-init.js
Requires cachePluginStrings_v1 during bootstrap, retries the new cache step, and requires plugin strings when plugins are loaded.
Defer page data loading
front/multiEditCore.php, front/pluginsCore.php, front/workflowsCore.php
Defers page data loading until app initialization completes and switches plugin manifest/count loading to the dedicated plugin JSON helper.
UI translation coverage
test/ui/test_ui_translations.py
Adds Selenium coverage for cold-init and warm-reload string availability, the plugin string cache flag, and the plugins page not rendering literal undefined text after cache clear.

Scan Device Handling

Layer / File(s) Summary
Rename own-device save helper
server/scan/device_handling.py
Renames save_scanned_devices(db) to save_own_device(db).
Reorder scan processing
server/scan/session_events.py
Updates process_scan to import save_own_device, call it before exclusions, and centralize the forced-online SQL predicate in a module constant.

Docs and Layout Polish

Layer / File(s) Summary
README badge and intro copy
README.md
Adds a GitHub Releases badge and replaces the introductory README text.
Header and sidebar stacking
front/css/app.css
Changes footer, header, sidebar, modal, and modal button z-index and positioning styles in the main app stylesheet.

Sync Devices Path

Layer / File(s) Summary
Devices JSON path and logging
front/plugins/sync/sync.py
Reads table_devices.json from API_PATH instead of the old api directory and changes the missing-file branch to log with mylog('none', ...) using the computed file path.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too generic and does not describe the actual changes in this pull request. Use a descriptive title that summarizes the main change, such as the app init and translation-loading updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next_release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
front/pluginsCore.php (1)

295-317: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve cache-busting in the plugin JSON helper.

fetchPluginJson() now serves both plugins.json and table_plugins_stats.json, but unlike the shared query-json helper it does not append nocache. That can leave plugin tabs/counts stale after regenerated JSON.

Proposed fix
 async function fetchPluginJson(filename) {
-  const response = await fetch(`php/server/query_json.php?file=${filename}`);
+  const params = new URLSearchParams({
+    file: filename,
+    nocache: Date.now().toString()
+  });
+  const response = await fetch(`php/server/query_json.php?${params.toString()}`);
   if (!response.ok) throw new Error(`Failed to load ${filename}`);
   return await response.json();
 }

Also applies to: 390-390

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/pluginsCore.php` around lines 295 - 317, The shared plugin JSON helper
in fetchPluginJson currently fetches files without cache-busting, which can
leave plugin tabs and counts stale after regeneration. Update fetchPluginJson so
it appends the nocache flag the same way the existing query-json flow does, and
make sure the callers that load plugins.json and table_plugins_stats.json
continue to use that helper unchanged. Keep the fix localized around
fetchPluginJson and the load path that invokes generateTabs().
front/js/cache.js (1)

313-343: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Don’t early-return with a stale string count.

Line 313 skips loading whenever cacheStrings_v2_completed is true, but isAppInitialized() still requires STRINGS_COUNT to match the current language. If the language changes or the count is stale, this path can leave app init permanently inconsistent.

Proposed fix
 function cacheStrings() {
   return new Promise((resolve, reject) => {
-    if(getCache(CACHE_KEYS.initFlag('cacheStrings_v2')) === "true")
+    const expectedStringCount = getLangCode() == 'en_us' ? 1 : 2;
+    const cachedStringCount = parseInt(getCache(CACHE_KEYS.STRINGS_COUNT) || '0', 10);
+
+    if(getCache(CACHE_KEYS.initFlag('cacheStrings_v2')) === "true" && cachedStringCount === expectedStringCount)
     {
       // Core strings are already cached. Plugin strings are now handled by
       // the dedicated cachePluginStrings() step — nothing to do here.
       resolve();
       return;
     }
+
+      setCache(CACHE_KEYS.STRINGS_COUNT, 0);
 
       // Create a promise for each language (include en_us by default as fallback)
       languagesToLoad = ['en_us']
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/js/cache.js` around lines 313 - 343, The early return in cacheStrings
based on CACHE_KEYS.initFlag('cacheStrings_v2') can leave STRINGS_COUNT stale
for the current language. Update cacheStrings so it still verifies the active
language/count state before skipping, or recomputes the core-string count when
the language changes, ensuring isAppInitialized() sees the correct
STRINGS_COUNT. Use the existing cacheStrings_v2 / handleSuccess flow and keep
the cache consistent across language switches.
🧹 Nitpick comments (1)
test/ui/test_ui_translations.py (1)

164-166: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Hardcoded time.sleep(2) for render wait.

Fixed sleeps are a common source of flaky CI runs; consider an explicit WebDriverWait condition on the tab elements' text content instead.

♻️ Example using explicit wait instead of sleep
-    # Give the tabs a moment to render after init completes
-    time.sleep(2)
+    # Wait until tab labels are populated (non-empty) after init completes
+    WebDriverWait(driver, 5).until(
+        lambda d: any(
+            el.text.strip() for el in d.find_elements(By.CSS_SELECTOR, "`#tabs-location` a, .tab-label, h5")
+        )
+    )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/ui/test_ui_translations.py` around lines 164 - 166, The UI translation
test still uses a fixed time.sleep(2) after init, which can make the test flaky.
Replace the hardcoded pause in the test_ui_translations flow with an explicit
WebDriverWait that waits on the tab elements’ text/content state to be ready,
using the existing tab-locating logic in this test instead of relying on
time.sleep.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@front/js/cache.js`:
- Around line 193-201: The `fetchJson('plugins.json')` path in `cache.js` is
collapsing a failed manifest fetch into an empty array, which makes
`pluginsData` look like “no plugins” instead of “manifest unavailable.” Update
the `initFlag('cachePluginStrings_v1')`/`pluginsData` flow so fetch failure is
tracked separately from an empty manifest, and keep the retry logic in the
plugin-strings completion path that currently treats empty `pluginsData` as
done. Make sure the handling in the `plugins.json` loader and the completion
logic around the `pluginsData` checks both distinguish failure from a legitimate
empty plugin list.

In `@test/ui/test_ui_translations.py`:
- Around line 174-176: The assert message strings in the translation test are
plain text and should not use f-string syntax; remove the unnecessary f prefixes
in the relevant assertion(s) in test_ui_translations.py so the messages remain
normal string literals. Use the surrounding assertion text near
getData()/plugins.php to locate the exact statements and keep the message
content unchanged.

---

Outside diff comments:
In `@front/js/cache.js`:
- Around line 313-343: The early return in cacheStrings based on
CACHE_KEYS.initFlag('cacheStrings_v2') can leave STRINGS_COUNT stale for the
current language. Update cacheStrings so it still verifies the active
language/count state before skipping, or recomputes the core-string count when
the language changes, ensuring isAppInitialized() sees the correct
STRINGS_COUNT. Use the existing cacheStrings_v2 / handleSuccess flow and keep
the cache consistent across language switches.

In `@front/pluginsCore.php`:
- Around line 295-317: The shared plugin JSON helper in fetchPluginJson
currently fetches files without cache-busting, which can leave plugin tabs and
counts stale after regeneration. Update fetchPluginJson so it appends the
nocache flag the same way the existing query-json flow does, and make sure the
callers that load plugins.json and table_plugins_stats.json continue to use that
helper unchanged. Keep the fix localized around fetchPluginJson and the load
path that invokes generateTabs().

---

Nitpick comments:
In `@test/ui/test_ui_translations.py`:
- Around line 164-166: The UI translation test still uses a fixed time.sleep(2)
after init, which can make the test flaky. Replace the hardcoded pause in the
test_ui_translations flow with an explicit WebDriverWait that waits on the tab
elements’ text/content state to be ready, using the existing tab-locating logic
in this test instead of relying on time.sleep.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 70a9b5a8-62dd-4d5b-b634-9b27de2206e2

📥 Commits

Reviewing files that changed from the base of the PR and between 9b297b2 and 268347e.

📒 Files selected for processing (6)
  • front/js/app-init.js
  • front/js/cache.js
  • front/multiEditCore.php
  • front/pluginsCore.php
  • front/workflowsCore.php
  • test/ui/test_ui_translations.py

Comment thread front/js/cache.js
Comment thread test/ui/test_ui_translations.py Outdated
jokob-sk and others added 2 commits July 2, 2026 14:30
…n and improve fetch logic; enhance UI tests for translation loading

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
front/js/cache.js (1)

205-208: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Retry the manifest when pluginsData is unknown.

Line 205 swallows a failed plugins.json refresh, but Line 410 later treats pluginsData === null as “plugins may exist” and rejects empty plugin strings without ever re-fetching the manifest. A transient manifest miss can leave no-plugin installs stuck waiting on cachePluginStrings_v1.

Proposed fix
           .catch(() => {
             // Fetch failed — leave pluginsData as null (unknown state) so
             // cachePluginStrings() retries rather than treating it as no-op.
-            resolve();
+            reject(new Error('plugins.json unavailable'));
           });

Or re-fetch plugins.json inside cachePluginStrings() when pluginsData === null before deciding whether empty plugin strings are valid.

Also applies to: 410-413

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/js/cache.js` around lines 205 - 208, `cachePluginStrings()` is treating
`pluginsData === null` as a terminal “maybe plugins exist” state without
retrying the manifest, so a transient `plugins.json` miss can block no-plugin
installs. Update the refresh flow in `cache.js` so that when `pluginsData` is
null, `cachePluginStrings()` re-fetches the manifest (or otherwise retries the
`plugins.json` load) before rejecting empty plugin strings; keep the existing
`cachePluginStrings_v1` and `pluginsData` behavior aligned with the retry path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@front/js/cache.js`:
- Around line 323-328: The STRINGS_COUNT check in cache.js only distinguishes
en_us from non-en_us, so a language change between two non-English locales can
incorrectly satisfy the initialized state. Update the cache logic around the
STRINGS_COUNT / isAppInitialized() path to also track the active language using
a dedicated cache key such as cacheStrings_v2_language, and compare it against
getLangCode() before treating the cache as valid. Set that language marker only
after the language-loading promises in the cache strings flow complete
successfully, so switching locales forces a real reload instead of reusing stale
cached strings.

---

Duplicate comments:
In `@front/js/cache.js`:
- Around line 205-208: `cachePluginStrings()` is treating `pluginsData === null`
as a terminal “maybe plugins exist” state without retrying the manifest, so a
transient `plugins.json` miss can block no-plugin installs. Update the refresh
flow in `cache.js` so that when `pluginsData` is null, `cachePluginStrings()`
re-fetches the manifest (or otherwise retries the `plugins.json` load) before
rejecting empty plugin strings; keep the existing `cachePluginStrings_v1` and
`pluginsData` behavior aligned with the retry path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 162a599c-eaa8-4868-99e0-46af71dc8082

📥 Commits

Reviewing files that changed from the base of the PR and between 268347e and 35b19cb.

📒 Files selected for processing (3)
  • front/js/cache.js
  • front/pluginsCore.php
  • test/ui/test_ui_translations.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/ui/test_ui_translations.py
  • front/pluginsCore.php

Comment thread front/js/cache.js Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
front/css/app.css (1)

248-252: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Footer and sidebar share the same z-index (10000).

Both .main-footer and .main-sidebar, .left-side are set to z-index: 10000, one level below .fixed .main-header (10001). If these two ever overlap (e.g., during responsive/collapsed states), their relative stacking will fall back to DOM order rather than explicit intent. Consider giving them distinct values to make the stacking order unambiguous.

Also applies to: 335-339

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/css/app.css` around lines 248 - 252, The stacking order for
.main-footer and .main-sidebar/.left-side is ambiguous because they share the
same z-index value in app.css. Update the z-index values in the affected CSS
rules so the footer and sidebar have distinct, intentional layering relative to
.fixed .main-header, and keep the changes consistent across both occurrences
mentioned in the review.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@front/css/app.css`:
- Around line 248-252: The stacking order for .main-footer and
.main-sidebar/.left-side is ambiguous because they share the same z-index value
in app.css. Update the z-index values in the affected CSS rules so the footer
and sidebar have distinct, intentional layering relative to .fixed .main-header,
and keep the changes consistent across both occurrences mentioned in the review.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0f896453-440f-4db0-9d5b-23f72f24afd6

📥 Commits

Reviewing files that changed from the base of the PR and between 35b19cb and a41029e.

📒 Files selected for processing (3)
  • README.md
  • front/css/app.css
  • front/js/cache.js
✅ Files skipped from review due to trivial changes (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • front/js/cache.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
front/plugins/sync/sync.py (1)

109-110: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated NETALERTX_API fallback logic.

server/config_paths.py already centralizes this exact NETALERTX_API/tmp/api resolution as API_PATH. Reimplementing it here with os.environ.get(...) risks drift if the shared resolution logic changes (e.g., if API_PATH starts resolving relative to a configurable NETALERTX_TMP base instead of a hardcoded /tmp/api).

♻️ Suggested refactor
-            api_path = os.environ.get('NETALERTX_API', '/tmp/api')
-            file_path = f"{api_path}/table_devices.json"
+            file_path = f"{API_PATH}/table_devices.json"

(requires importing API_PATH from server.config_paths at module top level)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/plugins/sync/sync.py` around lines 109 - 110, The sync path
construction in the module-level logic duplicates the NETALERTX_API fallback
instead of using the केंदralized resolution already provided by API_PATH. Update
the code that builds file_path so it imports and uses API_PATH from
server.config_paths, keeping the table_devices.json path derived from that
shared value and avoiding a second os.environ.get(...) fallback in this module.
front/css/app.css (1)

248-252: 📐 Maintainability & Code Quality | 🔵 Trivial

Consider a shared z-index scale.

The new values (10000, 10001, 11051, 12000) are ad-hoc magic numbers scattered across the stylesheet. A small set of CSS custom properties (e.g. --z-sidebar, --z-header, --z-modal) would make the stacking hierarchy self-documenting and easier to maintain as more layers are added.

Also applies to: 321-324, 335-339, 735-739, 1859-1859

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/css/app.css` around lines 248 - 252, The stylesheet is using scattered
magic z-index values across the footer and other layers, so replace them with a
shared stacking scale defined as CSS custom properties. Add centralized
variables for the key layers used by the affected rules, then update the
.main-footer and the other referenced selectors to consume those variables
instead of hardcoded values so the hierarchy stays consistent and easier to
maintain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@front/css/app.css`:
- Line 1859: The `#modal-ok` rule in app.css is meant to be the topmost modal but
its current z-index is lower than the general .modal rule, so it overrides the
intended stacking order for the modal-ok element. Update the `#modal-ok` selector
so it uses a higher z-index than .modal while preserving the “highest priority”
intent, and fix the comment formatting to satisfy Stylelint by adding the
required whitespace inside the comment delimiters.
- Around line 735-739: The modal stacking in the app stylesheet is too high and
can break Bootstrap overlay ordering. Update the .modal z-index in the CSS so it
stays aligned with Bootstrap’s default overlay layers, and verify that
tooltip/popover behavior still works correctly with the modal class and any
related overlay rules.

In `@front/plugins/sync/sync.py`:
- Around line 120-121: The missing-file branch in sync push is referencing an
undefined variable, causing a NameError before the function can complete. Update
the logging in the else branch of the sync flow to use the existing file path
variable instead of file_content, matching the earlier error handling pattern
used in the same function. Locate the fix in the logic around the mylog call
inside the missing-file path handling for the sync plugin.

---

Nitpick comments:
In `@front/css/app.css`:
- Around line 248-252: The stylesheet is using scattered magic z-index values
across the footer and other layers, so replace them with a shared stacking scale
defined as CSS custom properties. Add centralized variables for the key layers
used by the affected rules, then update the .main-footer and the other
referenced selectors to consume those variables instead of hardcoded values so
the hierarchy stays consistent and easier to maintain.

In `@front/plugins/sync/sync.py`:
- Around line 109-110: The sync path construction in the module-level logic
duplicates the NETALERTX_API fallback instead of using the केंदralized
resolution already provided by API_PATH. Update the code that builds file_path
so it imports and uses API_PATH from server.config_paths, keeping the
table_devices.json path derived from that shared value and avoiding a second
os.environ.get(...) fallback in this module.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7775fe10-1577-410a-a0e0-6d9c4b63a9cc

📥 Commits

Reviewing files that changed from the base of the PR and between a41029e and 10e0316.

📒 Files selected for processing (2)
  • front/css/app.css
  • front/plugins/sync/sync.py

Comment thread front/css/app.css
Comment on lines +735 to +739
.modal
{
z-index: 12000;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -B1 -A3 '\.modal-backdrop' front/css/app.css

Repository: netalertx/NetAlertX

Length of output: 157


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Files containing modal-backdrop ==\n'
rg -n --hidden --glob '!**/node_modules/**' '\.modal-backdrop' .

printf '\n== Files containing modal / tooltip / toast z-index rules ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'z-index:\s*[0-9]+' front/css . | sed -n '1,200p'

printf '\n== Relevant CSS files around front/css/app.css area ==\n'
wc -l front/css/app.css
sed -n '700,780p' front/css/app.css

Repository: netalertx/NetAlertX

Length of output: 50377


🏁 Script executed:

python3 - <<'PY'
import re
from pathlib import Path

files = [
    Path("front/css/app.css"),
    Path("front/lib/bootstrap/bootstrap.min.css"),
    Path("front/lib/datatables/datatables.css"),
]

selectors = [".modal", ".modal-backdrop", ".tooltip", ".popover", ".dropdown-menu", ".toast"]

for path in files:
    text = path.read_text(errors="ignore")
    print(f"\n== {path} ==")
    for sel in selectors:
        idx = text.find(sel)
        if idx == -1:
            continue
        snippet = text[idx:idx+300]
        # compress whitespace for readability
        compact = re.sub(r"\s+", " ", snippet)
        m = re.search(r"z-index\s*:\s*([^;}]*)", compact)
        print(f"{sel}: {m.group(1) if m else 'no z-index in nearby snippet'}")
        print(compact[:220])
PY

Repository: netalertx/NetAlertX

Length of output: 3413


Keep modal stacking aligned with Bootstrap overlays. z-index: 12000 will push modals above the default tooltip/popover layers (1060/1070), so those elements may render under the dialog unless they’re adjusted too.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/css/app.css` around lines 735 - 739, The modal stacking in the app
stylesheet is too high and can break Bootstrap overlay ordering. Update the
.modal z-index in the CSS so it stays aligned with Bootstrap’s default overlay
layers, and verify that tooltip/popover behavior still works correctly with the
modal class and any related overlay rules.

Comment thread front/css/app.css
#modal-ok
{
z-index: 1051; /*highest priority*/
z-index: 11051; /*highest priority*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

#modal-ok z-index is lower than the general .modal rule, contradicting its "highest priority" comment.

#modal-ok carries class="modal" (per front/php/templates/modals.php), and since ID selectors outrank class selectors in specificity, this rule's z-index: 11051 overrides the newly-added .modal { z-index: 12000; } for that element — making the "OK" modal render below any other element matched only by .modal. That's the opposite of the stated intent.

Also flagged by Stylelint: missing whitespace inside the comment delimiters.

🐛 Proposed fix
 `#modal-ok`
 {
-    z-index: 11051; /*highest priority*/
+    z-index: 12000; /* highest priority */
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
z-index: 11051; /*highest priority*/
z-index: 12000; /* highest priority */
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 1859-1859: Expected whitespace after "/*" (comment-whitespace-inside)

(comment-whitespace-inside)


[error] 1859-1859: Expected whitespace before "*/" (comment-whitespace-inside)

(comment-whitespace-inside)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/css/app.css` at line 1859, The `#modal-ok` rule in app.css is meant to be
the topmost modal but its current z-index is lower than the general .modal rule,
so it overrides the intended stacking order for the modal-ok element. Update the
`#modal-ok` selector so it uses a higher z-index than .modal while preserving the
“highest priority” intent, and fix the comment formatting to satisfy Stylelint
by adding the required whitespace inside the comment delimiters.

Source: Linters/SAST tools

Comment thread front/plugins/sync/sync.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
front/css/app.css (2)

321-324: 📐 Maintainability & Code Quality | 🔵 Trivial

.fixed .main-header now outranks the sidebar/footer by only 1.

z-index: 10001 is just one unit above the sidebar/footer's 10000, leaving very little headroom before this ordering silently breaks with future additions (dropdowns, mini-sidebar hover panel, etc.). AdminLTE's own defaults keep header/sidebar much lower (around 1030/810) specifically to avoid this kind of collision with Bootstrap overlay components.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/css/app.css` around lines 321 - 324, The .fixed .main-header rule is
using a z-index that is too close to the sidebar/footer stack, which leaves
little room for future overlay layers. Update the z-index in the .fixed
.main-header selector in app.css to a safer value consistent with the existing
AdminLTE layering strategy, and keep it clearly above the sidebar/footer without
narrowly incrementing by 1 so other UI layers can be added without collisions.

248-252: 📐 Maintainability & Code Quality | 🔵 Trivial

Duplicate of prior stacking concern; also part of broader z-index inflation.

This footer rule sets z-index: 10000, following the same pattern flagged previously for .modal/#modal-ok. Combined with the header (10001) and sidebar (10000) changes below, the stylesheet now uses arbitrarily large, closely-spaced z-index values across layout regions and overlays, which increases the risk of one region unintentionally sitting above dropdowns/tooltips/modals that rely on Bootstrap's much lower default scale (~1000-1070).

Consider introducing a small set of CSS custom properties (e.g. --z-header, --z-sidebar, --z-footer, --z-modal) to keep the stacking order self-documenting and easy to audit going forward.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/css/app.css` around lines 248 - 252, The `.main-footer` stacking rule
is part of the broader z-index inflation issue; replace the hardcoded `z-index:
10000` with a named CSS custom property used consistently across the layout.
Update the related stacking declarations in the stylesheet (including the
header/sidebar/modal rules) to reference a small, self-documenting z-index scale
such as `--z-header`, `--z-sidebar`, `--z-footer`, and `--z-modal`, so the order
stays clear and easier to maintain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@server/scan/session_events.py`:
- Around line 38-46: Move the own-device insertion in process_scan so
save_own_device(db) runs after exclude_ignored_devices(db), not before. The
issue is in the scan pipeline ordering inside the session_events processing
flow: broad ignored-device rules can remove the local host if it is inserted too
early. Keep the exclusion step first, then call save_own_device(db) so the own
device remains present in CurrentScan for the rest of the logic.

---

Nitpick comments:
In `@front/css/app.css`:
- Around line 321-324: The .fixed .main-header rule is using a z-index that is
too close to the sidebar/footer stack, which leaves little room for future
overlay layers. Update the z-index in the .fixed .main-header selector in
app.css to a safer value consistent with the existing AdminLTE layering
strategy, and keep it clearly above the sidebar/footer without narrowly
incrementing by 1 so other UI layers can be added without collisions.
- Around line 248-252: The `.main-footer` stacking rule is part of the broader
z-index inflation issue; replace the hardcoded `z-index: 10000` with a named CSS
custom property used consistently across the layout. Update the related stacking
declarations in the stylesheet (including the header/sidebar/modal rules) to
reference a small, self-documenting z-index scale such as `--z-header`,
`--z-sidebar`, `--z-footer`, and `--z-modal`, so the order stays clear and
easier to maintain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b28dd56-9844-4f2c-a518-1970f0b32554

📥 Commits

Reviewing files that changed from the base of the PR and between a41029e and 351b6a7.

📒 Files selected for processing (4)
  • front/css/app.css
  • front/plugins/sync/sync.py
  • server/scan/device_handling.py
  • server/scan/session_events.py

Comment thread server/scan/session_events.py
@jokob-sk jokob-sk merged commit 16e0180 into main Jul 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant