Skip to content

Commit

Permalink
Merge branch 'master' into ozbackwards
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniket-Engg authored Oct 19, 2023
2 parents 74559d2 + 8e376ba commit 91d8bab
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ const Icon = ({iconRecord, verticalIconPlugin, contextMenuAction, theme}: IconPr

return (
<>
<CustomTooltip placement={name === 'settings' ? 'right' : name === 'search' ? 'top' : name === 'udapp' ? 'bottom' : 'top'} tooltipText={title} delay={{show: 1000, hide: 0}}>
<CustomTooltip
placement={name === 'settings' ? 'right' : name === 'search' ? 'top' : name === 'udapp' ? 'bottom' : 'top'}
tooltipText={title}
delay={{show: 1000, hide: 0}}
>
<div
className={`remixui_icon m-2 pt-1`}
onClick={() => {
Expand Down
20 changes: 16 additions & 4 deletions libs/remix-ui/workspace/src/lib/components/file-label.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// eslint-disable-next-line no-use-before-define
import {fileDecoration} from '@remix-ui/file-decorators'
import {CustomTooltip} from '@remix-ui/helper'
import {FormattedMessage} from 'react-intl'
import React, {useEffect, useRef, useState} from 'react'
import {FileType} from '../types'
export interface FileLabelProps {
Expand Down Expand Up @@ -65,18 +67,28 @@ export const FileLabel = (props: FileLabelProps) => {
labelRef.current.innerText = file.name
}

// The tooltip is setted up on the label and not the whole line to avoid unnecessary tooltips on the short filenames.
// It has the delay for the same reason.
return (
<div
className="remixui_items d-inline-block w-100 text-break"
className="remixui_items d-inline-block w-100"
ref={isEditable ? labelRef : null}
suppressContentEditableWarning={true}
contentEditable={isEditable}
onKeyDown={handleEditInput}
onBlur={handleEditBlur}
>
<span className={`text-nowrap remixui_label ${fileStateClasses} ` + (file.isDirectory ? 'folder' : 'remixui_leaf')} data-path={file.path}>
{file.name}
</span>
<CustomTooltip
placement="top"
delay={{show: 1000, hide: 0}}
tooltipText={`${file.path}`}
tooltipId={`fileExplorer.${file.path}`}
tooltipClasses="text-nowrap"
>
<span className={`remixui_label ${fileStateClasses} ` + (file.isDirectory ? 'folder' : 'remixui_leaf')} data-path={file.path}>
{file.name}
</span>
</CustomTooltip>
</div>
)
}
6 changes: 5 additions & 1 deletion libs/remix-ui/workspace/src/lib/css/file-explorer.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ input[type="file"] {
margin-left : 20px;
}
.remixui_items {
display : inline
display : inline;
white-space : nowrap;
overflow : hidden;
text-overflow : ellipsis;
max-width : 90%;
}
.remixui_remove {
margin-left : auto;
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
cursor : pointer;
}
.remixui_treeview {
overflow-y : auto;
overflow-x : hidden;
}
.remixui_dialog {
display: flex;
Expand Down

0 comments on commit 91d8bab

Please sign in to comment.