Commit Graph

572 Commits

Author SHA1 Message Date
Brooooooklyn
822bbb54a4
chore(core): add more telemetry (#6402) 2024-03-30 07:46:23 +00:00
JimmFly
2576a69eb6
fix(core): unexpected response style of shared page (#6383) 2024-03-29 05:29:54 +00:00
pengx17
c7e10c2283
feat(core): fav item reordering (#6302) 2024-03-29 04:04:27 +00:00
pengx17
35af526eb2
feat: allow collections to be added to favorites (#6288) 2024-03-29 04:04:17 +00:00
pengx17
5490944d04
refactor(core): favorite adapter (#6285)
1. abstraction over favourites that supports different type of resources
2. sorting abstraction
2024-03-29 04:04:08 +00:00
CatsJuice
f1c70d5df0
fix(core): reload user session after signing out (#6381) 2024-03-29 03:47:18 +00:00
CatsJuice
605a5abee8
fix(core): user info should be updated when session reloaded (#6382) 2024-03-29 03:25:13 +00:00
CatsJuice
35715ab1d8
feat(core): sidebar local workspace enable cloud directly (#6366)
- Add a new hook `useEnableClould`, remove `<EnableAffineClouldModal />`
- Sidebar local workspace list item support enable AFFiNE Cloud
2024-03-29 02:08:09 +00:00
JimmFly
1a873ecf3c
feat(core): add shortcut for multi select docs (#6318)
close TOV-701
In All Doc, `Shift + Click` has been added to activate the multiple selection state.
2024-03-29 01:40:23 +00:00
Brooooooklyn
7cd75824a4
fix(core): use ResizeObserver polyfill (#6360)
- Close https://github.com/toeverything/AFFiNE/issues/6359
2024-03-28 10:48:22 +00:00
Brooooooklyn
c2847e2082
chore(core): split sentry and setup into web/electron (#6357) 2024-03-28 10:24:25 +00:00
JimmFly
88d04e23e9
feat(core): update i18n resources (#6362)
close TOV-769

<img width="712" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/902a0771-e8df-46e2-8d7c-1f453a7099e6">
2024-03-28 10:11:25 +00:00
fundon
ef354f1643
fix(core): prevent frequent sign-in (#6339) 2024-03-28 07:35:32 +00:00
CatsJuice
fbe7a346c6
fix(core): adjust sidebar workspace card syncing tooltip style (#6356) 2024-03-28 07:13:27 +00:00
pengx17
e53744b740
fix: should use fullscreen to control where to place macos window controls (#6351) 2024-03-28 03:40:46 +00:00
EYHN
ba9dad95b4
fix(core): improve performance (#6345) 2024-03-27 14:01:54 +00:00
CatsJuice
710edd28db
feat(core): open restore history confirm modal with hook (#6343) 2024-03-27 13:30:36 +00:00
CatsJuice
d412635f6b
feat(component): new hook to open confirm modal (#6342)
new exports from `@affine/component`:
```ts
import { ConfirmModalProvider, useConfirmModal } from "@affine/component"
```

Open confirm modal with hook:

```ts
const Component = () => {
  const { openConfirmModal } = useConformModal();

  const open = () => {
    openConfirmModal({
      // props of ConfirmModal
      /**
       * will show loading state when confirm clicked, and close after onConfirm finished
       */
      onConfirm: async () => {
        await new Promise((r) => setTimeout(r, 2000));
      },
    });
  }
  return <Button onClick={open}>Open</Button>
}
```
2024-03-27 13:30:30 +00:00
Brooooooklyn
39facba92e
fix(core): opt out telemetry condition (#6341) 2024-03-27 08:37:15 +00:00
pengx17
d4c7d58b00
fix: use overflow: clip instead of js to prevent scrolling with pgup/pgdown (#6338) 2024-03-27 07:07:22 +00:00
pengx17
5ca17c155a
fix(core): editor pgup/pgdn issues (#6331)
fix https://github.com/toeverything/AFFiNE/issues/6232
2024-03-27 04:47:32 +00:00
Brooooooklyn
5dcb3d69e5
fix(core): opt out telemetry if it was set to false (#6335) 2024-03-27 04:36:09 +00:00
CatsJuice
a3cc06f3bb
fix(core): optimize sidebar workspace card and avatar (#6324)
- adjust avatar size
- unlogged avatar dark-mode
- fix Tooltip console error
- optimize syncing status animation
2024-03-27 03:29:01 +00:00
EYHN
cccf864ed9
fix(core): duplicate window controls in trash (#6329)
fix https://github.com/toeverything/AFFiNE/issues/6310
2024-03-27 02:37:53 +00:00
EYHN
16063340d0
fix(core): fix meta.xxx is undefined (#6321) 2024-03-26 08:53:14 +00:00
fundon
8ee9f6ec05
chore: improve password error message (#6255)
chore: improve error message

chore: add password minlength & maxlength i18n

chore: check max length

fix: i18n variables

feat: add CredentialsRequirementType
2024-03-26 07:15:06 +00:00
CatsJuice
0731872347
feat(core): refactor sidebar header (#6251)
- Add user avatar
- Move sign-out/user settings link from workspace-modal to user avatar modal
- Modify the style of workspace list items
- Modify gap of navigation buttons
- Animate Syncing/Offline/...

![CleanShot 2024-03-22 at 10.22.38.gif](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/LakojjjzZNf6ogjOVwKE/7305f561-a85b-4ec6-89c2-27e2f1b63c85.gif)
2024-03-26 06:10:38 +00:00
JimmFly
669ca325a1
fix(core): tag color should use palette-line-color (#6315) 2024-03-26 04:57:41 +00:00
Brooooooklyn
ffbfdb65a2
fix(core): add env info to tracks (#6313) 2024-03-26 03:41:41 +00:00
EYHN
3e547ce4cc
fix(core): hidden modals when workspace fallback (#6301) 2024-03-25 13:52:08 +00:00
EYHN
da12a0e48e
fix(core): fix error when switch to local workspace (#6144) 2024-03-25 21:35:10 +08:00
CatsJuice
b2f34d17a2
feat(core): adjust app sidebar's style (#6162) 2024-03-25 10:25:48 +00:00
donteatfriedrice
48abc52e85
feat: bump blocksuite (#6294)
## Features
- https://github.com/toeverything/BlockSuite/pull/6544 @golok727
- https://github.com/toeverything/BlockSuite/pull/6543 @golok727
- https://github.com/toeverything/BlockSuite/pull/6536 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6497 @doouding
- https://github.com/toeverything/BlockSuite/pull/6514 @regischen
- https://github.com/toeverything/BlockSuite/pull/6523 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6530 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6526 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6532 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6493 @golok727
- https://github.com/toeverything/BlockSuite/pull/6529 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6528 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6509 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6525 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6502 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6489 @Flrande

## Bugfix
- https://github.com/toeverything/BlockSuite/pull/6558 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6556 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6547 @fundon
- https://github.com/toeverything/BlockSuite/pull/6537 @golok727
- https://github.com/toeverything/BlockSuite/pull/6531 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6524 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6519 @regischen
- https://github.com/toeverything/BlockSuite/pull/6517 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6516 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6510 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6511 @congzhou09
- https://github.com/toeverything/BlockSuite/pull/6507 @doouding
- https://github.com/toeverything/BlockSuite/pull/6500 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6486 @congzhou09
- https://github.com/toeverything/BlockSuite/pull/6495 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6488 @Saul-Mirone
- https://github.com/toeverything/BlockSuite/pull/6482 @Flrande
- https://github.com/toeverything/BlockSuite/pull/6558 @fourdim

## Refactor
- https://github.com/toeverything/BlockSuite/pull/6548 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6522 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6518 @regischen
- https://github.com/toeverything/BlockSuite/pull/6521 @Saul-Mirone

## Misc
- https://github.com/toeverything/BlockSuite/pull/6557 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6546 @Flrande
- docs: update package desc
- https://github.com/toeverything/BlockSuite/pull/6527 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6505 @Brooooooklyn
- https://github.com/toeverything/BlockSuite/pull/6503 @fourdim
- v0.13.0
- https://github.com/toeverything/BlockSuite/pull/6496 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6562 @donteatfriedrice
2024-03-25 09:20:45 +00:00
JimmFly
09a27b6c25
feat(core): add remove from collection to collection page list (#6265)
close AFF-246
2024-03-25 08:31:38 +00:00
JimmFly
03c01a9693
fix(core): edit tag input autofocus (#6296)
close TOV-724
2024-03-25 08:05:25 +00:00
JimmFly
1ff6af85f5
feat(core): add page group and display properties (#6228)
close TOV-23

https://github.com/toeverything/AFFiNE/assets/102217452/c05474de-b73c-40ab-9f18-cc43bb9fd828
2024-03-25 07:53:33 +00:00
EYHN
f2adbdaba4
style: enable import-x/no-duplicates (#6279) 2024-03-25 03:55:33 +00:00
EYHN
7ce2bfbf0b
style: no import infra submodule (#6278) 2024-03-25 03:55:29 +00:00
EYHN
82cacd09d6
fix(core): fix flaky e2e (#6293) 2024-03-25 02:58:52 +00:00
EYHN
2b42a75e5a
style: enable rxjs/finnish (#6276)
chore(infra): use finnish notation for observables

do rename
2024-03-24 17:04:51 +00:00
BABA
6a02d0bc96
feat: open about page in setting modal when click about menu (#6245)
Co-authored-by: EYHN <cneyhn@gmail.com>
2024-03-23 13:27:05 +00:00
Fangdun Tsai
6c9db367e2
chore(core): add oauth connecting state (#6225) 2024-03-23 21:18:48 +08:00
fundon
7e161682f0
fix(core): creating multiple workspaces with consecutive clicks (#6259)
Closes #6213
2024-03-23 12:29:46 +00:00
pengx17
62a6075675
fix(core): do not ensure properties on read (#6263) 2024-03-23 12:15:06 +00:00
JimmFly
532d655ffb
feat(core): add confirm modal for delete tag action (#6268) 2024-03-23 12:03:14 +00:00
EYHN
34703a3b7d
feat(infra): new doc sync engine (#6205)
https://github.com/toeverything/AFFiNE/blob/eyhn/feat/new-sync/packages/common/infra/src/workspace/engine/doc/README.md
2024-03-22 16:43:26 +00:00
Brooooooklyn
622e90f176
chore(core): add telemetry switch (#6267) 2024-03-22 10:28:55 +00:00
Fangdun Tsai
69cb8b0f60
chore(core): disable onborading on the web (#6222) 2024-03-22 18:05:36 +08:00
Brooooooklyn
150c22936d
chore(core): add mixpanel track (#6202) 2024-03-22 09:24:41 +00:00
Brooooooklyn
aecc523663
fix(server): avoid error when other prices added but logic is not released (#6191) 2024-03-22 08:39:12 +00:00
EYHN
75355867c7
feat(core): save user habits in right sidebar (#6262)
Closes #6237
2024-03-22 07:32:59 +00:00
pengx17
f4ede22b93
fix(core): change cursor when hovering the area blow editor (#6226) 2024-03-21 02:00:37 +00:00
pengx17
8b2b2646bc
fix: move traffic lights based on zoom level (#6201)
<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/f75d1f6f-18f4-4dff-8174-67223f5f9807.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/f75d1f6f-18f4-4dff-8174-67223f5f9807.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/f75d1f6f-18f4-4dff-8174-67223f5f9807.mp4">Kapture 2024-03-19 at 18.05.20.mp4</video>
2024-03-21 02:00:35 +00:00
EYHN
e1cfa1071e
chore(core): align sidebar icons (#6219) 2024-03-20 17:15:13 +00:00
EYHN
e4e4a54d90
fix(core): resize-handle remains interactive when dragging split-view (#6217) 2024-03-20 16:56:17 +00:00
EYHN
08b610bbad
fix(electron): menu item position on Mac when fullscreen (#6200)
fix https://github.com/toeverything/AFFiNE/issues/6155
2024-03-20 16:45:14 +00:00
Brooooooklyn
32ab0693e2
feat(core): update split view icons and texts (#6193) 2024-03-20 14:30:35 +00:00
pengx17
a8a1074a8a
feat(electron): add isMaximized flag to html (#6199)
to make some special ui rules for desktop
2024-03-20 13:20:19 +00:00
pengx17
7adb89f134
feat(core): open new page on meta-clicking a page link (#6220) 2024-03-20 05:38:39 +00:00
Peng Xiao
fce4484a85
fix(core): tag size in docs view (#6197) 2024-03-19 08:53:08 +00:00
Peng Xiao
0695544073
fix(core): page info should use sans font (inter) (#6196) 2024-03-19 08:53:00 +00:00
JimmFly
9030ca511e
refactor(core): refactor tag to use di (#6079)
use case
```
const tagService = useService(TagService);
const tags = useLiveData(tagService.tags);
const currentTagLiveData = tagService.tagByTagId(tagId);
const currentTag = useLiveData(currentTagLiveData);

```
2024-03-19 08:39:15 +00:00
LongYinan
332cd3b380
refactor(core): split web entry from core (#6082)
This pr is trying to split `web` and `electron` entries from `core`. It allows more platform-related optimization to be addressed in each entry.
We should remove all browser/electron only codes from `core` eventually, this is the very first step for that.
2024-03-19 07:48:56 +00:00
Peng Xiao
5693d90451
e2e(core): add test for split view (#6133) 2024-03-18 07:04:06 +00:00
Peng Xiao
dc8f351051
refactor(component): render react element into lit (#6124)
See docs in https://insider.affine.pro/share/af3478a2-9c9c-4d16-864d-bffa1eb10eb6/oL1ifjA4rKv7HRn5nYzIF

This PR also enables opening split view by ctrl-click a page link in a doc.
2024-03-18 07:04:02 +00:00
Peng Xiao
e896f19f1a
fix(electron): disable mica for windows for now (#6165)
Upstream https://github.com/electron/electron/issues/41073
2024-03-18 06:52:40 +00:00
Peng Xiao
386bd033af
fix(electron): add dedicated api for opening external links in the default browser (#6166) 2024-03-18 06:41:48 +00:00
Fangdun Tsai
8301d82548
fix(core): sync list titles in sidebar (#6157) 2024-03-18 14:39:28 +08:00
Fangdun Tsai
636fa503b8
feat: support esc shortcut on input-edit (#6143) 2024-03-16 13:13:37 +00:00
Fangdun Tsai
eec24db1a1
fix: use the esc shortcut to exit in create collection dialog (#6138) 2024-03-16 19:18:06 +08:00
Chen
a24320da68
feat: bump blocksuite (#6123) 2024-03-15 16:54:24 +08:00
EYHN
78f7e3a45e
fix(core): catch page load error (#6134) 2024-03-15 08:44:36 +00:00
EYHN
9ba47f43bb
fix(core): fix active view undefined (#6131)
close https://github.com/toeverything/AFFiNE/issues/6127, #6132
2024-03-15 03:45:41 +00:00
EYHN
12c04a8575
feat(core): allow switch workspace in loading fallback (#6129) 2024-03-15 03:45:32 +00:00
EYHN
96c67afc11
fix(core): catch auth error (#6128) 2024-03-15 03:45:23 +00:00
Cats Juice
ee75b468e6
fix(core): shared page's present button not working (#6117) 2024-03-15 03:32:37 +00:00
Cats Juice
7fdb1f2d97
feat(core): adjust split view ui (#6076) 2024-03-14 06:41:29 +00:00
Peng Xiao
d2bad68b74
feat(core): move blocksuite flags to experimental features (#6113) 2024-03-14 05:24:47 +00:00
Peng Xiao
dd9a253772
feat(core): add split view to experimental features settings (#6093) 2024-03-14 05:13:04 +00:00
regischen
fddbb426a6
feat: bump blocksuite (#6078) 2024-03-13 17:04:21 +08:00
EYHN
05b79aae89
fix(core): fix tags includes missing error (#6096)
fix https://toeverything.sentry.io/issues/5059796018/events/0899e77a3f6842088568b4cc42b814d7/
2024-03-13 02:43:28 +00:00
Peng Xiao
20bce48132
fix: experimental settings sometimes not show (#6090) 2024-03-13 02:07:51 +00:00
Peng Xiao
3f27b7e5f7
fix(core): adjust suspense loading for some components (#6088)
Adjust setting & user info popover suspense to make them a little bit more responsive
2024-03-12 15:18:43 +00:00
Peng Xiao
e333b4d348
fix(core): make sidebar switch transition smooth (#6085) 2024-03-12 14:56:45 +00:00
liuyi
fb3a0e7b8f
refactor(server): auth (#5895)
Remove `next-auth` and implement our own Authorization/Authentication system from scratch.

## Server

- [x] tokens
  - [x] function
  - [x] encryption

- [x] AuthController
  - [x] /api/auth/sign-in
  - [x] /api/auth/sign-out
  - [x] /api/auth/session
  - [x] /api/auth/session (WE SUPPORT MULTI-ACCOUNT!)

- [x] OAuthPlugin
  - [x] OAuthController
  - [x] /oauth/login
  - [x] /oauth/callback
  - [x] Providers
    - [x] Google
    - [x] GitHub

## Client

- [x] useSession
- [x] cloudSignIn
- [x] cloudSignOut

## NOTE:

Tests will be adding in the future
2024-03-12 10:00:09 +00:00
regischen
5c1e904335
fix: linked doc jump (#6074) 2024-03-12 16:02:56 +08:00
Lye Hongtao
d5386bee41
fix: std might not be ready when onLoad invoked (#6075) 2024-03-12 16:02:42 +08:00
JimmFly
f832ada98c
fix(core): cannot scroll when dragging (#6070)
close TOV-671
2024-03-12 05:43:47 +00:00
EYHN
eca35ded2f
fix(core): fix page priority load (#6072)
When refactoring, I planned to put the logic of loading current pages priority in `PageManager.open`, but I forgot, so the current page will not be loaded priority.

But currently `PageManager.open` has been used in many places, but only one priority page can be set, so the logic of setting the priority page is still placed in the detail page.
2024-03-12 05:09:14 +00:00
EYHN
3672366fea
fix(core): fix missing windows controls (#6067)
fix #6064
2024-03-12 02:43:45 +00:00
Peng Xiao
716f679914
feat(electron): mica styles for windows (#5802)
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/1b59f076-fc43-42a0-899d-007aeb16a4d6.png)
2024-03-11 09:41:09 +00:00
JimmFly
b26efa4940
feat(core): add tag operation to tag list (#5998)
https://github.com/toeverything/AFFiNE/assets/102217452/11745733-0d7b-494b-97fd-33e40a240a02
2024-03-11 08:36:07 +00:00
EYHN
ba4637a6bd
fix(core): add view error boundary (#6036) 2024-03-11 07:09:47 +00:00
Peng Xiao
c93077f643
fix: divider styles issue (#6058)
Using height: 1 as divider may have some display issues on Chrome. No idea why yet.
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/42b342fb-d109-4bf7-b458-e870099710bc.png)
2024-03-11 06:04:55 +00:00
EYHN
5091174da2
fix(core): remove unexpected loading (#6035) 2024-03-09 15:01:18 +00:00
LongYinan
3aba2d220b
fix: backlinks jump (#6034)
Fix [AFF-656](https://linear.app/affine-design/issue/AFF-656/back-links-看起来都坏了)
2024-03-06 11:06:02 +00:00
JimmFly
c7dd6778ac
fix(core): disable doc info and backlinks in readonly mode (#6033)
close AFF-671

<img width="1422" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/ef80b195-3d67-4751-82d9-12973f331798">
2024-03-06 10:07:20 +00:00
EYHN
633a5bab53
fix(core): fix cmdk not show current page (#6031) 2024-03-06 06:31:38 +00:00
Fangdun Tsai
5d63ca0bab
fix(core): canvas font loading in desktop (#6025) 2024-03-06 13:42:56 +08:00
fourdim
0ff1e8d2f7 fix: breaking function signature on showImportModal onSuceessHandler (#6011)
This will fix the breaking change introduced in
da781df473
This should be merged after the next BlockSuite bump.
2024-03-05 18:51:39 +00:00
EYHN
dce3b59c52
fix(core): fix falsy e2e (#6027) 2024-03-05 15:25:19 +00:00
EYHN
5d8dea084c
fix(core): fix journal missing after refresh (#6022) 2024-03-05 11:42:09 +00:00
JimmFly
c1afdb9bd6
fix(core): unexpected line breaks (#6019) 2024-03-05 10:02:22 +00:00
Lye Hongtao
5bebcec2eb
feat: bump blocksuite (#6015)
## Features
- https://github.com/toeverything/BlockSuite/pull/6379 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6375 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6370 @donteatfriedrice

## Bugfix
- https://github.com/toeverything/BlockSuite/pull/6380 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6377 @doouding
- https://github.com/toeverything/BlockSuite/pull/6376 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6374 @regischen

## Misc
- docs: update examples desc
- ci: start publishing 0.13 canary
2024-03-05 07:35:05 +00:00
EYHN
7c76c25a9c
refactor(core): new back&forward button base on workbench (#6012)
# feature:

## In Browser:
- hidden back&forward button in sidebar.
- back and forward is equal with `window.history.back()` `window.history.forward()`

## In Desktop:
- Back and forward can be controlled through the sidebar, cmdk, and shortcut keys.
- back and forward act on the currently **active** view.
- buttons change disable&enable style based on current active view history

# Refactor:

Move app-sidebar and app-container from @affine/component to @affine/core
2024-03-05 07:01:24 +00:00
Lye Hongtao
b06aeb22dd
fix: view in edgeless button of surface block (#6013)
Co-authored-by: donteatfriedrice <huisheng.chen7788@outlook.com>
Co-authored-by: Chen <99816898+donteatfriedrice@users.noreply.github.com>
2024-03-05 14:35:53 +08:00
Chen
ebf7a74387
feat: bump blocksuite (#6010) 2024-03-05 14:19:11 +08:00
Cats Juice
358e1e99c5
feat(core): set journal's really created time (#5968)
closes #5958;

This makes the creation date of the journal correspond to the date, and the creation time is the real creation time.
2024-03-05 03:37:23 +00:00
EYHN
a9be19ce6c
fix(core): fix style break when scroll to block (#6001) 2024-03-04 11:43:10 +00:00
EYHN
d935cf9d4d
fix(core): dont break workspace when page load failed (#5988) 2024-03-04 11:32:56 +00:00
Cats Juice
2275eee5b2
feat(core): resize and reorder split-view (#5994) 2024-03-04 11:19:39 +00:00
EYHN
c599715963
feat(core): split right sidebar (#5971)
https://github.com/toeverything/AFFiNE/assets/13579374/c846c069-aa32-445d-b59b-b773a9b05ced

Now each view has a general container, the yellow area is the general container part, and the green part is the routing specific part.

![CleanShot 2024-03-01 at 11.47.35@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/g3jz87HxbjOJpXV3FPT7/9a9f6ad6-2207-42e5-ae66-f7426bc9f3fc.png)
2024-03-04 06:42:12 +00:00
Peng Xiao
e2a31ea1fc
fix(core): some ui style issues (#5995)
Increase page info toggle click area:

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/7f712008-c2db-4522-81b0-6c18d2aea421.png)

fix history modal page height
2024-03-04 03:57:45 +00:00
Peng Xiao
a1ea19fcb7
fix: optimize history animation (#5973)
- adjust timing
- make sure card do not show the bottom border on transitioning

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/7a225ec1-eb33-45ab-bf27-646bb2519a83.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/7a225ec1-eb33-45ab-bf27-646bb2519a83.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/7a225ec1-eb33-45ab-bf27-646bb2519a83.mp4">Kapture 2024-03-01 at 10.56.09.mp4</video>
2024-03-01 06:08:08 +00:00
JimmFly
ff7e7f237f
fix(core): update src in video tag to correct URL (#5974)
In app.affine.pro the video is not displayed correctly.

<img width="1026" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/8e9d9bb2-f973-433e-88c9-bedfe0f55935">
2024-03-01 04:36:37 +00:00
EYHN
a231884d9e
fix(storybook): fix storybook test (#5970) 2024-03-01 02:30:04 +00:00
Peng Xiao
d4e78dd3d0
feat: add animation for history preview (#5966)
<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/5ce45d13-1117-4853-a066-e8ab1446eb4f.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/5ce45d13-1117-4853-a066-e8ab1446eb4f.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/5ce45d13-1117-4853-a066-e8ab1446eb4f.mp4">Kapture 2024-02-29 at 18.54.15.mp4</video>
2024-02-29 14:08:21 +00:00
EYHN
78ce30db69
fix(core): fix editor sidebar (#5965) 2024-02-29 13:59:20 +00:00
regischen
d1e6b23e1a
feat: bump blocksuite (#5953) 2024-02-29 14:33:50 +08:00
DarkSky
3432f355b0
feat: backend module awareness & optional request (#5909) 2024-02-28 08:29:37 +00:00
Peng Xiao
35454c3bfc
fix(core): polyfill resize-observer for development to avoid error overlay (#5943)
Brought a temporary solution from https://github.com/petyosi/react-virtuoso/issues/875#issuecomment-1962897033
2024-02-28 08:18:33 +00:00
Peng Xiao
27f2209e87
fix(core): date formatter timezone issue (#5936)
date seems not hornoring the locale browser's locale when parsing date string like "2024-02-28".
fixed by using dayjs instead.

Fix incorrect journal title issue
2024-02-28 04:27:32 +00:00
LongYinan
9e09166452
build: fix selfhost config (#5930) 2024-02-28 04:17:29 +00:00
Peng Xiao
a0364dd4ea
fix(core): minor page info style issues (#5935) 2024-02-28 03:45:51 +00:00
Peng Xiao
148807879b
refactor(component): use react-transition-state to simplify exit animation (#5923)
## **User description**
use react-transition-state to simplify exit animation

___

## **Type**
enhancement

___

## **Description**
- Integrated `react-transition-state` for managing animations in `ResizePanel` and `CMDKModal` components, simplifying the code and improving maintainability.
- Introduced a shared animation timeout variable to standardize animation durations across components.
- Added `react-transition-state` to dependencies to enable the new animation handling.

___

## **Changes walkthrough**
<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>resize-panel.tsx</strong><dd><code>Integrate `react-transition-state` for Resize Panel Animations</code></dd></summary>
<hr>

packages/frontend/component/src/components/resize-panel/resize-panel.tsx

<li>Introduced <code>useTransition</code> hook from <code>react-transition-state</code> for managing <br>animations.<br> <li> Added a constant for animation timeout and applied it to the <br>transition.<br> <li> Utilized the transition state to toggle the open state of the resize <br>panel.<br>

</details>

  </td>
  <td><a href="https:/toeverything/AFFiNE/pull/5923/files#diff-a4d6e633862f63f97c167ff41ba62aff8aebf3e3b2f6e7ce13d5a0e22e8ff287">+12/-0</a>&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
      <summary><strong>modal.css.ts</strong><dd><code>Use Variable for Animation Timeout in Modal CSS</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

packages/frontend/core/src/components/pure/cmdk/modal.css.ts

<li>Created a variable for animation timeout.<br> <li> Updated animation durations to use the new timeout variable.<br>

</details>

  </td>
  <td><a href="https:/toeverything/AFFiNE/pull/5923/files#diff-ba8935611b9c1695153d92d08ecb0f7dac73a6197f54ccda5a6e791902cd651d">+6/-3</a>&nbsp; &nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
      <summary><strong>modal.tsx</strong><dd><code>Simplify CMDK Modal Animation with `react-transition-state`</code></dd></summary>
<hr>

packages/frontend/core/src/components/pure/cmdk/modal.tsx

<li>Replaced custom animation state management with <code>useTransition</code> hook.<br> <li> Removed old animation state logic and simplified the component.<br> <li> Added animation timeout variable and applied it to the transition.<br>

</details>

  </td>
  <td><a href="https:/toeverything/AFFiNE/pull/5923/files#diff-ab3fe66c9b1d3a691fafd1aebc9988e840fedfcd09b5b89570838a5a2a9469c9">+13/-33</a>&nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Dependencies</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>package.json</strong><dd><code>Add `react-transition-state` Dependency</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

packages/frontend/core/package.json

- Added `react-transition-state` as a dependency.

</details>

  </td>
  <td><a href="https:/toeverything/AFFiNE/pull/5923/files#diff-23e0e5dc0ceb004a0a5d3d13e7d00545de7487535ca0e5eab4c5047f1e24eff0">+1/-0</a>&nbsp; &nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

>  **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions
2024-02-27 14:55:33 +00:00
EYHN
606397e319
feat(core): workbench system (#5837) 2024-02-27 04:14:07 +00:00
EYHN
5cd488fe1d
refactor(core): remove collection atom (#5832) 2024-02-27 03:50:56 +00:00
EYHN
ad9b0303c4
refactor(core): refactor atom to use di (#5831)
To support multiple instances, this PR removes some atoms and implements them using the new DI system.

removed atom

- `pageSettingsAtom`
- `currentPageIdAtom`
- `currentModeAtom`
2024-02-27 03:50:53 +00:00
Peng Xiao
2295685590
fix: page info styles (#5910)
fix inconsistent styles compared to the one defined in figma
fix https://github.com/toeverything/AFFiNE/issues/5904
fix https://github.com/toeverything/AFFiNE/issues/5903
2024-02-26 14:11:24 +00:00
Peng Xiao
298afc7d74
feat(core): enable right sidepanel animation (#5902) 2024-02-26 09:04:04 +00:00
JimmFly
0be62d892d
refactor(core): use custom scrollbar for editor and adjust shared page style (#5752)
Close TOV-481
- Use a custom scrollbar component for editor
- Modified the header of the share page and added a new footer
2024-02-26 08:54:52 +00:00
JimmFly
e9f9eea80c
fix(core): handling error message when sending verify change email (#5894) 2024-02-26 08:32:48 +00:00
LongYinan
ae41c6c544
chore: bump all dependencies (#5891) 2024-02-23 09:37:14 +00:00
JimmFly
815ddd3778
chore: replace pricing plan link (#5886)
close TOV-609
2024-02-23 08:28:24 +00:00
Whitewater
9692a120a0
chore: filter out edgeless content from page preview (#5607)
Co-authored-by: EYHN <cneyhn@gmail.com>
2024-02-23 08:16:26 +00:00
Whitewater
228b0d789d
feat: add shared page filter to all pages (#5540)
Co-authored-by: EYHN <cneyhn@gmail.com>
2024-02-23 16:07:13 +08:00
Peng Xiao
745110c799
fix: page info ui issue on journal page (#5887) 2024-02-23 07:55:44 +00:00
EYHN
3f7f78c8f4
fix(core): fix app boot speed (#5885) 2024-02-23 07:07:03 +00:00
Peng Xiao
7ec3f7a042
feat(core): add shortcut for openning settings (#5883)
fix https://github.com/toeverything/AFFiNE/issues/5881
2024-02-23 06:29:49 +00:00
Peng Xiao
bef72029a0
fix: keyboard shortcut style in cmdk (#5882)
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/7eb2fa93-675a-43a6-8db4-9681fbbd1406.png)
2024-02-23 06:29:46 +00:00
JimmFly
4ea4a2d25f
feat(core): support create cloud workspace (#5771)
close TOV-475

has not logged:

https://github.com/toeverything/AFFiNE/assets/102217452/b9aa2806-7dbd-4235-895d-5b27effb5831

 has logged :

https://github.com/toeverything/AFFiNE/assets/102217452/259a1c35-c6ab-4a52-9e03-4438ca64e620

client has not logged:

https://github.com/toeverything/AFFiNE/assets/102217452/af6ef528-6fb8-4a27-842f-00c9669afcb2
2024-02-23 06:18:25 +00:00
LongYinan
c88998678e
feat: add paragraph when clicking end area (#5869)
Close [TOV-442](https://linear.app/affine-design/issue/TOV-442/结尾是非编辑yuan素时,无法在最底部添加block)
2024-02-22 09:54:17 +00:00
Peng Xiao
2df8f29b64
refactor(core): use fractional indexing for sorting (#5809)
use https://github.com/rocicorp/fractional-indexing to enable better sorting logic for crdt app
2024-02-22 09:38:00 +00:00
Peng Xiao
372b4da884
test(core): add tests for page info ui (#5769)
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/64419f79-46e8-4171-b853-5908841f827a.png)
2024-02-22 09:37:55 +00:00
Peng Xiao
bb8e601f82
feat(core): tags inline editor (#5748)
tags inline editor and some refactor

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/439da1e3-30a9-462a-b7b4-c8e7c3b5ef17.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/439da1e3-30a9-462a-b7b4-c8e7c3b5ef17.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/439da1e3-30a9-462a-b7b4-c8e7c3b5ef17.mp4">Kapture 2024-01-31 at 23.29.11.mp4</video>

fix AFF-467
fix AFF-468
fix AFF-472
fix AFF-466
2024-02-22 09:37:50 +00:00
Peng Xiao
546d96c5c9
feat(core): workspace properties setting (#5739)
the property settings in workspace settings
2024-02-22 09:37:46 +00:00
LongYinan
35842ae1c5
fix(core): fix 404 after signout (#5866)
CherryPick https://github.com/toeverything/AFFiNE/pull/5865
2024-02-22 08:30:41 +00:00
Cats Juice
390fb90a8b
feat(core): ignore empty journal for global useBlockSuitePageMeta hook (#5715)
[TOV-494](https://linear.app/affine-design/issue/TOV-494/空-journal-的隐藏处理)
2024-02-22 08:09:33 +00:00
EYHN
0fff5588e6
fix(core): disable sidebar user select (#5862)
close #5846
2024-02-22 07:58:14 +00:00
Umar Faiz
f2c5786dd0
fix(core): the pitch zooming function incorrectly zooms the toolbar (#5456)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-02-22 15:04:33 +08:00
Peng Xiao
58ea2fbc4c
fix(core): editor container grow to full height (#5743) 2024-02-22 06:20:40 +00:00
Peng Xiao
a120eb90ab
fix(core): journal display on cmdk (#5723)
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/01d2c2ec-cfdd-4c90-9616-606e4a473cc0.png)
2024-02-22 06:09:18 +00:00
Peng Xiao
d97304e9eb
feat(core): page info ui (#5729)
this PR includes the main table view in the page detail page
2024-02-22 05:58:15 +00:00
Ayush Agrawal
a01f0d86a5
fix: css style should not apply on nested editor's viewport (#5859) 2024-02-22 10:46:16 +08:00
JimmFly
c353b0d30f
chore: replace ambiguous "page" with "doc" (#5761)
close TOV-532
2024-02-21 12:47:17 +00:00
liuyi
85be45a79c
fix(core): window.open to a new origin will be blocked by browser (#5856) 2024-02-21 12:35:25 +00:00
Ayush Agrawal
11b3184537
feat: blocksuite integration for pageMode & pageUpdatedAt (#5849)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-02-21 15:03:02 +08:00
Lye Hongtao
4641bc422b
feat: move templates into AFFiNE (#5750)
Related to https://github.com/toeverything/blocksuite/pull/6156

### Change
Move the edgeless templates to AFFiNE. All templates are stored as zip files. Run `node build-edgeless.mjs` in `@affine/templates` to generate JSON-format templates and importing script. The template will be generated automatically during building and dev (`yarn dev`).
2024-02-21 06:26:01 +00:00
Cats Juice
3fe9d834de
feat(core): replace page filter, journal's date-picker with new one (#5675) 2024-02-20 13:53:41 +00:00
JimmFly
876b85304e
feat(core): add loading to quick search modal (#5785)
close AFF-285

add `useSyncEngineStatus` hooks
add loading style

<img width="977" alt="test1" src="https://github.com/toeverything/AFFiNE/assets/102217452/e8bf6714-e42b-4adf-a279-341ef5f5cfc0">
2024-02-20 13:05:22 +00:00
JimmFly
3792506b09
feat(core): add history tips modal (#5733)
close TOV-459 TOV-503

https://github.com/toeverything/AFFiNE/assets/102217452/9cbfaf35-bc7b-4275-94be-6e777447ef11
2024-02-20 12:50:55 +00:00
JimmFly
4068e7aeff
feat(core): add starAFFiNE and issueFeedback modal (#5718)
close TOV-482

https://github.com/toeverything/AFFiNE/assets/102217452/da1f74bc-4b8d-4d7f-987d-f53da98d92fe
2024-02-20 12:50:51 +00:00
Ayush Agrawal
6fad241350
feat: bump blocksuite (#5845) 2024-02-20 20:49:41 +08:00
JimmFly
a554c8aabe
fix(core): match page preview and page title in page list (#5840)
close TOV-578
2024-02-20 09:27:23 +00:00
Adithyan
afe59a864d
feat: Duplicate page in page list and clone naming improvements (#5818) 2024-02-20 16:44:25 +08:00
Muhammad Arsil
1eb317d8fa
fix: cards overlapping issue (#5727)
Co-authored-by: EYHN <cneyhn@gmail.com>
2024-02-20 16:27:43 +08:00
Whitewater
1ceaf87a86
chore: skip sync when offline (#5786) 2024-02-19 10:22:22 +08:00
Peng Xiao
d1c4e6141a
refactor(component): cmdk ordering (#5722)
Replace internal CMDK command filtering/sorting logic.
The new implementation includes the following for command scoring:
- categories weights
- highlighted fragments
- original command score value

The new logic should be much cleaner and remove some hacks in the original implementation.

Not sure if this is optimal yet. Could be changed later.

fix https://github.com/toeverything/AFFiNE/issues/5699
2024-02-16 13:20:24 +00:00
Flrande
2e3ffeced9
feat: bump blocksuite (#5812) 2024-02-08 08:18:03 +08:00
Peng Xiao
005c02f148
fix(core): flaky tests (#5804) 2024-02-06 03:20:54 +00:00
DarkSky
25e8a2a22f
feat: sync client versioning (#5645)
after this pr, server will only accept client that have some major version
the client version <0.12 will be rejected by the server, >= 0.12 can receive outdated messages and notify users
2024-02-05 08:43:50 +00:00
LongYinan
51680da33b
fix(core): prevent data loss (hot-fix) (#5798) (#5800) 2024-02-05 03:53:32 +00:00
LongYinan
899528dcfd
fix(core): load fonts from selfhost url (#5789) 2024-02-02 14:41:06 +00:00
liuyi
bef266ae3b
refactor(server): reorganize server configs (#5753) 2024-02-02 08:32:07 +00:00
LongYinan
8f4b4e20ab
fix(core): typecheck after jotai upgraded (#5779) 2024-02-01 16:10:14 +00:00
Peng Xiao
7d951a975f
fix(core): replace most --affine with cssVar (#5728)
using a [babel plugin](https://gist.github.com/pengx17/49e24ae8a5a609bdaff122ee8c679d1c) to transform all var(--affine-xxx) to cssVar

Some issues:
- tried ast-grep but it seems to be not easy to add imports conditionally
- current work does not work well with ts with types because babel will strip them out
2024-02-01 09:33:11 +00:00
Joooye_34
338c3001b0
feat: support sign-in with subscription coupon (#5768) 2024-02-01 08:43:47 +00:00
liuyi
26db1d436d
refactor(server): server errors (#5741)
standardize the error raising in both GraphQL Resolvers and Controllers.

Now, All user aware errors should be throwed with `HttpException`'s variants, for example `NotFoundException`.

> Directly throwing `GraphQLError` are forbidden.
The GraphQL errorFormatter will handle it automatically and set `code`, `status` in error extensions.

At the same time, the frontend `GraphQLError` should be imported from `@affine/graphql`, which introduce a better error extensions type.

----
controller example:
```js
@Get('/docs/${id}')
doc() {
  // ...
  // imported from '@nestjs/common'
  throw new NotFoundException('Doc is not found.');
  // ...
}
```
the above will response as:
```
status: 404 Not Found
{
  "message": "Doc is not found.",
  "statusCode": 404,
  "error": "Not Found"
}
```

resolver example:
```js
@Mutation()
invite() {
  // ...
  throw new PayloadTooLargeException('Workspace seats is full.')
  // ...
}
```

the above will response as:
```
status: 200 Ok
{
  "data": null,
  "errors": [
    {
      "message": "Workspace seats is full.",
      "extensions": {
        "code": 404,
        "status": "Not Found"
      }
    }
  ]
}
```

for frontend GraphQLError user-friend, a helper function introduced:

```js
import { findGraphQLError } from '@affine/graphql'

fetch(query)
  .catch(errOrArr => {
    const e = findGraphQLError(errOrArr, e => e.extensions.code === 404)
    if (e) {
      // handle
    }
})
```
2024-01-31 08:43:03 +00:00
Cats Juice
5f3c04b51e
fix(core): set createDate to journal's date when journal created (#5701) 2024-01-30 23:11:07 +08:00
Cats Juice
6b350b1735
feat(core): append to today's joruanl via CMDK (#5692) 2024-01-30 23:08:25 +08:00
EYHN
329fc19852
refactor(infra): migrate to new infra (#5565) 2024-01-30 07:16:39 +00:00
DarkSky
070d5ca471
feat: impl unlimited features (#5659) 2024-01-26 08:28:54 +00:00
Yifeng Wang
04b9029d1b
feat: bump blocksuite (#5720)
Co-authored-by: xiaoxin <hongtao.lye@toeverything.info>
2024-01-26 16:27:58 +08:00
Cats Juice
387e292ed9
fix(core): journal title's day tag may be invalid (#5703)
Fix [TOV-470](https://linear.app/affine-design/issue/TOV-470/journal-invalid-date)
2024-01-26 07:55:35 +00:00
JimmFly
18068f4ae2
feat(core): add collection and tag filters to all pages (#5567)
close TOV-69

Added the `filterMode` parameter to the `/all` route.
Abstracted the `PageList` and associated components into more universal ones.
Added the `useTagMetas` hook to get and update  the workspace tags.

https://github.com/toeverything/AFFiNE/assets/102217452/7595944d-a056-40c2-8d89-d8df9e901a4b
2024-01-26 07:42:47 +00:00
Peng Xiao
b867dcbdeb
fix: add padding between editor and link panel (#5713)
Fix [AFF-561](https://linear.app/affine-design/issue/AFF-561/bi-directional-link-与文本编辑区域的-top-padding)
2024-01-26 07:32:22 +00:00
Peng Xiao
e8a6b6ad5e
fix(core): bidi links rendering issue (#5707) 2024-01-26 06:07:04 +00:00
Cats Juice
e7307d969c
chore(core): remove journal experimental flag (#5698) 2024-01-25 05:33:57 +00:00
Cats Juice
9aa421d5e1
fix(core): modify journal page title today style, add weekday tag (#5687)
fix [TOV-434](https://linear.app/affine-design/issue/TOV-434/修改-journal-中-「today」的字体大小和日期-title-大小)

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://github.com/toeverything/AFFiNE/assets/39363750/ac0ab085-5ff7-4d27-a0b1-11d97fdd8074">
  <img width="100%" alt="" src="https://github.com/toeverything/AFFiNE/assets/39363750/3b311130-ded2-4651-badd-65dd059b7bc5">
</picture>
2024-01-24 13:07:20 +00:00
Cats Juice
3f96b9778f
fix(core): change journal header week-date-picker's max-width (#5688)
Fix [TOV-444](https://linear.app/affine-design/issue/TOV-444/修改-journal-date-picker-max-width)
2024-01-24 12:54:34 +00:00
JimmFly
ad1521fd81
feat(core): adjust member order (#5685)
close #5686

`Owner >> Unaccepted > Admin > Write > Read`

This algorithm contains two parts: firstly, it calculates the weight of the Member (calculateWeight), and then, it uses set weights to sort the Members (useMembers).

In the calculateWeight part, the computation of the weight involves three primary factors:

1. **Permission Level**: The `Owner` is given the highest weight of `4`, followed by `Admin` with a weight of `3`, then `Write` with a weight of `2`, and finally, `Read`, with a weight of `1`.
2. **Acceptance Status**: `Unaccepted` members have a higher weight, this weight is `1`.
3. The weight corresponding to the permission level, if the member does not exist, this weight is 0.

These three `factors` are stored in the factors array and then processed through the reduce function for weighted sum calculation. Among them, `factor * Math.pow(10, arr.length - 1 - index)` means the more significant weight factors (i.e., the earlier factors) will be assigned a higher value.

Sorting rules are primarily based on the weight values obtained from the calculateWeight function. If the weights are identical, it then sorts by name, here assuming the weight of the name being `null` is the highest. If the names are not `null`, they are sorted alphabetically.
2024-01-24 12:44:01 +00:00
JimmFly
25897dc404
feat(workspace): add blob and storage limit (#5535)
close TOV-343 AFF-508 TOV-461 TOV-460 TOV-419

Add `isOverCapacity ` status to detect if blob usage exceeds limits.
Add `onCapacityChange` and `onBlobSet` to monitor if the storage or blob exceeds the capacity limit.
Global modals `LocalQuotaModal` and `CloudQuotaModal` have been added, with the upload size of the blob being limited within the modal components.
The notification component has been adjusted, now you can pass in `action` click events and `actionLabel` .
2024-01-24 07:34:51 +00:00
Chen
c566952e09
feat: bump blocksuite (#5673) 2024-01-24 15:13:12 +08:00
Peng Xiao
a687e7c0ed
fix(core): workspace feature should be workspace specific (#5677)
fix TOV-429
2024-01-24 03:07:51 +00:00
Peng Xiao
c2a978f0f2
fix: create page button offset issue on non-windows desktop app (#5669)
fix TOV-428
2024-01-24 02:56:04 +00:00
Peng Xiao
f62b67de61
fix(core): should set lang when locale changes (#5679)
this + https://github.com/toeverything/design/pull/110 should fix #5591

fix TOV-457

Reason: HTML requires `lang` to be set to render the correct CJK glyphs.

https://heistak.github.io/your-code-displays-japanese-wrong

<img width="692" alt="image" src="https://github.com/toeverything/AFFiNE/assets/584378/1d350219-5157-42cb-8e98-76d92d55b41e">
2024-01-24 02:43:22 +00:00
DarkSky
8bbe2e3bb1
feat: use custom image/preview link (#5584)
dep toeverything/blocksuite#5969
2024-01-23 08:53:57 +00:00
Cats Juice
8300df4a26
fix(core): correct typo in onboarding 'get start' (#5666) 2024-01-23 04:54:22 +00:00
Peng Xiao
ecdb5b3407
fix(core): properties adapter reactivitiy issue (#5661) 2024-01-23 01:41:44 +00:00
Peng Xiao
0ed26f51af
feat(core): adopt editor features for journal (#5638) 2024-01-22 08:25:31 +00:00