Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: simple table width (#6918)

Kilu.He5cf66172318e
diff --git a/.github/workflows/docker_ci.yml b/.github/workflows/docker_ci.yml
index e38ac4e671..51e8a2ac28 100644
--- a/.github/workflows/docker_ci.yml
+++ b/.github/workflows/docker_ci.yml
@@ -2,9 +2,9 @@ name: Docker-CI
on:
push:
- branches: ["main", "release/*"]
+ branches: [ "main", "release/*" ]
pull_request:
- branches: ["main", "release/*"]
+ branches: [ "main", "release/*" ]
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/tauri2_ci.yaml b/.github/workflows/tauri2_ci.yaml
index 1191b2a354..aeefaa5fe6 100644
--- a/.github/workflows/tauri2_ci.yaml
+++ b/.github/workflows/tauri2_ci.yaml
@@ -5,6 +5,7 @@ on:
paths:
- ".github/workflows/tauri2_ci.yaml"
- "frontend/rust-lib/**"
+ paths-ignore:
- "frontend/appflowy_web_app/**"
- "frontend/resources/**"
diff --git a/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/SimpleTableCell.tsx b/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/SimpleTableCell.tsx
index baa0c15f82..29c3ea2379 100644
--- a/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/SimpleTableCell.tsx
+++ b/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/SimpleTableCell.tsx
@@ -1,4 +1,4 @@
-import { BlockType, TableAlignType } from '@/application/types';
+import { BlockType } from '@/application/types';
import { EditorElementProps, SimpleTableCellBlockNode, SimpleTableNode } from '@/components/editor/editor.type';
import { renderColor } from '@/utils/color';
import React, { forwardRef, useMemo } from 'react';
@@ -51,8 +51,8 @@ const SimpleTableCell =
const { horizontalAlign, bgColor } = useMemo(() => {
if (!table || !row) return {
- bgColor: '',
- horizontalAlign: TableAlignType.Left,
+ bgColor: undefined,
+ horizontalAlign: undefined,
};
const [parentElement] = table;
diff --git a/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/SimpleTableRow.tsx b/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/SimpleTableRow.tsx
index b60c578cdc..25c0ee614f 100644
--- a/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/SimpleTableRow.tsx
+++ b/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/SimpleTableRow.tsx
@@ -1,4 +1,4 @@
-import { BlockType, TableAlignType } from '@/application/types';
+import { BlockType } from '@/application/types';
import { EditorElementProps, SimpleTableNode, SimpleTableRowNode } from '@/components/editor/editor.type';
import { renderColor } from '@/utils/color';
import React, { forwardRef, useMemo } from 'react';
@@ -38,8 +38,8 @@ const SimpleTableRow =
const { align, bgColor } = useMemo(() => {
if (!parent) return {
- align: TableAlignType.Left,
- bgColor: '',
+ align: undefined,
+ bgColor: undefined,
};
const [parentElement] = parent;
diff --git a/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/simple-table.scss b/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/simple-table.scss
index 6457c94842..c992bf6d4a 100644
--- a/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/simple-table.scss
+++ b/frontend/appflowy_web_app/src/components/editor/components/blocks/simple-table/simple-table.scss
@@ -1,4 +1,6 @@
.simple-table {
+ font-size: 14px;
+
&.enable-header-column {
tr [data-block-type="simple_table_cell"]:first-child {
@apply font-semibold;
@@ -32,6 +34,15 @@
}
}
+ tr[data-table-row-horizontal-align="left"] {
+ .block-element {
+ > div > .text-element {
+ text-align: left;
+ justify-content: flex-start;
+ }
+ }
+ }
+
tr[data-table-row-horizontal-align="center"] {
.block-element {
> div > .text-element {
@@ -50,6 +61,15 @@
}
}
+ td[data-table-cell-horizontal-align="left"] {
+ .block-element {
+ > div > .text-element {
+ text-align: left;
+ justify-content: flex-start;
+ }
+ }
+ }
+
td[data-table-cell-horizontal-align="center"] {
.block-element {
@@ -69,11 +89,12 @@
}
}
+
td .cell-children {
- @apply min-w-[120px] leading-[1.8em];
+ @apply leading-[1.7em];
}
td {
- @apply p-2;
+ @apply px-2 py-0.5;
}
}
\ No newline at end of file