hicommonwealth / commonwealth

A platform for decentralized communities
https://commonwealth.im
GNU General Public License v3.0
68 stars 44 forks source link

Improve Sidebar Loading #4311

Closed dillchen closed 1 year ago

dillchen commented 1 year ago

Description

The "in community" sidebar should load as soon as possible upon any page loads. It seems that the loading of the sidebar should appear shortly after the top navigation and left most sidebar appears.

We want to improve the user experience by reducing the perceived loading time. We want to do this by showing more of the app without waiting--less white space and less Cow Bobber.

Preliminary Investigation

Currently, the Sidebar waits for app.chain.id to load, even though it's not necessary to display an initial view of component. That is, we see white space for longer

Suggested solution

Acceptance Criteria

Here is the example, it should appear similar to this example: https://www.loom.com/share/3ef3d7c7bf654c13b58e6c3082bfaf6a

dillchen commented 1 year ago

What has been tried already, before activeChain is set, we should show the sidebar, potentially with a ternary. However we need to handle the chainID better, because only using this approach will cause regressions

` {hasActiveChain && isInsideCommunity ? (

{showAdmin && } {featureFlags.communityHomepage && app.chain?.meta.hasHomepage && (
navigate('/feed')} > Home
        )}
        <DiscussionSection />
        <GovernanceSection />
        <ExternalLinksModule />
        <div className="buttons-container">
          {isLoggedIn && app.chain && (
            <div className="subscription-button">
              <SubscriptionButton />
            </div>
          )}
          {app.isCustomDomain() && (
            <div
              className="powered-by"
              onClick={() => {
                window.open('https://commonwealth.im/');
              }}
            />
          )}
        </div>
      </div>
    ) : (
      <div className="community-menu">
        <DiscussionSection />
        <GovernanceSection />
      </div>`
mzparacha commented 1 year ago

In the code I think we will have to update these components in the sidebar to handle app.activeChainId() when it's still initing chain

  • <AdminSection/>
  • <DiscussionSection/>
  • <GovernanceSection/>
  • <ExternalLinksModule/>
  • <SubscriptionButton/>
zakhap commented 1 year ago

Superseded with #4548