Skip to content

fix 171 Wrong tooltip for toggle settings #178

Open
junaidferoz wants to merge 1 commit into
devfrom
fix-171-wrong_tooltip_on_toggle_settings
Open

fix 171 Wrong tooltip for toggle settings #178
junaidferoz wants to merge 1 commit into
devfrom
fix-171-wrong_tooltip_on_toggle_settings

Conversation

@junaidferoz
Copy link
Copy Markdown
Collaborator

@junaidferoz junaidferoz commented Apr 22, 2026

Wrong tooltip for toggle settings

What is the error?

The error was that the same tooltip option was being displayed on all the toggle settings in the settings tab. Which does not make sense.

Where the error was.

This error is seen in SettingItem.vue, specifically here.

<div v-else-if="setting.type === 'boolean' || setting.type === 'bool'" class="form-check form-switch">
  <input 
    v-model="setting.value" 
    :checked="setting.value"
    class="form-check-input" 
    role="switch" 
    title="Activate/Deactivate NLP support"
    type="checkbox">

The fix

Here, I changed the tile field to evaluate from the description of the settings. Please see the changes to get a clear understanding of what I did.

Copilot AI review requested due to automatic review settings April 22, 2026 13:03
@junaidferoz junaidferoz changed the title Wrong tooltip for toggle settings fix 171 Wrong tooltip for toggle settings Apr 22, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates settings UI tooltip behavior and improves local/runtime configuration handling.

Changes:

  • Replace hardcoded boolean-toggle tooltip with a dynamic tooltip derived from the setting metadata.
  • Load environment variables for Sequelize DB config via dotenv from the repo root.
  • Update .gitignore to ignore a top-level logs/ directory.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
frontend/src/components/dashboard/settings/SettingItem.vue Uses a computed tooltip for boolean toggles and adds a helper method for the title text.
backend/db/config/config.js Loads .env before exporting Sequelize configuration so process.env.* values resolve.
.gitignore Adds logs/ ignore and adjusts backend section comment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -33,7 +33,7 @@
:checked="setting.value"
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The checkbox uses v-model="setting.value" and also binds :checked="setting.value". In Vue, v-model already controls the checked state for checkboxes, so the extra :checked binding is redundant and can lead to confusing/duplicated sources of truth. Consider removing the :checked binding and rely on v-model alone.

Suggested change
:checked="setting.value"

Copilot uses AI. Check for mistakes.
Comment on lines +140 to +142
getBooleanToggleTooltip(setting){
const label = (setting.description && setting.description.trim()) || setting.key;
return `${label}`;
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

getBooleanToggleTooltip currently just returns the computed label via a template literal. Consider returning label directly (no interpolation needed) and matching the spacing/style used by the other methods (space before {) to keep formatting consistent in this file.

Suggested change
getBooleanToggleTooltip(setting){
const label = (setting.description && setting.description.trim()) || setting.key;
return `${label}`;
getBooleanToggleTooltip(setting) {
const label = (setting.description && setting.description.trim()) || setting.key;
return label;

Copilot uses AI. Check for mistakes.
* @author Nils Dycke
*/
const path = require("path");
require("dotenv").config({path: path.resolve(__dirname, "../../../.env")});
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This hard-codes loading ../../../.env. The repo supports environment-specific files via ENV (see Makefile includes .env.${ENV}), but this config will always read only .env when env vars aren’t already set (e.g., running backend/db scripts directly). Consider loading .env.${process.env.ENV} when ENV is set (falling back to .env), or relying on the parent process to provide env vars to avoid surprising configuration mismatches.

Suggested change
require("dotenv").config({path: path.resolve(__dirname, "../../../.env")});
const envFileName = process.env.ENV ? `.env.${process.env.ENV}` : ".env";
require("dotenv").config({path: path.resolve(__dirname, "../../../", envFileName)});

Copilot uses AI. Check for mistakes.
@junaidferoz
Copy link
Copy Markdown
Collaborator Author

I have a question. For now, the tooltip is the description of the toggle settings (the line below the title of the setting). I am currently thinking of a way to make the tooltip custom for each and every setting, instead of just copying the description. Could anyone suggest me how can we do it?

@junaidferoz junaidferoz self-assigned this Apr 22, 2026
Copy link
Copy Markdown
Collaborator

@dennis-zyska dennis-zyska left a comment

Choose a reason for hiding this comment

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

Please wait with this implementation, Mohammad is currently refactoring the settings page

* @author Nils Dycke
*/
const path = require("path");
require("dotenv").config({path: path.resolve(__dirname, "../../../.env")});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure why you do that here, is it needed?

Comment thread .gitignore

# backend
logs/
# backen
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

spelling mistake

}
},
methods: {
getBooleanToggleTooltip(setting){
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the name of the function seems misleading

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.

[BUG] Wrong tooltip on toggle settings — all show "Activate/Deactivate NLP support"

3 participants