Skip to content

Commit c9bd5b4

Browse files
committed
Refactor new tab icon to use inner element instead of pseudo-element
- instead of 'add new tab' button, should render an unfilled dot as last item representing a new tab that opens upon click └── packages └── ui └── src └── components └── editor └── common └── prompts ├── PromptField │ ├── PromptField.module.scss │ ├── PromptField.stories.tsx │ ├── PromptField.tsx │ ├── components │ │ ├── Footer │ │ │ ├── Footer.tsx │ │ │ └── index.ts │ │ └── Tabs │ │ ├── Tabs.tsx │ │ └── index.ts │ ├── hooks │ │ ├── use-drag-drop.ts │ │ ├── use-dropdown.ts │ │ ├── use-ghost-text.ts │ │ ├── use-handlers │ │ │ ├── handle-copy.ts │ │ │ ├── handle-cut.ts │ │ │ ├── handle-input-change.ts │ │ │ ├── handle-input-click.ts │ │ │ ├── handle-key-down.ts │ │ │ ├── handle-paste.ts │ │ │ ├── handle-submit.ts │ │ │ ├── index.ts │ │ │ ├── types.ts │ │ │ ├── use-handlers.ts │ │ │ └── utils.ts │ │ └── use-keyboard-shortcuts.ts │ └── index.ts ├── Template │ ├── Template.module.scss │ ├── Template.tsx │ └── index.ts └── shared └── symbols ├── caret.ts ├── get-highlighted-text.tsx ├── index.ts ├── position-mapping.ts ├── prompt-symbols.module.scss ├── reconstruct-raw-value.ts └── use-symbol-deletion.ts
1 parent c212d09 commit c9bd5b4

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎packages/ui/src/components/editor/common/prompts/PromptField/PromptField.module.scss‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
float: right;
6464
display: flex;
6565
align-items: center;
66-
margin: 3px 3px 0 4px;
66+
margin: 3px 5px 0 4px;
6767
position: relative;
6868
z-index: 2;
6969
gap: 4px;
@@ -348,12 +348,6 @@
348348

349349
&--new {
350350
padding: 0;
351-
width: 15px;
352-
353-
&::before {
354-
font-family: 'codicon';
355-
content: '\ea60';
356-
}
357351
}
358352

359353
&--active {

‎packages/ui/src/components/editor/common/prompts/PromptField/components/Tabs/Tabs.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ export const Tabs = forwardRef<TabsRef, Props>((props, ref) => {
119119
className={cn(styles.tabs__tab, styles['tabs__tab--new'])}
120120
data-role="tab-new"
121121
onClick={props.handle_input_click}
122-
/>
122+
>
123+
<div className={styles['tabs__tab-icon']} />
124+
</div>
123125
</ReactSortable>
124126
)
125127
}

‎packages/ui/src/components/editor/common/prompts/shared/symbols/get-highlighted-text.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ export const get_highlighted_text = (params: {
270270
tabs_items += `<span class="${cn(
271271
pfStyles['tabs__tab'],
272272
pfStyles['tabs__tab--new']
273-
)}" data-role="tab-new" title="New Tab"></span>`
273+
)}" data-role="tab-new" title="New Tab"><span class="${
274+
pfStyles['tabs__tab-icon']
275+
}"></span></span>`
274276

275277
header_html += `<span class="${pfStyles['tabs']}" data-role="tabs-container">${tabs_items}</span>`
276278
}

0 commit comments

Comments
 (0)