Repository navigation
docs: add guidelines for images and diagrams - #6603
Conversation
Describe how to add a diagram so that it matches the existing diagrams in Building Apps: an SVG source next to the PNG, the color of each role, font and sizes, arrows, numbered steps and alt text.
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-6603.fly.dev No documentation page changes detected. Built from ea2e005 |
…6607) ## Summary The two diagrams on the Architecture Overview page (#6556) used their own color scheme (green for the application's own code, blue for what Vaadin provides, orange for build tools), which differs from the other Building Apps diagrams such as `request-flow.svg`. This redraws them with the shared palette and drawing rules proposed in #6603, so that colors mean the same thing on every page: they encode the layer and where a part runs, not who wrote the code. ## What changed - **Application overview**: Java and React views are now blue UI parts; the Vaadin client engine is gray framework plumbing; the application services sit as a light-green application part inside a green Application Layer region; the frontend bundle and the build plugin are neutral white boxes inside the dashed build-time region. The browser–server gap is wider so the "Events and UI changes as JSON" label no longer straddles the region borders. The VaadinSession title is split into a title and a smaller second line. - **UI component diagram**: the Java view and React view are blue UI parts; the client engine is gray; the annotations box uses the white "detail of a UI part" style; the call from the Java view to `Button` is drawn as a blue UI-layer arrow; the dashed thin connectors are now solid 5-pixel lines. - Both: no text smaller than 22 pixels; no colors outside the palette tables. - The page text that explains the colors is rewritten to match (UI layer, framework plumbing, application layer, build), still saying which parts Vaadin provides and which you write. - The palette in #6603 has no role for build-time parts, so they use the neutral white box the guidelines prescribe for uncovered roles. If a dedicated build-time part role is wanted, it belongs in #6603. ## Test summary - Both PNGs regenerated from the SVGs with librsvg, rendered with Liberation Sans (Arial metrics), and checked visually: no label overflows its box. - Text-only change otherwise; no links or page structure changed. Working on behalf of Artur --------- Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
vaadin-review-bot
left a comment
There was a problem hiding this comment.
Reviewed the changes — left 3 comments.
| Finding | |
|---|---|
| 📝 | Several palette rows come from diagrams the same chapter says not to copy, not from the two reference SVGs. |
| 📐 | CONVENTIONS.md points contributors at the diagrams the chapter tells them not to copy. |
| 📝 | The text sizes, stroke widths and corner radii disagree with the two diagrams declared as the references. |
| | Detail of a UI part: a method, a field, an interface | `#FFFFFF` | `#2E9BEA` | `#222222` | | ||
| | Application layer (region) | `#17B05C` | `#0D6B38` | `#0B2E19` | | ||
| | Application part: a service, a repository | `#ADF5C8` | `#5EC98A` | `#222222` | | ||
| | External system: a database, another application | `#FFFFFF` | `#7F7F7F` | `#222222` | |
There was a problem hiding this comment.
📝 Several palette rows come from diagrams the same chapter says not to copy, not from the two reference SVGs.
The chapter names only request-flow.svg and mvp.svg as reference examples and ends the intro with "Do not copy the colors or style of any of these" about every other diagram. Neither reference contains an external system, a build-time region or peer boxes:
External systemandBuild timeexist only inarchitecture/images/overview.svg, which is excluded (it colors a Java view green and the client engine blue). The one other external system in the repo, inexternal-system-integration.svg, is orange#FFE0C2.- The five peer hues come from
layers.svg, the API/SPI diagrams and the microservices diagrams, all explicitly excluded. The blue stroke is not even stable there:#22B4FFin the API/SPI diagrams,#22B3FFin the microservices ones. - The double-headed arrow rule also has no example among the two references.
For these roles a contributor is told to use a color with no diagram to follow. Either widen the set of reference examples or say where the values come from.
images.md:108 · documentation
There was a problem hiding this comment.
Kept the two references and said where the other values come from instead. The External system and Build time rows are now marked as coming from overview.svg and component-architecture.svg, with a note to take only those rows from them. The peer section says the hues come from the earlier package and microservice diagrams and fixes the blue stroke at #22B4FF. The double-headed arrow rule now says no reference has one and how to draw it (one line, same marker at both ends). The dashed stroke and the monospace font are marked the same way, and the intro says these values are marked where they appear.
| Draw a diagram as an SVG source next to the PNG that the page shows, and start | ||
| the SVG with the command that regenerates the PNG. Use the colors, font and | ||
| sizes in `guidelines/images.md`, and give the same role the same color as in | ||
| the other diagrams. |
There was a problem hiding this comment.
📐 CONVENTIONS.md points contributors at the diagrams the chapter tells them not to copy.
"give the same role the same color as in the other diagrams" is the opposite of what guidelines/images.md says: all but two diagrams are declared non-conforming, with "Do not copy the colors or style of any of these." Since CONVENTIONS.md is the standalone checkable list, a contributor who reads only it will sample colors from layers.svg or an API/SPI diagram. Naming the two reference diagrams would fix it.
CONVENTIONS.md:183 · conventions
There was a problem hiding this comment.
Fixed. The section now names the two reference examples, request-flow.svg and mvp.svg, and says most other diagrams use older colors and are not models to copy.
| - **Font**: `font-family="Helvetica Neue, Helvetica, Arial, sans-serif"` on the | ||
| root `svg` element. Use `Menlo, DejaVu Sans Mono, monospace` only for code, | ||
| such as an annotation or a file name. | ||
| - **Sizes**: 30 for the title of a region, 28 for the label of a box, 22–25 for |
There was a problem hiding this comment.
📝 The text sizes, stroke widths and corner radii disagree with the two diagrams declared as the references.
Checked against request-flow.svg and mvp.svg:
- Box labels are 27 (
<vaadin-button>) and 25 (setSaveEnabled()), not 28. - Second lines in a box are 27 and 28 in request-flow, outside the stated 22–25.
- The
UI (one per browser tab)region title is 28, not 30. - The white detail boxes in mvp use a stroke of 5, while the rule puts parts at 6.
- The application layer region is
rx="10"in request-flow andrx="14"in mvp, so the two references disagree with each other and the rule covers only one.
A contributor cannot both follow the numbers and match the diagram next to theirs. Adjust the rules or the two SVGs.
images.md:76 · documentation
There was a problem hiding this comment.
Adjusted the rules to match both SVGs rather than changing the diagrams. Region titles are 30, or 28 for a region nested two deep (the UI region). Box labels are 28 and may step down to 25 when they don't fit (27 and 25 in the references). A wrapped label keeps its size on both lines, and a secondary note is 22. Corner radii follow nesting depth: 14 outer, 10 inside one region, 8 inside two, 6 for parts. That explains the application layer being 14 in mvp (outer) and 10 in request-flow (inside the server). Strokes are 6 for outer and layer regions and colored parts, and 5 for regions nested in a layer and for white detail boxes.
Derive the text sizes, corner radii and stroke widths from request-flow.svg and mvp.svg, say where the colors that neither reference shows come from, and point CONVENTIONS.md at the two reference diagrams instead of all diagrams.
Summary
Adds a guidelines chapter on images and diagrams, so that new diagrams match the newest ones in Building Apps. Those diagrams share a consistent palette and drawing style, but nothing wrote it down, so each new diagram had to rediscover it.
What changed
guidelines/images.md, based on the newest Building Apps diagrams (request-flow.svgandmvp.svgas reference examples):rsvg-converton Linux.CONVENTIONS.mdthat names the two reference diagrams, and the chapter listed inguidelines/overview.md.Test summary
Working on behalf of Artur