mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-10 10:41:30 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7b9ee04f1 | ||
|
|
0fb8955269 |
No files matched your search
@@ -76,6 +76,4 @@ the [official plugins](plugins/official). The plugin API is still a preview.
|
||||
|
||||
[Apache 2.0](LICENSE). Bundled third-party assets are listed in [`THIRD_PARTY_LICENSES.md`](THIRD_PARTY_LICENSES.md).
|
||||
|
||||
|
||||
|
||||
<sub>Not affiliated with JetBrains. IntelliJ IDEA is a trademark of JetBrains s.r.o.</sub>
|
||||
@@ -310,7 +310,9 @@
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
max-width: 50%;
|
||||
/* May use the whole subject cell when space allows (#2447); shrinks with
|
||||
per-label ellipsis before crowding out the commit message. */
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
margin-left: auto;
|
||||
}
|
||||
@@ -328,7 +330,8 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
min-width: 0;
|
||||
max-width: 180px;
|
||||
/* Sizes to content (#2447): truncates with ellipsis only when .refs runs
|
||||
out of room; the full name stays available via the title tooltip. */
|
||||
}
|
||||
/* Outlined tag glyph in the ref's colour. */
|
||||
.ref::before {
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { RefLabels } from "../GitLog";
|
||||
|
||||
const css = readFileSync("src/features/vcs/GitLog.module.css", "utf8");
|
||||
|
||||
const LONG_LOCAL = "feature-connection-storm-v2";
|
||||
const LONG_REMOTE = "gitlab/feature-connection-storm-v2";
|
||||
const REMOTES = new Set([LONG_REMOTE]);
|
||||
|
||||
describe("RefLabels long branch names (#2447)", () => {
|
||||
it("renders full names with title tooltips in regular mode", () => {
|
||||
render(<RefLabels refs={[LONG_LOCAL, LONG_REMOTE]} remoteNames={REMOTES} />);
|
||||
expect(screen.getByTitle(LONG_LOCAL)).toHaveTextContent(LONG_LOCAL);
|
||||
expect(screen.getByTitle(LONG_REMOTE)).toHaveTextContent(LONG_REMOTE);
|
||||
});
|
||||
|
||||
it("absorbs the remote into the local label in compact mode", () => {
|
||||
render(<RefLabels refs={[LONG_LOCAL, LONG_REMOTE]} compact remoteNames={REMOTES} />);
|
||||
expect(screen.getByTitle(`${LONG_LOCAL}, ${LONG_REMOTE}`)).toHaveTextContent(`gitlab & ${LONG_LOCAL}`);
|
||||
});
|
||||
|
||||
it("lets labels size to content: no fixed pixel cap, ellipsis and clipping kept", () => {
|
||||
const refBlocks = [...css.matchAll(/\.ref\s*\{([^}]*)\}/g)].map((m) => m[1]);
|
||||
expect(refBlocks.length).toBeGreaterThan(0);
|
||||
for (const block of refBlocks) expect(block).not.toMatch(/max-width:\s*\d+px/);
|
||||
expect(refBlocks[0]).toMatch(/text-overflow:\s*ellipsis/);
|
||||
const refsBlock = css.match(/\.refs\s*\{([^}]*)\}/)?.[1] ?? "";
|
||||
expect(refsBlock).toMatch(/overflow:\s*hidden/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user