Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/client/src/IDE/Components/EditableName/useIsRenaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ export const useIsRenaming = (id: string) => {

const isEditingViaExternal = useSelector(getIsRenaming(id));

const isNew =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One thing to keep in mind is that isNew will not automatically update on history changes unless something else forces a re-render of this component. In other words it will not watch for route changes and will not update state by itself.

Disregard, if this is the desired behavior.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed this for now. Needs a relook

new URLSearchParams(window.location.search).get("editName") === "true";

useEffect(
function onExternalEditEvent() {
if (isEditingViaExternal) {
if (isEditingViaExternal || isNew) {
setIsEditing(true);
}

return () => {
setIsEditing(false);
};
},
[isEditingViaExternal],
[isEditingViaExternal, isNew],
);

const enterEditMode = useCallback(() => {
Expand Down
8 changes: 6 additions & 2 deletions app/client/src/IDE/Components/FileTab/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const Tab = styled.div`
color: var(--ads-v2-colors-text-default);
cursor: pointer;
gap: var(--ads-v2-spaces-2);
border-top: 1px solid transparent;
border-top-left-radius: var(--ads-v2-border-radius);
border-top-right-radius: var(--ads-v2-border-radius);
align-items: center;
Expand All @@ -19,14 +18,18 @@ export const Tab = styled.div`
padding-top: 6px; // to accommodate border and make icons align correctly
border-left: 1px solid transparent;
border-right: 1px solid transparent;
border-top: 2px solid transparent;
border-top: 3px solid transparent;
flex-shrink: 0;

&.active {
background: var(--ads-v2-colors-control-field-default-bg);
border-top-color: var(--ads-v2-color-bg-brand);
border-left-color: var(--ads-v2-color-border-muted);
border-right-color: var(--ads-v2-color-border-muted);

span {
font-weight: var(--ads-v2-font-weight-bold);
}
}

& > .tab-close {
Expand All @@ -48,6 +51,7 @@ export const IconContainer = styled.div`
align-items: center;
justify-content: center;
flex-shrink: 0;

img {
width: 12px;
}
Expand Down