Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix language dialog overflow and export button padding (#3540)

Koen633e3098ee28
diff --git a/ui/AGENTS.md b/ui/AGENTS.md
index 9f6921940..50e980b10 100644
--- a/ui/AGENTS.md
+++ b/ui/AGENTS.md
@@ -26,6 +26,10 @@ Own Lit components extend `OrElement` from `@openremote/or-element` instead of `
A state change should re-render only the part it affects. Re-rendering a whole page, or a large component such as a table, flickers and discards the state that component holds: sort order, pagination, selection, scroll position. Keep those children mounted and update their properties.
+## Spacing
+
+Avoid negative margins that cancel a container's padding. They repeat a value the container owns, so they break silently when it changes. Keep the content inside the padding, or add a theme variant to the container that turns it off.
+
## Adding a new component package
New packages under `ui/component/` are picked up automatically by the yarn workspace and by Gradle (any dir with a `build.gradle`). The rsbuild apps are not automatic: add the package to the `@openremote/*` alias maps in `ui/app/manager/rsbuild.config.ts` and `ui/app/storybook/rsbuild.config.ts`, which resolve workspace packages to their `src` dirs. A missing entry fails the build with "Module not found" for any file importing the package.
@@ -50,6 +54,14 @@ Base styles and registered styles ship with the component code. Our Lumo module
**Public API.** Projects may rely on what the custom-elements manifest documents: tags, attributes, properties, events, slots, `--or-*` properties and theme variants, plus the documented Vaadin API of thin wrappers. Do not rename or remove those in one step; keep the old name working with a warning for a release. Shadow structure, internal classes, Lumo module names, `--_*` properties and the parts of our own components are internal, and code that depends on Vaadin internals stays in this repo.
+**Following Vaadin.** Compare any Vaadin override, variant, property or wrapper against the Vaadin source at the pinned version, when writing it and in review. The styling documentation in each component's source in [vaadin/web-components](https://github.com/vaadin/web-components) lists its public parts, state attributes and custom properties, and the Lumo styles show its `theme~=` variants and which properties Lumo reads.
+
+- Use what Vaadin offers rather than reimplementing a component, variant or property.
+- Do not stop it from working, e.g. with an `!important` rule that beats `theme="no-padding"`.
+- Do not depend on what that documentation leaves out, such as `--_*` properties. Lumo module lists are the exception.
+
+Document anything that goes against this and why, in a code comment or wherever the next reader will find it.
+
**Choosing the approach.** Use the first that fits:
1. A documented custom property, for a value such as a color, size or spacing.
diff --git a/ui/app/manager/src/pages/page-export.ts b/ui/app/manager/src/pages/page-export.ts
index c787d2e72..e09c7b9f9 100644
--- a/ui/app/manager/src/pages/page-export.ts
+++ b/ui/app/manager/src/pages/page-export.ts
@@ -201,12 +201,6 @@ export class PageExport extends Page<AppStateKeyed> {
display: flex;
justify-content: space-between;
}
-
- .export-btn-wrapper .button {
- padding: 0;
- margin-right: 0;
- margin-bottom: 0;
- }
`,
];
}
@@ -336,19 +330,10 @@ export class PageExport extends Page<AppStateKeyed> {
</or-vaadin-select>
</div>
<div class="export-btn-wrapper">
- <or-vaadin-button
- class="button"
- ?disabled=${this.isClearExportBtnDisabled}
- @click=${() => this.clearSelection()}
- >
+ <or-vaadin-button ?disabled=${this.isClearExportBtnDisabled} @click=${() => this.clearSelection()}>
<or-translate value="clearTable"></or-translate>
</or-vaadin-button>
- <or-vaadin-button
- class="button"
- theme="primary"
- ?disabled=${this.isExportBtnDisabled}
- @click=${() => this.export()}
- >
+ <or-vaadin-button theme="primary" ?disabled=${this.isExportBtnDisabled} @click=${() => this.export()}>
<or-translate value="export"></or-translate>
</or-vaadin-button>
</div>
diff --git a/ui/app/manager/src/pages/page-users.ts b/ui/app/manager/src/pages/page-users.ts
index 44cda9d54..4be1f8a13 100644
--- a/ui/app/manager/src/pages/page-users.ts
+++ b/ui/app/manager/src/pages/page-users.ts
@@ -145,8 +145,6 @@ export class PageUsers extends Page<AppStateKeyed> {
vertical-align: middle;
--or-icon-width: 20px;
--or-icon-height: 20px;
- margin-right: 2px;
- margin-left: -5px;
}
.row {
diff --git a/ui/component/or-app/src/index.ts b/ui/component/or-app/src/index.ts
index f2856e487..4a24dda1d 100644
--- a/ui/component/or-app/src/index.ts
+++ b/ui/component/or-app/src/index.ts
@@ -534,14 +534,14 @@ export class OrApp<S extends AppStateKeyed> extends OrElement {
}
};
const header = () => html`
- <h2 style="padding-left: 7px; margin: 0;">
+ <h2 style="padding-left: 26px; margin: 0;">
<or-translate value="language"></or-translate>
</h2>
`;
const content = () => html`
<or-vaadin-list-box
selected=${ifDefined(selected)}
- style="margin: 0 -18px 6px -18px;"
+ style="margin-bottom: 6px;"
@selected-changed=${(ev: CustomEvent) => onchange(ev)}
>
${languages.map(