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

[ENG-293] Tag assign mode #2462

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open

[ENG-293] Tag assign mode #2462

wants to merge 36 commits into from

Conversation

iLynxcat
Copy link
Contributor

@iLynxcat iLynxcat commented May 8, 2024

This PR introduces tag assign mode to Spacedrive.

Changes:

  • Add new tag bar to explorer which shows all tags
    • Click a tag and then press a key 1-9 to assign that tag a hotkey
    • With tag bar open, select files and press a hotkey assigned to a tag to assign that tag to the selected files
    • Click a tag with an assigned hotkey and press Escape to unassign its hotkey
  • Adds Cmd/Ctrl+Alt+T shortcut for opening/closing tag bar
  • Includes localization changes to support new tag bar UI

Closes #2350

Copy link

linear bot commented May 8, 2024

ENG-293 Tag assign mode

Copy link

vercel bot commented May 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spacedrive-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 2:01am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
spacedrive-landing ⬜️ Ignored (Inspect) Visit Preview Jun 4, 2024 2:01am

Copy link
Contributor

@myung03 myung03 left a comment

Choose a reason for hiding this comment

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

really cool functionality! just some styling issues and visual updates. lmk if you have any questions about any of my suggestions/if you disagree with any of them, would love to learn more about your thought process or explain any confusion :))

Copy link
Contributor

Choose a reason for hiding this comment

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

noticed that a lot of the common.json files have english in them despite not being english files? also minor but naming convention for file_two/file_zero is rather confusing, especially because it seems their contents are the same for each language (i might just be misunderstanding the purpose though)

Copy link
Contributor

Choose a reason for hiding this comment

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

leaving a comment just on this file but appears to be a common issue across almost all of them

@@ -118,11 +119,28 @@ export const useExplorerTopBarOptions = () => {
showAtResolution: 'xl:flex'
},
{
toolTipLabel: t('key_manager'),
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason this line was removed in favour of line 122?

Comment on lines +266 to +296
return (
<button
className={clsx('group flex items-center gap-1 rounded-lg border px-2.5 py-0.5', {
['border-gray-500 bg-gray-500']: !isAwaitingKeyPress && isDark,
['border-blue-400 bg-blue-800']: isAwaitingKeyPress && isDark,
['border-blue-500 bg-blue-200']: isAwaitingKeyPress && !isDark
})}
ref={buttonRef}
onClick={onClick}
aria-live={isAwaitingKeyPress ? 'assertive' : 'off'}
aria-label={
isAwaitingKeyPress
? `Type a number to map it to the "${tag.name}" tag. Press escape to cancel.`
: undefined
}
>
<Circle
fill={tag.color ?? 'grey'}
weight="fill"
alt=""
aria-hidden
className="size-3"
/>
<span className="max-w-xs truncate py-0.5 text-sm font-semibold text-ink-dull">
{tag.name}
</span>

{assignKey && <Shortcut chars={keybind([], [assignKey])} />}
</button>
);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

the buttons look a bit off, especially selected and against the light blue background. Just off the top of my head:

  • removing the semibold text as its rather jarring, maybe a weight 300-500 (whatever works)
  • fixing the shape/colour of the assigned key shape, as the outline of the key is only visible against the blue background rn
  • possibly changing the click effect. maybe scale would work, but i could see how this could be confusing from a ux standpoint.

Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way to make the path bar slide up and down in a transition? the movement would look a lot smoother as right now its a bit offputting, especially when you rapidly change between different files/folder and the path bar disappears/reappears. maybe setting some unique logic for the path bar for when the tag bar is active since this appears to only a problem when they are both active.

onClick: () => void;
}

const TagItem = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be refactored to another file since this file is already huge

`h-[64px]`
)}
>
<em className="text-sm tracking-wide">{t('tags_bulk_instructions')}</em>
Copy link
Contributor

Choose a reason for hiding this comment

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

the italics look a bit strange, maybe just normal text is fine. But on that note I think this should be a tool tip instead, since it makes the tag bar unnecessarily large. Maybe putting a tooltip on the right hand side of the bar, or somewhere else that makes sense.

"tags_bulk_assigned": "Assigned tag \"{{tag_name}}\" to {{file_count}} $t(file, { \"count\": {{file_count}} }).",
"tags_bulk_failed_with_tag": "Could not assign tag \"{{tag_name}}\" to {{file_count}} $t(file, { \"count\": {{file_count}} }): {{error_message}}",
"tags_bulk_failed_without_tag": "Could not tag {{file_count}} $t(file, { \"count\": {{file_count}} }): {{error_message}}",
"tags_bulk_instructions": "Select one or more files and press a key to assign the corresponding tag.",
Copy link
Contributor

Choose a reason for hiding this comment

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

this wording is rather misleading because it only allows you to assign number keys 1-9 to tags, so it might be beneficial to specify that

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't test with more than 9 tags though so I definitely may be wrong here!

Copy link
Member

Choose a reason for hiding this comment

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

curious what does this part translates to: $t(file, { \"count\": {{file_count}} }). Looks weird to have it on i18n

Copy link
Contributor Author

@iLynxcat iLynxcat Jun 7, 2024

Choose a reason for hiding this comment

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

changes to the proper singular/plural form of "file"/"files" based on the file_count number. it's the reason I added the actual numerical translations for the "file" key

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.

[ENG-293] Tag assign mode
4 participants