twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
GNU Affero General Public License v3.0
15.87k stars 1.75k forks source link

Settings Advanced Mode #6147

Open Bonapara opened 2 months ago

Bonapara commented 2 months ago

Desired Behavior

We want to introduce a new Advanced Settings toggle allowing users to view advanced (often technical) settings. The goal is to reduce interface clutter.

The toggle should always be at the settings page bottom left. We want the following issues addressed before displaying it:

https://github.com/twentyhq/twenty/issues/6145 https://github.com/twentyhq/twenty/issues/6146

image

Component

image

https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=11519-270312&t=H5hfHOgNoulsToAq-11

Settings Navbar

Add a new Developers section that would have two sub-pages:

CleanShot 2024-09-11 at 15 29 59

greptile-apps[bot] commented 2 months ago

Implementation Steps

  1. Create Advanced Settings Toggle Component

    • Create a new component AdvancedSettingsToggle.tsx in the components directory.
      
      import React from 'react';
      import styled from '@emotion/styled';
      import { Toggle } from 'twenty-ui';

    const Container = styled.div position: fixed; bottom: 16px; left: 16px; ;

    export const AdvancedSettingsToggle = () => { const [isAdvanced, setIsAdvanced] = React.useState(false);

    const handleToggle = () => { setIsAdvanced(!isAdvanced); };

    return (

    ); };

  2. Add Toggle to Settings Pages

    • Import and add the AdvancedSettingsToggle component to the following settings pages:
      • SettingsWorkspace.tsx
      • SettingsProfile.tsx
      • SettingsDevelopers.tsx
      • SettingsObjectDetail.tsx
      • SettingsObjectNewFieldStep1.tsx
      • SettingsObjects.tsx
        
        import { AdvancedSettingsToggle } from '@/settings/components/AdvancedSettingsToggle';

    // Add at the bottom of the return statement in each component

  3. Conditionally Display Toggle

    • Ensure the toggle is conditionally displayed based on the resolution of issues #6145 and #6146.
      // Example conditional rendering
      {isIssue6145Resolved && isIssue6146Resolved && <AdvancedSettingsToggle />}
  4. Update State Management

    • Ensure the state of the toggle is managed and can be accessed globally if needed.

Relevant Files

References

/packages/twenty-front/src/pages/settings/SettingsWorkspace.tsx /packages/twenty-front/src/pages/settings/SettingsProfile.tsx /packages/twenty-front/src/pages/settings/developers/SettingsDevelopers.tsx /packages/twenty-front/src/pages/settings/data-model/SettingsObjectDetail.tsx /packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1.tsx /packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsx /packages/twenty-front/src/pages/settings

#### About Greptile This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a πŸ‘ if this is helpful and πŸ‘Ž if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/twentyhq/twenty/main) Β· [Edit Issue Bot Settings](https://app.greptile.com/apps/github)
prevar commented 2 months ago

Hi, Please let me know if this issue is available. Can I can pick it up? Thanks.

Bonapara commented 2 months ago

Hi @prevar, this issue is available, but it should be toggled under a feature flag while we wait for the two mentioned issues to be completed.

prevar commented 2 months ago

Ok. Thanks I will wait for the 2 issues to be completed to start working on this issue.

FelixMalfait commented 2 months ago

Store this in localstorage (https://github.com/twentyhq/twenty/blob/9683a19287d62e23dcb91c256f7b74ca667fd11b/packages/twenty-front/src/utils/recoil-effects.ts#L7)

gitstart-app[bot] commented 1 week ago

Here is the GitStart Ticket for this issue: https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6147

ijreilly commented 1 week ago

Let's kickstart this issue together when it is ready to be taken. I think we can start with the FE only behind a feature flag, that would cover

  1. the Advanced component feature here in the left bar
  2. the front-end only for the first advanced feature we will have: https://github.com/twentyhq/twenty/issues/6145 Capture d’écran 2024-09-11 aΜ€ 15 40 49

    that includes making the toggle work (show/hide "Api name" upon toggle, with an animation perhaps?)

@gitstart-twenty fyi for when you will start working on it. @Bonapara fyi

gitstart-twenty commented 1 week ago

Hello @ijreilly so, we would need to implement the toggle and use this API Name input to test the implementation of the feature, but just to show the feature working, right?

I imagine that in this case, we would just need to get the field name and display it on a disabled input, is that correct? do we need to add any other part of the other issue?

Also, we could not find the designs in Figma, I think the link is broken, it redirects to this page: image

Hey @Bonapara could you provide the links for the toggle and for the feature mentioned above? Also, would be very nice if you could give us access to the dev mode on the Figma 🀝

Bonapara commented 1 week ago

Toggle

https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=34851-536797&t=emUxzrvX6zNaHyLZ-4

Navbar

https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=34845-235253&t=emUxzrvX6zNaHyLZ-4

Please get in touch with me on Discord for Dev mode access ;)

gitstart-twenty commented 1 week ago

Hello again @Bonapara πŸ‘‹ Currently we have this GitHub version component in the same place where the toggle would be implemented, we would like to confirm if we should remove the component or keep this along the toggle image

Bonapara commented 1 week ago

Hi @gitstart-twenty πŸ‘‹ We should move the version to the bottom of the General Settings page. Thanks!

image

gitstart-twenty commented 1 week ago

ok, thank you