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

profile name shown on action bar #1799

Merged
merged 7 commits into from
Feb 18, 2025
Merged

Conversation

Mjishu
Copy link

@Mjishu Mjishu commented Feb 3, 2025

When action bar is shown it now shows current profile name

solves issue -> #1698

Style Changes

Right side

image

Left side

image

Top side

image

@Mjishu Mjishu requested a review from a team as a code owner February 3, 2025 01:12
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>
Copy link
Collaborator

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

/**
* @param {import('settings').ProfileOptions} currentProfile
*/
async _updateCurrentProfileDisplay(currentProfile) {
Copy link
Collaborator

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;
}

Copy link
Author

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 @.@!

Copy link
Collaborator

@StefanVukovic99 StefanVukovic99 left a 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.

@@ -579,7 +587,6 @@ button.sidebar-button.sidebar-button-highlight {
--button-active-content-color: var(--accent-color);
}


Copy link
Collaborator

Choose a reason for hiding this comment

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

whitespace change

@@ -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');
Copy link
Collaborator

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>
Copy link
Collaborator

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

@YukiNagat0
Copy link

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.

@Mjishu
Copy link
Author

Mjishu commented Feb 6, 2025

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.

@StefanVukovic99
Copy link
Collaborator

StefanVukovic99 commented Feb 6, 2025

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

  • it's annoying/slow to point and click a button
  • especially on a touchpad
  • the extension icon is especially tiny
  • it's hidden in fullscreen

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.

@YukiNagat0
Copy link

though, do users with only 1 profile even use the action bar?

Yeah, almost always it is hidden but appears when you click on the links in the glossary:

image
image

@Mjishu
Copy link
Author

Mjishu commented Feb 11, 2025

Screencast from 02-05-2025 12:24:00 PM.webm Changing profile from the action popup seems to not update the name.

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?

@StefanVukovic99
Copy link
Collaborator

_onOptionsUpdated gets called when the profile is updated from anywhere, so just making sure that the condition on line 65 doesn't prevent the profile name update makes it work:
image
(maybe there is a more elegant way to do it)

Yeah, almost always it is hidden but appears when you click on the links in the glossary:

Ok, so maybe we should hide the profile name (and the profile select button?) not when there is only one profile, but when action bar is set to Auto. This way users that have it on Always and are using it for the profile switching will benefit, and users that only see the action bar when clicking on a link will be unaffected.

@Mjishu
Copy link
Author

Mjishu commented Feb 11, 2025

multiple profiles
image

1 profile
image

@Mjishu
Copy link
Author

Mjishu commented Feb 11, 2025

Ok, so maybe we should hide the profile name (and the profile select button?) not when there is only one profile, but when action bar is set to Auto

Missed this part the code above just checks if user has more than 1 profile and not if action bar is auto

@StefanVukovic99 StefanVukovic99 added kind/enhancement The issue or PR is a new feature or request area/ui-ux The issue or PR is related to UI/UX/Design labels Feb 11, 2025
@StefanVukovic99
Copy link
Collaborator

I'm OK either way, don't wanna bikeshed too hard

@Mjishu
Copy link
Author

Mjishu commented Feb 11, 2025

Got it, thanks for the feedback!

@Kuuuube Kuuuube added this pull request to the merge queue Feb 18, 2025
Merged via the queue into yomidevs:master with commit 27c335f Feb 18, 2025
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-ux The issue or PR is related to UI/UX/Design kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants