Skip to content

Conversation

Ovgodd
Copy link
Collaborator

@Ovgodd Ovgodd commented Oct 15, 2025

Purpose

Introduce a loading skeleton in the DocEditor and manage its visibility using Zustand. Ensure the loader is removed properly in case of errors to prevent it from staying stuck on screen.

issue : 1452

skeleton.mp4

Proposal

  • Add a skeleton component to display while a document is being created
  • Use Zustand store to track the document creation state
  • Add onError handling to reset state on failure and avoid UI freeze

@Ovgodd Ovgodd force-pushed the feat/doc-editor-skeleton branch from 9707dc5 to f976a72 Compare October 15, 2025 12:03
Copy link

github-actions bot commented Oct 15, 2025

Size Change: +1.11 kB (+0.03%)

Total Size: 3.66 MB

Filename Size Change
apps/impress/out/_next/static/72b63007/_buildManifest.js 0 B -881 B (removed) 🏆
apps/impress/out/_next/static/chunks/8495.js 54.1 kB +937 B (+1.76%)
apps/impress/out/_next/static/ff1ec2e8/_buildManifest.js 882 B +882 B (new file) 🆕

compressed-size-action

@Ovgodd Ovgodd requested a review from AntoLC October 15, 2025 12:50
@Ovgodd Ovgodd self-assigned this Oct 15, 2025
@Ovgodd Ovgodd added frontend feature add a new feature triage labels Oct 15, 2025
@Ovgodd Ovgodd marked this pull request as ready for review October 15, 2025 12:51
adds a skeleton component for initial loading of the document editor

Signed-off-by: Cyril <[email protected]>
integrates loading skeleton and creation state from zustand store

Signed-off-by: Cyril <[email protected]>
@Ovgodd Ovgodd force-pushed the feat/doc-editor-skeleton branch from f976a72 to 5b99563 Compare October 15, 2025 13:41
Comment on lines +23 to +26
top: 0;
left: 0;
right: 0;
bottom: 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
top: 0;
left: 0;
right: 0;
bottom: 0;
inset: 0;

Copy link
Collaborator

Choose a reason for hiding this comment

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

We have a Overlay component already, could we use it ?

import { tokens, useCunninghamTheme } from '@/cunningham';
import { useResponsiveStore } from '@/stores';

const colors = tokens.themes.default.theme.colors;
Copy link
Collaborator

Choose a reason for hiding this comment

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

To leverage the theming we should use useCunninghamTheme to get the colors.

Comment on lines +18 to +26
const SkeletonLine = ({
width = '100%',
height = '16px',
margin = '0',
}: {
width?: string;
height?: string;
margin?: string;
}) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we extend the interface with BoxType ?
Like that we will benefit from all the props of Box.

Here an example of implementation: https://github.com/suitenumerique/docs/blob/main/src/frontend/apps/impress/src/components/Overlayer.tsx

);
};

const SkeletonCircle = ({ size = '32px' }: { size?: string }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same, can we extend the interface with BoxType ?
Like that we will benefit from all the props of Box.

Here an example of implementation: https://github.com/suitenumerique/docs/blob/main/src/frontend/apps/impress/src/components/Overlayer.tsx


{/* Metadata (role and last update) */}
<Box $direction="row" $gap="0.5rem" $align="center">
<SkeletonLine width="260px" height="12px" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

In responsive, on small screen it gets out of screen:

Suggested change
<SkeletonLine width="260px" height="12px" />
<SkeletonLine maxWidth="260px" height="12px" />

Copy link
Collaborator

Choose a reason for hiding this comment

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

As talk together, maybe something very generic could be nice (BooleanStore ?), with Record<string, boolean>; to be able to have multiple toggles here and there.

overflow-x: clip;
`}
>
<DocCreationOverlay />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same I think it could be nice to have something more generic, that can be used for other things that DocCreation.
The problem that I find as well, is I get a bit the flickering effect, if we could implement a light transition before unmounting the skeleton would be great (fadeOut / fadeIn ?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants