-
Notifications
You must be signed in to change notification settings - Fork 124
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
profile name shown on action bar #1799
Conversation
ext/popup.html
Outdated
@@ -84,6 +84,7 @@ <h3>Default Profile</h3> | |||
<button type="button" class="sidebar-button" disabled id="navigate-next-button" title="Next definition" data-hotkey='["historyForward","title","Next definition ({0})"]'><span class="sidebar-button-icon icon" data-icon="right-chevron"></span></button> | |||
</div> | |||
<div class="content-sidebar-bottom"> | |||
<p class="sidebar-profile-language" id="profile-name"></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sidebar-profile-language
-> sidebar-profile-name
ext/js/display/display.js
Outdated
/** | ||
* @param {import('settings').ProfileOptions} currentProfile | ||
*/ | ||
async _updateCurrentProfileDisplay(currentProfile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be simpler to not have this function, and just use CSS like
[data-popup-action-bar-location="right"] .sidebar-profile-name,
[data-popup-action-bar-location="left"] .sidebar-profile-name {
writing-mode: vertical-rl;
text-orientation: vertical;
letter-spacing: 2px;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes life a lot easier @.@!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screencast from 02-05-2025 12:24:00 PM.webm
Changing profile from the action popup seems to not update the name.
ext/css/display.css
Outdated
@@ -579,7 +587,6 @@ button.sidebar-button.sidebar-button-highlight { | |||
--button-active-content-color: var(--accent-color); | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace change
ext/js/display/display.js
Outdated
@@ -199,6 +199,8 @@ export class Display extends EventDispatcher { | |||
this._languageSummaries = []; | |||
/** @type {import('dictionary-importer').Summary[]} */ | |||
this._dictionaryInfo = []; | |||
/** @type {?HTMLElement} */ | |||
this._profileName = document.querySelector('#profile-name'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable now unused?
ext/popup.html
Outdated
@@ -84,6 +84,7 @@ <h3>Default Profile</h3> | |||
<button type="button" class="sidebar-button" disabled id="navigate-next-button" title="Next definition" data-hotkey='["historyForward","title","Next definition ({0})"]'><span class="sidebar-button-icon icon" data-icon="right-chevron"></span></button> | |||
</div> | |||
<div class="content-sidebar-bottom"> | |||
<p class="sidebar-profile-name" id="profile-name"></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use just the id, w/o the class
Will put my two cents in. Don't really think that this change is necessary because you can already check the profile name in just one click and it will create more visual noise. If the dev team thinks that this feature is worth to add, then one small suggestion: don't show the profile name, if the user has only one profile. |
Seeing that you can also check the current profile by clicking the extension icon I agree, didn't realize that it shows up there and seems to defeat the purpose of having this feature. |
I think hiding the name if there is only one profile is a good idea. (though, do users with only 1 profile even use the action bar?) The pros of having the name I think are that
I don't think showing the same info (the active profile) in multiple places is bad per se. For UI things that could be considered visually noisy I usually err on the side of showing the info, since I don't think most people mind either way, and for those that do, it can be hidden with CSS. |
to solve this I could reference action-popup-main.js inside of popup.html so that it has access to the #profile-name element, is there a better alternative for this that is preferred? I was thinking of subscribing to the changes made to defaultProfile and then updating #profile-name when that changes but not sure if that would change too much/be too messy? |
Missed this part the code above just checks if user has more than 1 profile and not if action bar is auto |
I'm OK either way, don't wanna bikeshed too hard |
Got it, thanks for the feedback! |
When action bar is shown it now shows current profile name
solves issue -> #1698
Style Changes
Right side
Left side
Top side