mirror of
https://github.com/callumalpass/tasknotes.git
synced 2026-07-22 12:50:26 +00:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # docs/releases/unreleased.md
This commit is contained in:
commit
435ba4c4ac
3 changed files with 59 additions and 0 deletions
|
|
@ -34,6 +34,9 @@ Example:
|
|||
- Thanks to @kmaustral for reporting the issue.
|
||||
- (#1906) Fixed NLP priority shortcuts leaving partial text in task titles when custom priority values include words like `high` or `low`.
|
||||
- Thanks to @RumiaKitinari for reporting the issue.
|
||||
- (#1904) Fixed long tags in task cards wrapping instead of forcing horizontal scrolling in TaskNotes Bases views and note cards.
|
||||
- Long tag pills can now wrap across lines and break within very long tag names on narrow screens.
|
||||
- Thanks to @3zra47 for reporting the issue.
|
||||
- (#1901) Fixed the task context menu creating an `undefined` property when adding or removing tags.
|
||||
- Hardened task property updates so invalid frontmatter property names are rejected instead of written.
|
||||
- Thanks to @mgrecar for reporting the issue.
|
||||
|
|
|
|||
|
|
@ -147,6 +147,20 @@
|
|||
text-decoration: none;
|
||||
}
|
||||
|
||||
.tasknotes-plugin .task-card__metadata-property--tags {
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.tasknotes-plugin .task-card__metadata-property--tags :where(.tag) {
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.tasknotes-plugin .task-card__metadata-property :where(.tag:hover) {
|
||||
background-color: var(--tag-background-hover, var(--background-modifier-hover));
|
||||
border-color: var(--tag-border-color-hover, var(--background-modifier-border-hover));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Issue #1904: long tags in task cards should wrap instead of forcing
|
||||
* horizontal scrolling in Bases views and embedded note cards.
|
||||
*
|
||||
* @see https://github.com/callumalpass/tasknotes/issues/1904
|
||||
*/
|
||||
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
function readRepoFile(relativePath: string): string {
|
||||
return fs.readFileSync(path.resolve(__dirname, "../../../", relativePath), "utf8");
|
||||
}
|
||||
|
||||
function extractCssBlock(css: string, selector: string): string {
|
||||
const escapedSelector = selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
const match = css.match(new RegExp(`${escapedSelector}\\s*\\{([^}]*)\\}`));
|
||||
return match?.[1] ?? "";
|
||||
}
|
||||
|
||||
describe("Issue #1904: task card long tag wrapping", () => {
|
||||
it("allows tag metadata and long tag pills to wrap within card width", () => {
|
||||
const css = readRepoFile("styles/task-card-bem.css");
|
||||
const tagsPropertyBlock = extractCssBlock(
|
||||
css,
|
||||
".tasknotes-plugin .task-card__metadata-property--tags"
|
||||
);
|
||||
const tagBlock = extractCssBlock(
|
||||
css,
|
||||
".tasknotes-plugin .task-card__metadata-property--tags :where(.tag)"
|
||||
);
|
||||
|
||||
expect(tagsPropertyBlock).toContain("flex-wrap: wrap");
|
||||
expect(tagsPropertyBlock).toContain("align-items: flex-start");
|
||||
expect(tagBlock).toContain("flex: 0 1 auto");
|
||||
expect(tagBlock).toContain("min-width: 0");
|
||||
expect(tagBlock).toContain("max-width: 100%");
|
||||
expect(tagBlock).toContain("overflow-wrap: anywhere");
|
||||
expect(tagBlock).toContain("word-break: break-word");
|
||||
expect(tagBlock).toContain("white-space: normal");
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue