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

🚀 - Allow padding to be Zero #623

Closed
SarjuHansaliya opened this issue Jan 7, 2024 · 8 comments
Closed

🚀 - Allow padding to be Zero #623

SarjuHansaliya opened this issue Jan 7, 2024 · 8 comments
Labels
feature New feature or request next Issues or pull request to do in next branch (until 6th May)
Milestone

Comments

@SarjuHansaliya
Copy link
Contributor

Which @codeimage/* package(s) are relevant/releated to the feature request?

ui

Description

Currently padding options are 16, 32, 64, 128.

It would be great if it allow 0 option also.

If you think this is helpful, I can work on creating PR.

@SarjuHansaliya SarjuHansaliya added the feature New feature or request label Jan 7, 2024
@riccardoperra
Copy link
Owner

riccardoperra commented Jan 7, 2024

Hi, yes this could be helpful 🙂

In my opinion the segmentedControl cannot be used anymore since there is no enough space for five items. Instead, we should use the Select control.

Anyway, some info for the pr since navigating into the codebase could be painful:

Here’s the configuration file with the padding settings
configuration.ts

I’d recommend you to refactor the current number[] array to a key-value object with label and value property, just like the “editorRadius” config.

The editor ui for padding is here: FrameStyleForm

You can copy a select implementation from this:

const languagesOptions = createSelectOptions(
languages.map(language => ({
label: language.label,
value: language.id,
})),
{
key: 'label',
valueKey: 'value',
},
);

<PanelRow for={'frameLanguageField'} label={t('frame.language')}>
<TwoColumnPanelRow>
<SuspenseEditorItem
fallback={<SkeletonLine width={'100%'} height={'26px'} />}
>
<Select
{...languagesOptions.props()}
{...languagesOptions.controlled(
() => editor().languageId,
language => {
setLanguageId(language!);
getUmami().track('change-language', {
language: language!,
});
},

Note: currently the radius between the frame and the editor could be different, then the editor frame border radius must be 0 when frame padding = 0

I think you can update here the “styles.terminalVars.radius” css variable

style={assignInlineVars({
[styles.terminalVars.headerBackgroundColor]:
tabTheme()?.background ?? '',
[styles.terminalVars.backgroundColor]: background(),
[styles.terminalVars.textColor]: props.textColor,
[styles.terminalVars.boxShadow]: props.shadow ?? 'unset',
[styles.terminalVars.tabTextColor]: tabTheme()?.textColor ?? '',
[styles.terminalVars.tabAccentActiveBackground]:
tabTheme().activeTabBackground ?? '',
[styles.terminalVars.tabAccentInactiveBackground]:
tabTheme().inactiveTabBackground ?? '',
...(props.style ?? {}),
})}

@github-project-automation github-project-automation bot moved this to Todo in CodeImage Jan 7, 2024
@riccardoperra riccardoperra moved this from Todo to Planned in CodeImage Jan 7, 2024
@riccardoperra riccardoperra added this to the Backlog milestone Jan 7, 2024
@SarjuHansaliya
Copy link
Contributor Author

awesome @riccardoperra thank you for the information, let me work on it.

@riccardoperra
Copy link
Owner

Thanks for your collaboration 😃 use the contributions.md to startup the project but if you need something, just ask.

if you don’t want to run docker etc because you don’t need the backend for this change, I think you will have to run the build command manually for each package in “packages” folder, except “api-types” (which requires you to have a backend with Postgres up)

@SarjuHansaliya
Copy link
Contributor Author

@riccardoperra I have created PR here #625

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 13, 2024
@riccardoperra riccardoperra removed the wontfix This will not be worked on label Mar 13, 2024
@riccardoperra riccardoperra reopened this Apr 15, 2024
@github-project-automation github-project-automation bot moved this from Planned to Done in CodeImage Apr 15, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in CodeImage Apr 15, 2024
@riccardoperra
Copy link
Owner

#625 to be merged

@riccardoperra riccardoperra added the next Issues or pull request to do in next branch (until 6th May) label Apr 15, 2024
@riccardoperra riccardoperra moved this from In Progress to To Merge in CodeImage Apr 27, 2024
@riccardoperra riccardoperra moved this from To Merge to Done in CodeImage Apr 27, 2024
@riccardoperra
Copy link
Owner

Released with 1.6.0. Thanks for your contribution :)

@SarjuHansaliya
Copy link
Contributor Author

Awesome @riccardoperra Thanks for publishing those changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request next Issues or pull request to do in next branch (until 6th May)
Projects
Status: Done
Development

No branches or pull requests

2 participants