Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode Implimentation for Desktop #1169

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Shubham-Patel07
Copy link

@Shubham-Patel07 Shubham-Patel07 commented Jan 19, 2025

What kind of changes does this PR include?

  • Fixes or refactors
  • A new Enhancement
  • Additional documentation
  • Something else

Description

I have Implemented the dark mode for desktop

Relations

Closes #404

Checklist:

  • All the contributions made are solely the work of me and my co-authors
  • I tested the changes in this PR (if applicable)
  • I added unit tests to ensure my change works (when change in Java or on front-end code)
  • I added UI tests to ensure my UI changes work (when change in the overall UI, not needed if just adding a challenge)
  • The PR passes pre-commit hooks and automated tests

@Shubham-Patel07
Copy link
Author

Hi @jgadsden sir,
I have used NativeTheme for the implemented as described in the issue, and please can you help me with the styling such that there is minimal repetition of code.

@jgadsden
Copy link
Collaborator

Hello @Shubham-Patel07 , thanks for the start on this feature, marking this draft because it is a work in progress
Screenshot 2025-01-24 at 07 14 07

@jgadsden jgadsden marked this pull request as draft January 24, 2025 07:15
@jgadsden jgadsden self-requested a review January 25, 2025 10:18
@jgadsden jgadsden added the enhancement New feature or request label Jan 25, 2025
@jgadsden
Copy link
Collaborator

I agree @Shubham-Patel07 there are still many views that need dark-mode applied
there must be an easy way to do this via scss?

@Shubham-Patel07
Copy link
Author

Hi @jgadsden sir,
Yess i found out a way now we only need to make change in global scss file i.e dark-mode.scss

@Shubham-Patel07 Shubham-Patel07 marked this pull request as ready for review January 28, 2025 19:20
@Shubham-Patel07 Shubham-Patel07 marked this pull request as draft January 28, 2025 19:21
@Shubham-Patel07 Shubham-Patel07 marked this pull request as ready for review January 29, 2025 04:32
@Shubham-Patel07
Copy link
Author

Hi @jgadsden sir,
Please review the code and let me know weather to write UI tests in Cypress or Jest

@@ -1,9 +1,18 @@
const { contextBridge, ipcRenderer } = require('electron')
console.log('Preload script loaded2');
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure if this is intended to be left in, or if it is temporary debug?

<b-button size="sm" variant="outline-light" @click="handleToggleDarkMode">Toggle Dark Mode</b-button>
</b-nav-item>
<b-nav-item>
<b-button size="sm" variant="outline-light" @click="handleSetSystemTheme">System Theme</b-button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this 'set system theme' needed? there is the dark mode toggle, which will provide the system theme when off

Copy link
Collaborator

@jgadsden jgadsden left a comment

Choose a reason for hiding this comment

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

this is an excellent enhancement to Threat Dragon, many thanks @Shubham-Patel07
Could you consider these suggestions:

  1. use of an icon instead of a button for the dark mode toggle, perhaps fa-solid fa-circle-half-stroke ? This would then need a tool tip in a similar way to the other nav bar icons
  2. could the system theme functionality be removed? It is in effect a duplication of dark mode toggle being in the off position
  3. could you provide a unit test for this in file td.vue/tests/unit/components/navbar.spec.js

@jgadsden jgadsden marked this pull request as draft February 6, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request version-2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide dark mode for desktop
2 participants