chore: assign todos (#7297)

This commit is contained in:
forehalo
2024-06-21 07:54:14 +00:00
parent e085b927f6
commit 7b3673ae82
121 changed files with 137 additions and 157 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ export async function createApp() {
app.use( app.use(
graphqlUploadExpress({ graphqlUploadExpress({
// TODO: dynamic limit by quota // TODO(@darksky): dynamic limit by quota maybe?
maxFileSize: 100 * 1024 * 1024, maxFileSize: 100 * 1024 * 1024,
maxFiles: 5, maxFiles: 5,
}) })
@@ -202,7 +202,7 @@ export class AuthController {
@Public() @Public()
@Get('/challenge') @Get('/challenge')
async challenge() { async challenge() {
// TODO: impl in following PR // TODO(@darksky): impl in following PR
return { return {
challenge: randomUUID(), challenge: randomUUID(),
resource: randomUUID(), resource: randomUUID(),
@@ -41,7 +41,6 @@ export class QuotaManagementService {
}; };
} }
// TODO: lazy calc, need to be optimized with cache
async getUserUsage(userId: string) { async getUserUsage(userId: string) {
const workspaces = await this.permissions.getOwnedWorkspaces(userId); const workspaces = await this.permissions.getOwnedWorkspaces(userId);
@@ -55,7 +55,7 @@ export class UserResolver {
): Promise<typeof UserOrLimitedUser | null> { ): Promise<typeof UserOrLimitedUser | null> {
validators.assertValidEmail(email); validators.assertValidEmail(email);
// TODO: need to limit a user can only get another user witch is in the same workspace // TODO(@forehalo): need to limit a user can only get another user witch is in the same workspace
const user = await this.users.findUserWithHashedPasswordByEmail(email); const user = await this.users.findUserWithHashedPasswordByEmail(email);
// return empty response when user not exists // return empty response when user not exists
@@ -20,6 +20,6 @@ export class UserFeaturesInit1698652531198 {
// revert the migration // revert the migration
static async down(_db: PrismaClient) { static async down(_db: PrismaClient) {
// TODO: revert the migration // noop
} }
} }
@@ -44,7 +44,6 @@ export class MailService {
}; };
} }
) { ) {
// TODO: use callback url when need support desktop app
const buttonUrl = this.url.link(`/invite/${inviteId}`); const buttonUrl = this.url.link(`/invite/${inviteId}`);
const workspaceAvatar = invitationInfo.workspace.avatar; const workspaceAvatar = invitationInfo.workspace.avatar;
@@ -47,7 +47,7 @@ export class CopilotWorkflowService {
return workflow; return workflow;
} }
// todo: get workflow from database // TODO(@darksky): get workflow from database
private async getWorkflow(graphName: string): Promise<WorkflowGraph> { private async getWorkflow(graphName: string): Promise<WorkflowGraph> {
const graph = WorkflowGraphs.find(g => g.name === graphName); const graph = WorkflowGraphs.find(g => g.name === graphName);
if (!graph) { if (!graph) {
@@ -74,7 +74,7 @@ export class WorkflowNode {
private async evaluateCondition( private async evaluateCondition(
_condition?: string _condition?: string
): Promise<string | undefined> { ): Promise<string | undefined> {
// todo: evaluate condition to impl decision block // TODO(@darksky): evaluate condition to impl decision block
return this.edges[0]?.id; return this.edges[0]?.id;
} }
@@ -62,7 +62,7 @@ export class S3StorageProvider implements StorageProvider {
// metadata // metadata
ContentType: metadata.contentType, ContentType: metadata.contentType,
ContentLength: metadata.contentLength, ContentLength: metadata.contentLength,
// TODO: Cloudflare doesn't support CRC32, use md5 instead later. // TODO(@forehalo): Cloudflare doesn't support CRC32, use md5 instead later.
// ChecksumCRC32: metadata.checksumCRC32, // ChecksumCRC32: metadata.checksumCRC32,
}) })
); );
@@ -68,7 +68,7 @@ class Storage<T extends object> {
} }
} else { } else {
const fullConfig = this.get(); const fullConfig = this.get();
// TODO: handle key not found, set default value // TODO(@catsjuice): handle key not found, set default value
// if (!(key in fullConfig)) {} // if (!(key in fullConfig)) {}
return fullConfig[key]; return fullConfig[key];
} }
+1 -1
View File
@@ -90,7 +90,7 @@ export function setupEditorFlags(docCollection: DocCollection) {
}); });
// override this flag in app settings // override this flag in app settings
// TODO: need a better way to manage block suite flags // TODO(@eyhn): need a better way to manage block suite flags
docCollection.awarenessStore.setFlag('enable_synced_doc_block', true); docCollection.awarenessStore.setFlag('enable_synced_doc_block', true);
} catch (err) { } catch (err) {
logger.error('syncEditorFlags', err); logger.error('syncEditorFlags', err);
@@ -53,7 +53,6 @@ export function checkWorkspaceCompatibility(
return MigrationPoint.BlockVersion; return MigrationPoint.BlockVersion;
} }
// TODO: Catch compatibility error from blocksuite to show upgrade page.
// Temporarily follow the check logic of blocksuite. // Temporarily follow the check logic of blocksuite.
if ((docCollection.meta.docs?.length ?? 0) <= 1) { if ((docCollection.meta.docs?.length ?? 0) <= 1) {
try { try {
@@ -65,7 +65,6 @@ export const InviteModal = ({
}} }}
onConfirm={handleConfirm} onConfirm={handleConfirm}
> >
{/*TODO: check email & add placeholder*/}
<AuthInput <AuthInput
disabled={isMutating} disabled={isMutating}
placeholder="email@example.com" placeholder="email@example.com"
+1 -1
View File
@@ -1,4 +1,4 @@
// TODO: Check `input` , `loading`, not migrated from `design` // TODO(@catsjuice): Check `input` , `loading`, not migrated from `design`
export * from './lit-react'; export * from './lit-react';
export * from './styles'; export * from './styles';
export * from './ui/avatar'; export * from './ui/avatar';
@@ -14,7 +14,7 @@ const listeners: Set<PortalListener> = new Set();
export function createLitPortalAnchor(callback: (event: PortalEvent) => void) { export function createLitPortalAnchor(callback: (event: PortalEvent) => void) {
const id = nanoid(); const id = nanoid();
// todo: clean up listeners? // todo(@Peng): clean up listeners?
listeners.add(event => { listeners.add(event => {
if (event.target.portalId !== id) { if (event.target.portalId !== id) {
return; return;
@@ -48,7 +48,7 @@ export const inputStyle = style({
}); });
export const popperStyle = style({ export const popperStyle = style({
boxShadow: cssVar('shadow2'), boxShadow: cssVar('shadow2'),
// TODO: for menu offset, need to be optimized // TODO(@catsjuice): for menu offset, need to be optimized
marginTop: '16px', marginTop: '16px',
background: cssVar('backgroundOverlayPanelColor'), background: cssVar('backgroundOverlayPanelColor'),
borderRadius: '12px', borderRadius: '12px',
@@ -29,7 +29,7 @@ export interface WeekDatePickerProps
handleRef?: ForwardedRef<WeekDatePickerHandle>; handleRef?: ForwardedRef<WeekDatePickerHandle>;
} }
// TODO: i18n // TODO(catsjuice): i18n
const weekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; const weekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
// const weekDays = ['日', '一', '二', '三', '四', '五', '六']; // const weekDays = ['日', '一', '二', '三', '四', '五', '六'];
const format = 'YYYY-MM-DD'; const format = 'YYYY-MM-DD';
@@ -113,15 +113,4 @@ export const FlexWrapper = styled(Wrapper, {
}; };
}); });
// TODO: Complete me
export const GridWrapper = styled(Wrapper, {
shouldForwardProp: prop => {
return ![''].includes(prop as string);
},
})<WrapperProps>(() => {
return {
display: 'grid',
};
});
export default Wrapper; export default Wrapper;
@@ -132,7 +132,7 @@ export const menuTrigger = style({
color: cssVar('textDisableColor'), color: cssVar('textDisableColor'),
pointerEvents: 'none', pointerEvents: 'none',
}, },
// TODO: wait for design // TODO(@catsjuice): wait for design
'&.error': { '&.error': {
// borderColor: 'var(--affine-error-color)', // borderColor: 'var(--affine-error-color)',
}, },
@@ -142,7 +142,7 @@ export const ConfirmModalProvider = ({ children }: PropsWithChildren) => {
value={{ openConfirmModal, closeConfirmModal, modalProps }} value={{ openConfirmModal, closeConfirmModal, modalProps }}
> >
{children} {children}
{/* TODO: multi-instance support(unnecessary for now) */} {/* TODO(@catsjuice): multi-instance support(unnecessary for now) */}
<ConfirmModal {...modalProps} onOpenChange={onOpenChange} /> <ConfirmModal {...modalProps} onOpenChange={onOpenChange} />
</ConfirmModalContext.Provider> </ConfirmModalContext.Provider>
); );
@@ -108,7 +108,7 @@ export function actionToStream<T extends keyof BlockSuitePresets.AIActions>(
docId: host.doc.id, docId: host.doc.id,
workspaceId: host.doc.collection.id, workspaceId: host.doc.collection.id,
} as Parameters<typeof action>[0]; } as Parameters<typeof action>[0];
// @ts-expect-error todo: maybe fix this // @ts-expect-error TODO(@Peng): maybe fix this
stream = action(options); stream = action(options);
if (!stream) return; if (!stream) return;
yield* stream; yield* stream;
@@ -223,7 +223,7 @@ function actionToStream<T extends keyof BlockSuitePresets.AIActions>(
Object.assign(options, data); Object.assign(options, data);
} }
// @ts-expect-error todo: maybe fix this // @ts-expect-error TODO(@Peng): maybe fix this
stream = action(options); stream = action(options);
if (!stream) return; if (!stream) return;
yield* stream; yield* stream;
@@ -253,7 +253,7 @@ function actionToStream<T extends keyof BlockSuitePresets.AIActions>(
workspaceId: host.doc.collection.id, workspaceId: host.doc.collection.id,
} as Parameters<typeof action>[0]; } as Parameters<typeof action>[0];
// @ts-expect-error todo: maybe fix this // @ts-expect-error TODO(@Peng): maybe fix this
stream = action(options); stream = action(options);
if (!stream) return; if (!stream) return;
yield* stream; yield* stream;
@@ -215,7 +215,7 @@ declare global {
): AIActionTextResponse<T>; ): AIActionTextResponse<T>;
} }
// todo: should be refactored to get rid of implement details (like messages, action, role, etc.) // TODO(@Peng): should be refactored to get rid of implement details (like messages, action, role, etc.)
interface AIHistory { interface AIHistory {
sessionId: string; sessionId: string;
tokens: number; tokens: number;
@@ -32,7 +32,7 @@ export type ActionEventType =
* To use it, downstream (affine) has to provide AI actions implementation, * To use it, downstream (affine) has to provide AI actions implementation,
* user info etc * user info etc
* *
* todo: breakdown into different parts? * TODO: breakdown into different parts?
*/ */
export class AIProvider { export class AIProvider {
static get slots() { static get slots() {
@@ -124,7 +124,7 @@ export class AIProvider {
console.warn(`AI action ${id} is already provided`); console.warn(`AI action ${id} is already provided`);
} }
// @ts-expect-error todo: maybe fix this // @ts-expect-error TODO: maybe fix this
this.actions[id] = ( this.actions[id] = (
...args: Parameters<BlockSuitePresets.AIActions[T]> ...args: Parameters<BlockSuitePresets.AIActions[T]>
) => { ) => {
@@ -24,7 +24,7 @@ export function registerAffineUpdatesCommands({
preconditionStrategy: () => !!store.get(updateReadyAtom), preconditionStrategy: () => !!store.get(updateReadyAtom),
run() { run() {
apis?.updater.quitAndInstall().catch(err => { apis?.updater.quitAndInstall().catch(err => {
// TODO: add error toast here // TODO(@JimmFly): add error toast here
console.error(err); console.error(err);
}); });
}, },
@@ -1,6 +1,6 @@
import type { ReactNode } from 'react'; import type { ReactNode } from 'react';
// TODO: need better way for composing different precondition strategies // TODO(@Peng): need better way for composing different precondition strategies
export enum PreconditionStrategy { export enum PreconditionStrategy {
Always, Always,
InPaperOrEdgeless, InPaperOrEdgeless,
@@ -52,11 +52,11 @@ export interface AffineCommandOptions {
title: string; title: string;
subTitle?: string; subTitle?: string;
}); });
icon: ReactNode; // todo: need a mapping from string -> React element/SVG icon: ReactNode; // TODO(@JimmFly): need a mapping from string -> React element/SVG
category?: CommandCategory; category?: CommandCategory;
// we use https://github.com/jamiebuilds/tinykeys so that we can use the same keybinding definition // we use https://github.com/jamiebuilds/tinykeys so that we can use the same keybinding definition
// for both mac and windows // for both mac and windows
// todo: render keybinding in command palette // TODO(@Peng): render keybinding in command palette
keyBinding?: KeybindingOptions | string; keyBinding?: KeybindingOptions | string;
run: () => void | Promise<void>; run: () => void | Promise<void>;
} }
@@ -19,7 +19,7 @@ export const renderInput = (
<Input type="number" value={value} onChange={onChange} /> <Input type="number" value={value} onChange={onChange} />
</div> </div>
); );
//TODO: add more types // TODO(@JimmFly): add more types
default: default:
return null; return null;
} }
@@ -30,21 +30,21 @@ const imageMap = new Map([
[ [
ErrorStatus.NotFound, ErrorStatus.NotFound,
{ {
light: imageUrlFor404, // TODO: Ask designer for dark/light mode image. light: imageUrlFor404, // TODO(@catsjuice): Ask designer for dark/light mode image.
dark: imageUrlFor404, dark: imageUrlFor404,
}, },
], ],
[ [
ErrorStatus.Unexpected, ErrorStatus.Unexpected,
{ {
light: imageUrlForLight500, // TODO: Split assets lib and use image hook to handle light and dark. light: imageUrlForLight500, // TODO(@catsjuice): Split assets lib and use image hook to handle light and dark.
dark: imageUrlForDark500, dark: imageUrlForDark500,
}, },
], ],
]); ]);
/** /**
* TODO: Unify with NotFoundPage. * TODO(@eyhn): Unify with NotFoundPage.
*/ */
export const ErrorDetail: FC<ErrorDetailProps> = props => { export const ErrorDetail: FC<ErrorDetailProps> = props => {
const { const {
@@ -6,7 +6,7 @@ import { ErrorDetail } from '../error-basic/error-detail';
import type { FallbackProps } from '../error-basic/fallback-creator'; import type { FallbackProps } from '../error-basic/fallback-creator';
/** /**
* TODO: Support reload and retry two reset actions in page error and area error. * TODO(@eyhn): Support reload and retry two reset actions in page error and area error.
*/ */
export const AnyErrorFallback: FC<FallbackProps> = props => { export const AnyErrorFallback: FC<FallbackProps> = props => {
const { error } = props; const { error } = props;
@@ -11,7 +11,7 @@ export interface AffineErrorBoundaryProps extends PropsWithChildren {
} }
/** /**
* TODO: Unify with SWRErrorBoundary * TODO(@eyhn): Unify with SWRErrorBoundary
*/ */
export const AffineErrorBoundary: FC<AffineErrorBoundaryProps> = props => { export const AffineErrorBoundary: FC<AffineErrorBoundaryProps> = props => {
const fallbackRender: FallbackRender = useCallback( const fallbackRender: FallbackRender = useCallback(
@@ -18,7 +18,7 @@ export interface SliderProps<T> extends HTMLAttributes<HTMLDivElement> {
} }
/** /**
* TODO: extract to @affine/ui * TODO(@catsjuice): extract to @affine/ui
* @returns * @returns
*/ */
export const Slider = <T,>({ export const Slider = <T,>({
@@ -25,7 +25,7 @@ const OAuthProviderMap: Record<
}, },
[OAuthProviderType.OIDC]: { [OAuthProviderType.OIDC]: {
// TODO: Add OIDC icon // TODO(@catsjuice): Add OIDC icon
icon: <GoogleDuotoneIcon />, icon: <GoogleDuotoneIcon />,
}, },
}; };
@@ -114,7 +114,7 @@ const useSendEmail = (emailType: AuthPanelProps['emailType']) => {
callbackUrl = 'verify-email'; callbackUrl = 'verify-email';
break; break;
} }
// TODO: add error handler // TODO(@eyhn): add error handler
return trigger({ return trigger({
email, email,
callbackUrl: `/auth/${callbackUrl}?isClient=${ callbackUrl: `/auth/${callbackUrl}?isClient=${
@@ -152,7 +152,7 @@ export const SendEmail = ({
const { loading, sendEmail } = useSendEmail(emailType); const { loading, sendEmail } = useSendEmail(emailType);
const onSendEmail = useAsyncCallback(async () => { const onSendEmail = useAsyncCallback(async () => {
// TODO: add error handler // TODO(@eyhn): add error handler
await sendEmail(email); await sendEmail(email);
notify.success({ title: hint }); notify.success({ title: hint });
@@ -164,7 +164,7 @@ export const SendEmail = ({
}, [setAuthState]); }, [setAuthState]);
if (!passwordLimits) { if (!passwordLimits) {
// TODO: loading & error UI // TODO(@eyhn): loading & error UI
return null; return null;
} }
@@ -62,7 +62,7 @@ export const SignInWithPassword: FC<AuthPanelProps> = ({
notify.error({ notify.error({
title: 'Failed to send email, please try again.', title: 'Failed to send email, please try again.',
}); });
// TODO: handle error better // TODO(@eyhn): handle error better
} }
setSendingEmail(false); setSendingEmail(false);
}, [sendingEmail, verifyToken, authService, email, challenge, setAuthState]); }, [sendingEmail, verifyToken, authService, email, challenge, setAuthState]);
@@ -98,7 +98,7 @@ export const SignIn: FC<AuthPanelProps> = ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
// TODO: better error handling // TODO(@eyhn): better error handling
notify.error({ notify.error({
title: 'Failed to send email. Please try again.', title: 'Failed to send email. Please try again.',
}); });
@@ -14,7 +14,7 @@ const SyncAwarenessInnerLoggedIn = () => {
'user', 'user',
{ {
name: account.label, name: account.label,
// todo: add avatar? // TODO(@eyhn): add avatar?
} }
); );
@@ -42,7 +42,7 @@ const SyncAwarenessInner = () => {
return null; return null;
}; };
// todo: we could do something more interesting here, e.g., show where the current user is // TODO(@eyhn): we could do something more interesting here, e.g., show where the current user is
export const SyncAwareness = () => { export const SyncAwareness = () => {
return ( return (
<Suspense> <Suspense>
@@ -101,7 +101,7 @@ const NameWorkspaceContent = ({
}, },
[handleCreateWorkspace, workspaceName] [handleCreateWorkspace, workspaceName]
); );
// TODO: Support uploading avatars.
// Currently, when we create a new workspace and upload an avatar at the same time, // Currently, when we create a new workspace and upload an avatar at the same time,
// an error occurs after the creation is successful: get blob 404 not found // an error occurs after the creation is successful: get blob 404 not found
return ( return (
@@ -186,7 +186,7 @@ export const CreateWorkspaceModal = ({
const workspacesService = useService(WorkspacesService); const workspacesService = useService(WorkspacesService);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
// todo: maybe refactor using xstate? // TODO(@Peng): maybe refactor using xstate?
useLayoutEffect(() => { useLayoutEffect(() => {
let canceled = false; let canceled = false;
// if mode changed, reset step // if mode changed, reset step
@@ -21,7 +21,7 @@ globalStyle(`${block} p`, {
lineHeight: '23px', lineHeight: '23px',
}); });
globalStyle(`${block} b`, { globalStyle(`${block} b`, {
// TODO: 500's effect not matching the design, use 600 for now // TODO(@catsjuice): 500's effect not matching the design, use 600 for now
fontWeight: '600', fontWeight: '600',
}); });
globalStyle(`${block} ol`, { globalStyle(`${block} ol`, {
@@ -1,6 +1,6 @@
import { article, articleWrapper, text, title } from '../curve-paper/paper.css'; import { article, articleWrapper, text, title } from '../curve-paper/paper.css';
import type { ArticleId, ArticleOption, EdgelessSwitchState } from '../types'; import type { ArticleId, ArticleOption, EdgelessSwitchState } from '../types';
// TODO: lazy load // TODO(@catsjuice): lazy load
import { article0 } from './article-0'; import { article0 } from './article-0';
import { article1 } from './article-1'; import { article1 } from './article-1';
import { article2 } from './article-2'; import { article2 } from './article-2';
@@ -113,7 +113,7 @@ export const EdgelessSwitch = ({
turnOffScalingRef.current?.(); turnOffScalingRef.current?.();
}; };
// TODO: mobile support // TODO(@catsjuice): mobile support
const onMouseDown = (e: MouseEvent) => { const onMouseDown = (e: MouseEvent) => {
const target = e.target as HTMLElement; const target = e.target as HTMLElement;
if (target.closest('[data-no-drag]')) return; if (target.closest('[data-no-drag]')) return;
@@ -94,7 +94,7 @@ const snapshotFetcher = async (
// attach the Page shown in the modal to a temporary workspace // attach the Page shown in the modal to a temporary workspace
// so that we do not need to worry about providers etc // so that we do not need to worry about providers etc
// todo: fix references to the page (the referenced page will shown as deleted) // TODO(@Peng): fix references to the page (the referenced page will shown as deleted)
// if we simply clone the current workspace, it maybe time consuming right? // if we simply clone the current workspace, it maybe time consuming right?
const docCollectionMap = new Map<string, DocCollection>(); const docCollectionMap = new Map<string, DocCollection>();
@@ -247,7 +247,7 @@ const PlanPrompt = () => {
: t[ : t[
'com.affine.history.confirm-restore-modal.plan-prompt.title' 'com.affine.history.confirm-restore-modal.plan-prompt.title'
]() ]()
: '' /* TODO: loading UI */ : '' /* TODO(@catsjuice): loading UI */
} }
<IconButton <IconButton
@@ -35,7 +35,7 @@ export const newPropertyTypes: PagePropertyType[] = [
PagePropertyType.Number, PagePropertyType.Number,
PagePropertyType.Checkbox, PagePropertyType.Checkbox,
PagePropertyType.Date, PagePropertyType.Date,
// todo: add more // TODO(@Peng): add more
]; ];
export class PagePropertiesMetaManager { export class PagePropertiesMetaManager {
@@ -188,7 +188,7 @@ export const propertyValueRenderers: Record<
checkbox: CheckboxValue, checkbox: CheckboxValue,
text: TextValue, text: TextValue,
number: NumberValue, number: NumberValue,
// todo: fix following // TODO(@Peng): fix following
tags: TagsValue, tags: TagsValue,
progress: TextValue, progress: TextValue,
}; };
@@ -682,7 +682,7 @@ export const PagePropertiesTableHeader = ({
return ( return (
<div className={clsx(styles.tableHeader, className)} style={style}> <div className={clsx(styles.tableHeader, className)} style={style}>
{/* todo: add click handler to backlinks */} {/* TODO(@Peng): add click handler to backlinks */}
<div className={styles.tableHeaderInfoRow}> <div className={styles.tableHeaderInfoRow}>
{backlinks.length > 0 ? ( {backlinks.length > 0 ? (
<PageBacklinksPopup backlinks={backlinks}> <PageBacklinksPopup backlinks={backlinks}>
@@ -63,7 +63,7 @@ export const AIUsagePanel = () => {
desc={''} desc={''}
spreadCol={false} spreadCol={false}
> >
{/* TODO: i18n */} {/* TODO(@catsjuice): i18n */}
<ErrorMessage>Load error</ErrorMessage> <ErrorMessage>Load error</ErrorMessage>
</SettingRow> </SettingRow>
); );
@@ -44,7 +44,7 @@ export const UserAvatar = () => {
await session.uploadAvatar(file); await session.uploadAvatar(file);
notify.success({ title: 'Update user avatar success' }); notify.success({ title: 'Update user avatar success' });
} catch (e) { } catch (e) {
// TODO: i18n // TODO(@catsjuice): i18n
notify.error({ notify.error({
title: 'Update user avatar failed', title: 'Update user avatar failed',
message: String(e), message: String(e),
@@ -63,10 +63,9 @@ export const StorageProgress = ({ onUpgrade }: StorageProgressProgress) => {
if (loading) { if (loading) {
if (loadError) { if (loadError) {
// TODO: i18n // TODO(@catsjuice): i18n
return <ErrorMessage>Load error</ErrorMessage>; return <ErrorMessage>Load error</ErrorMessage>;
} }
// TODO: loading UI
return <Skeleton height={42} />; return <Skeleton height={42} />;
} }
@@ -349,7 +349,6 @@ const PlanAction = ({
}; };
const PaymentMethodUpdater = () => { const PaymentMethodUpdater = () => {
// TODO: open stripe customer portal
const { isMutating, trigger } = useMutation({ const { isMutating, trigger } = useMutation({
mutation: createCustomerPortalMutation, mutation: createCustomerPortalMutation,
}); });
@@ -475,7 +474,6 @@ const InvoiceLine = ({
<SettingRow <SettingRow
key={invoice.id} key={invoice.id}
name={new Date(invoice.createdAt).toLocaleDateString()} name={new Date(invoice.createdAt).toLocaleDateString()}
// TODO: currency to format: usd => $, cny => ¥
desc={`${ desc={`${
invoice.status === InvoiceStatus.Paid invoice.status === InvoiceStatus.Paid
? t['com.affine.payment.billing-setting.paid']() ? t['com.affine.payment.billing-setting.paid']()
@@ -181,7 +181,7 @@ const ExperimentalFeaturesMain = () => {
); );
}; };
// todo: save to workspace meta instead? // TODO(@Peng): save to workspace meta instead?
const experimentalFeaturesDisclaimerAtom = atomWithStorage( const experimentalFeaturesDisclaimerAtom = atomWithStorage(
'affine:experimental-features-disclaimer', 'affine:experimental-features-disclaimer',
false false
@@ -63,7 +63,7 @@ export const AISubscribe = ({ ...btnProps }: AISubscribeProps) => {
}, [idempotencyKey, subscriptionService]); }, [idempotencyKey, subscriptionService]);
if (!price || !price.yearlyAmount) { if (!price || !price.yearlyAmount) {
// TODO: loading UI // TODO(@catsjuice): loading UI
return null; return null;
} }
@@ -41,7 +41,7 @@ const benefitsGetter = (t: ReturnType<typeof useI18n>) => [
export const AIBenefits = () => { export const AIBenefits = () => {
const t = useI18n(); const t = useI18n();
const benefits = useMemo(() => benefitsGetter(t), [t]); const benefits = useMemo(() => benefitsGetter(t), [t]);
// TODO: responsive // TODO(@catsjuice): responsive
return ( return (
<div className={styles.benefits}> <div className={styles.benefits}>
{benefits.map(({ name, icon, items }) => { {benefits.map(({ name, icon, items }) => {
@@ -1,5 +1,3 @@
// TODO: we don't handle i18n for now
// it's better to manage all equity at server side
import { SubscriptionPlan, SubscriptionRecurring } from '@affine/graphql'; import { SubscriptionPlan, SubscriptionRecurring } from '@affine/graphql';
import type { useI18n } from '@affine/i18n'; import type { useI18n } from '@affine/i18n';
import { AfFiNeIcon } from '@blocksuite/icons/rc'; import { AfFiNeIcon } from '@blocksuite/icons/rc';
@@ -105,7 +105,7 @@ export const PlanLayout = ({ cloud, ai, aiTip }: PlanLayoutProps) => {
} }
}, [aiTip, settingModalScrollContainer]); }, [aiTip, settingModalScrollContainer]);
// TODO: Need a better solution to handle this situation // TODO(@catsjuice): Need a better solution to handle this situation
useLayoutEffect(() => { useLayoutEffect(() => {
if (!scrollAnchor) return; if (!scrollAnchor) return;
setTimeout(() => { setTimeout(() => {
@@ -135,7 +135,7 @@ export const PlanLayout = ({ cloud, ai, aiTip }: PlanLayoutProps) => {
return ( return (
<div className={styles.plansLayoutRoot}> <div className={styles.plansLayoutRoot}>
{/* TODO: SettingHeader component shouldn't have margin itself */} {/* TODO(@catsjuice): SettingHeader component shouldn't have margin itself */}
<SettingHeader <SettingHeader
style={{ marginBottom: '0px' }} style={{ marginBottom: '0px' }}
title={t['com.affine.payment.title']()} title={t['com.affine.payment.title']()}
@@ -18,7 +18,7 @@ const RoundedSkeleton = ({
); );
const TabsSkeleton = () => ( const TabsSkeleton = () => (
// TODO: height should be `32px` by design // TODO(@catsjuice): height should be `32px` by design
// but the RadioGroup component is not matching with the design currently // but the RadioGroup component is not matching with the design currently
// set to `24px` for now to avoid blinking // set to `24px` for now to avoid blinking
<Skeleton variant="rounded" width="256px" height="24px" /> <Skeleton variant="rounded" width="256px" height="24px" />
@@ -84,7 +84,7 @@ export const planCardBorderMock = style({
bottom: 0, bottom: 0,
borderRadius: 'inherit', borderRadius: 'inherit',
border: `2px solid transparent`, border: `2px solid transparent`,
// TODO: brandColor with opacity, dark mode compatibility needed // TODO(@catsjuice): brandColor with opacity, dark mode compatibility needed
background: `linear-gradient(180deg, ${cssVar('brandColor')}, #1E96EB33) border-box`, background: `linear-gradient(180deg, ${cssVar('brandColor')}, #1E96EB33) border-box`,
['WebkitMask']: `linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0)`, ['WebkitMask']: `linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0)`,
[`WebkitMaskComposite`]: `destination-out`, [`WebkitMaskComposite`]: `destination-out`,
@@ -38,7 +38,7 @@ export type UserInfoProps = {
export const UserInfo = ({ onAccountSettingClick, active }: UserInfoProps) => { export const UserInfo = ({ onAccountSettingClick, active }: UserInfoProps) => {
const account = useLiveData(useService(AuthService).session.account$); const account = useLiveData(useService(AuthService).session.account$);
if (!account) { if (!account) {
// TODO: loading ui // TODO(@eyhn): loading ui
return; return;
} }
return ( return (
@@ -70,7 +70,7 @@ export const DeleteLeaveWorkspace = () => {
const backWorkspace = workspaceList.find( const backWorkspace = workspaceList.find(
ws => ws.id !== currentWorkspaceId ws => ws.id !== currentWorkspaceId
); );
// TODO: if there is no workspace, jump to a new page(wait for design) // TODO(@eyhn): if there is no workspace, jump to a new page(wait for design)
if (backWorkspace) { if (backWorkspace) {
jumpToSubPath( jumpToSubPath(
backWorkspace?.id || '', backWorkspace?.id || '',
@@ -81,7 +81,7 @@ export const LabelsPanel = () => {
condition: workspace.flavour === 'affine-cloud', condition: workspace.flavour === 'affine-cloud',
label: 'syncCloud', label: 'syncCloud',
}, },
//TODO: add these labels //TODO(@JimmFly): add these labels
// { status==="synced", label: 'availableOffline' } // { status==="synced", label: 'availableOffline' }
// { workspace.flavour === 'affine-Docker', label: 'syncDocker' } // { workspace.flavour === 'affine-Docker', label: 'syncDocker' }
// { workspace.flavour === 'self-hosted', label: 'selfHosted' } // { workspace.flavour === 'self-hosted', label: 'selfHosted' }
@@ -197,7 +197,7 @@ export const CloudWorkspaceMembersPanel = () => {
}, [handleUpgradeConfirm, hasPaymentFeature, t, workspaceQuota]); }, [handleUpgradeConfirm, hasPaymentFeature, t, workspaceQuota]);
if (workspaceQuota === null) { if (workspaceQuota === null) {
// TODO: loading ui // TODO(@eyhn): loading ui
return null; return null;
} }
@@ -29,7 +29,7 @@ export const descriptionStyle = style({
}); });
export const buttonStyle = style({ export const buttonStyle = style({
marginTop: '18px', marginTop: '18px',
// todo: new color scheme should be used // todo(@JimmFly): new color scheme should be used
}); });
export const actionsStyle = style({ export const actionsStyle = style({
display: 'flex', display: 'flex',
@@ -211,7 +211,7 @@ export const AffineSharePage = (props: ShareMenuProps) => {
); );
if (isLoading) { if (isLoading) {
// TODO: loading and error UI // TODO(@eyhn): loading and error UI
return ( return (
<> <>
<Skeleton height={100} /> <Skeleton height={100} />
@@ -341,7 +341,7 @@ export const SharePage = (props: ShareMenuProps) => {
props.workspaceMetadata.flavour === WorkspaceFlavour.AFFINE_CLOUD props.workspaceMetadata.flavour === WorkspaceFlavour.AFFINE_CLOUD
) { ) {
return ( return (
// TODO: refactor this part // TODO(@eyhn): refactor this part
<ErrorBoundary fallback={null}> <ErrorBoundary fallback={null}>
<Suspense> <Suspense>
<AffineSharePage {...props} /> <AffineSharePage {...props} />
@@ -19,7 +19,7 @@ export function AppDownloadButton({
setShow(false); setShow(false);
}, []); }, []);
// TODO: unify this type of literal value. // TODO(@JimmFly): unify this type of literal value.
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
mixpanel.track('Button', { mixpanel.track('Button', {
resolve: 'GoToDownloadAppPage', resolve: 'GoToDownloadAppPage',
@@ -16,7 +16,7 @@ type toTextStreamOptions = {
signal?: AbortSignal; signal?: AbortSignal;
}; };
// todo: may need to extend the error type // todo(@Peng): may need to extend the error type
const safeParseError = (data: string): { status: number } => { const safeParseError = (data: string): { status: number } => {
try { try {
return JSON.parse(data); return JSON.parse(data);
@@ -1,5 +1,5 @@
// manually synced with packages/backend/server/src/data/migrations/utils/prompts.ts // manually synced with packages/backend/server/src/data/migrations/utils/prompts.ts
// todo: automate this // TODO(@Peng): automate this
export const promptKeys = [ export const promptKeys = [
'debug:chat:gpt4', 'debug:chat:gpt4',
'debug:action:gpt4', 'debug:action:gpt4',
@@ -9,7 +9,7 @@ export const BlocksuiteEditorJournalDocTitle = ({ page }: { page: Doc }) => {
useJournalInfoHelper(page.collection, page.id); useJournalInfoHelper(page.collection, page.id);
const t = useI18n(); const t = useI18n();
// TODO: i18n // TODO(catsjuice): i18n
const day = journalDate?.format('dddd') ?? null; const day = journalDate?.format('dddd') ?? null;
return ( return (
@@ -2,7 +2,7 @@ import type { Doc } from '@blocksuite/store';
import type { Map as YMap } from 'yjs'; import type { Map as YMap } from 'yjs';
/** /**
* TODO: Define error to unexpected state together in the future. * TODO(@eyhn): Define error to unexpected state together in the future.
*/ */
export class NoPageRootError extends Error { export class NoPageRootError extends Error {
constructor(public page: Doc) { constructor(public page: Doc) {
@@ -223,7 +223,7 @@ export const PageHeaderMenuButton = ({
? t['com.affine.favoritePageOperation.remove']() ? t['com.affine.favoritePageOperation.remove']()
: t['com.affine.favoritePageOperation.add']()} : t['com.affine.favoritePageOperation.add']()}
</MenuItem> </MenuItem>
{/* {TODO: add tag function support} */} {/* {TODO(@Peng): add tag function support} */}
{/* <MenuItem {/* <MenuItem
icon={<TagsIcon />} icon={<TagsIcon />}
data-testid="editor-option-menu-add-tag" data-testid="editor-option-menu-add-tag"
@@ -12,7 +12,7 @@ export const usePresent = () => {
const editorHost = editor?.host; const editorHost = editor?.host;
if (!editorHost) return; if (!editorHost) return;
// TODO: use surfaceService subAtom // TODO(@catsjuice): use surfaceService subAtom
const enterOrLeavePresentationMode = () => { const enterOrLeavePresentationMode = () => {
const edgelessRootService = editorHost.spec.getService( const edgelessRootService = editorHost.spec.getService(
'affine:page' 'affine:page'
@@ -18,7 +18,7 @@ const ShareHeaderRightItem = ({ ...props }: ShareHeaderRightItemProps) => {
const { publishMode } = props; const { publishMode } = props;
const [isMember, setIsMember] = useState(false); const [isMember, setIsMember] = useState(false);
// TODO: Add TOC // TODO(@JimmFly): Add TOC
return ( return (
<div className={styles.rightItemContainer}> <div className={styles.rightItemContainer}>
{loginStatus === 'authenticated' ? ( {loginStatus === 'authenticated' ? (
@@ -24,7 +24,7 @@ const UserInfo = () => {
const plan = useLiveData(subscription.pro$)?.plan; const plan = useLiveData(subscription.pro$)?.plan;
if (!user) { if (!user) {
// TODO: loading UI // TODO(@eyhn): loading UI
return null; return null;
} }
return ( return (
@@ -66,7 +66,7 @@ globalStyle(`[data-draggable=true][data-dragging=true] ${dndCell}:before`, {
opacity: 1, opacity: 1,
}); });
// todo: remove global style // TODO(@JimmFly): remove global style
globalStyle(`${root} > :first-child`, { globalStyle(`${root} > :first-child`, {
paddingLeft: '16px', paddingLeft: '16px',
}); });
@@ -109,7 +109,7 @@ export const CollectionListItem = (props: CollectionListItemProps) => {
props.title, props.title,
]); ]);
// TODO: use getDropItemId // TODO(@JimmFly): use getDropItemId
const { setNodeRef, attributes, listeners, isDragging } = useDraggable({ const { setNodeRef, attributes, listeners, isDragging } = useDraggable({
id: getDNDId('collection-list', 'collection', props.collectionId), id: getDNDId('collection-list', 'collection', props.collectionId),
data: { data: {
@@ -66,7 +66,7 @@ globalStyle(`[data-draggable=true][data-dragging=true] ${dndCell}:before`, {
opacity: 1, opacity: 1,
}); });
// todo: remove global style // TODO(@JimmFly): remove global style
globalStyle(`${root} > :first-child`, { globalStyle(`${root} > :first-child`, {
paddingLeft: '16px', paddingLeft: '16px',
}); });
@@ -167,7 +167,7 @@ export const PageListItem = (props: PageListItemProps) => {
props.title, props.title,
]); ]);
// TODO: use getDropItemId // TODO(@JimmFly): use getDropItemId
const { setNodeRef, attributes, listeners, isDragging } = useDraggable({ const { setNodeRef, attributes, listeners, isDragging } = useDraggable({
id: getDNDId('doc-list', 'doc', props.pageId), id: getDNDId('doc-list', 'doc', props.pageId),
data: { data: {
@@ -35,7 +35,7 @@ const GroupLabel = ({
</div> </div>
); );
// todo: optimize date matchers // TODO(@JimmFly): optimize date matchers
export const useDateGroupDefinitions = <T extends ListItem>( export const useDateGroupDefinitions = <T extends ListItem>(
key: DateKey key: DateKey
): ItemGroupDefinition<T>[] => { ): ItemGroupDefinition<T>[] => {
@@ -223,7 +223,7 @@ export const usePageItemGroupDefinitions = () => {
none: undefined, none: undefined,
// add more here later // add more here later
// todo: some page group definitions maybe dynamic // todo(@JimmFly): some page group definitions maybe dynamic
}; };
return itemGroupDefinitions[workspaceProperties.groupBy]; return itemGroupDefinitions[workspaceProperties.groupBy];
}, [ }, [
@@ -43,7 +43,7 @@ export const List = forwardRef<ItemListHandle, ListProps<ListItem>>(
); );
// when pressing ESC or double clicking outside of the page list, close the selection mode // when pressing ESC or double clicking outside of the page list, close the selection mode
// todo: use jotai-effect instead but it seems it does not work with jotai-scope? // TODO(@Peng): use jotai-effect instead but it seems it does not work with jotai-scope?
const useItemSelectionStateEffect = () => { const useItemSelectionStateEffect = () => {
const [selectionState, setSelectionActive] = useAtom(selectionStateAtom); const [selectionState, setSelectionActive] = useAtom(selectionStateAtom);
useEffect(() => { useEffect(() => {
@@ -194,7 +194,7 @@ export const ItemGroup = <T extends ListItem>({
); );
}; };
// todo: optimize how to render page meta list item // TODO(@Peng): optimize how to render page meta list item
const requiredPropNames = [ const requiredPropNames = [
'docCollection', 'docCollection',
'rowAsLink', 'rowAsLink',
@@ -65,7 +65,7 @@ globalStyle(`[data-draggable=true][data-dragging=true] ${dndCell}:before`, {
opacity: 1, opacity: 1,
}); });
// todo: remove global style // TODO(@JimmFly): remove global style
globalStyle(`${root} > :first-child`, { globalStyle(`${root} > :first-child`, {
paddingLeft: '16px', paddingLeft: '16px',
}); });
@@ -98,7 +98,7 @@ export const TagListItem = (props: TagListItemProps) => {
); );
}, [props.color, props.onSelectedChange, props.selectable, props.selected]); }, [props.color, props.onSelectedChange, props.selectable, props.selected]);
// TODO: use getDropItemId // TODO(@JimmFly): use getDropItemId
const { setNodeRef, attributes, listeners, isDragging } = useDraggable({ const { setNodeRef, attributes, listeners, isDragging } = useDraggable({
id: getDNDId('tag-list', 'tag', props.tagId), id: getDNDId('tag-list', 'tag', props.tagId),
data: { data: {
@@ -19,7 +19,7 @@ export type TagMeta = {
createDate?: Date | number; createDate?: Date | number;
updatedDate?: Date | number; updatedDate?: Date | number;
}; };
// TODO: consider reducing the number of props here // TODO(@JimmFly): consider reducing the number of props here
// using type instead of interface to make it Record compatible // using type instead of interface to make it Record compatible
export type PageListItemProps = { export type PageListItemProps = {
pageId: string; pageId: string;
@@ -73,10 +73,10 @@ export type TagListItemProps = {
export interface ItemListHeaderProps {} export interface ItemListHeaderProps {}
// todo: a temporary solution. may need to be refactored later // TODO(@JimmFly): a temporary solution. may need to be refactored later
export type ItemGroupByType = 'createDate' | 'updatedDate'; // todo: can add more later export type ItemGroupByType = 'createDate' | 'updatedDate'; // TODO(@JimmFly): can add more later
// todo: a temporary solution. may need to be refactored later // TODO(@JimmFly): a temporary solution. may need to be refactored later
export interface SortBy { export interface SortBy {
key: 'createDate' | 'updatedDate'; key: 'createDate' | 'updatedDate';
order: 'asc' | 'desc'; order: 'asc' | 'desc';
@@ -32,7 +32,7 @@ export const useFilteredPageMetas = (
); );
useEffect(() => { useEffect(() => {
// TODO: loading & error UI // TODO(@eyhn): loading & error UI
shareDocsService.shareDocs?.revalidate(); shareDocsService.shareDocs?.revalidate();
}, [shareDocsService]); }, [shareDocsService]);
@@ -206,7 +206,7 @@ const ListInner = ({
totalCount={virtuosoItems.length} totalCount={virtuosoItems.length}
itemContent={itemContentRenderer} itemContent={itemContentRenderer}
className={clsx(props.className, styles.root)} className={clsx(props.className, styles.root)}
// todo: set a reasonable overscan value to avoid blank space? // TODO(@Peng): set a reasonable overscan value to avoid blank space?
// overscan={100} // overscan={100}
/> />
); );
@@ -135,7 +135,7 @@ const useSyncEngineSyncProgress = () => {
}, [currentWorkspace, isOwner, jumpToPricePlan, t]); }, [currentWorkspace, isOwner, jumpToPricePlan, t]);
const content = useMemo(() => { const content = useMemo(() => {
// TODO: add i18n // TODO(@eyhn): add i18n
if (currentWorkspace.flavour === WorkspaceFlavour.LOCAL) { if (currentWorkspace.flavour === WorkspaceFlavour.LOCAL) {
if (!environment.isDesktop) { if (!environment.isDesktop) {
return 'This is a local demo workspace.'; return 'This is a local demo workspace.';
@@ -22,7 +22,7 @@ export const userInfoWrapper = style({
padding: '4px 0', padding: '4px 0',
}); });
// TODO: // TODO(@catsjuice):
globalStyle(`button.${userInfoWrapper} > span`, { globalStyle(`button.${userInfoWrapper} > span`, {
lineHeight: 0, lineHeight: 0,
}); });
@@ -1,7 +1,7 @@
import type React from 'react'; import type React from 'react';
/** /**
* TODO: Define a place to manage all icons and svg images. * TODO(@eyhn): move to icons package
*/ */
export const ArrowCircleIcon = (props: React.SVGProps<SVGSVGElement>) => { export const ArrowCircleIcon = (props: React.SVGProps<SVGSVGElement>) => {
return ( return (
@@ -1,5 +1,5 @@
import { Button } from '@affine/component/ui/button'; import { Button } from '@affine/component/ui/button';
import { AffineShapeIcon } from '@affine/core/components/page-list'; // TODO: import from page-list temporarily, need to defined common svg icon/images management. import { AffineShapeIcon } from '@affine/core/components/page-list'; // TODO(@eyhn): import from page-list temporarily, need to defined common svg icon/images management.
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks'; import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper'; import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';
import { WorkspaceSubPath } from '@affine/core/shared'; import { WorkspaceSubPath } from '@affine/core/shared';
@@ -12,7 +12,7 @@ import * as styles from './upgrade.css';
import { ArrowCircleIcon, HeartBreakIcon } from './upgrade-icon'; import { ArrowCircleIcon, HeartBreakIcon } from './upgrade-icon';
/** /**
* TODO: Help info is not implemented yet. * TODO(@eyhn): Help info is not implemented yet.
*/ */
export const WorkspaceUpgrade = function WorkspaceUpgrade() { export const WorkspaceUpgrade = function WorkspaceUpgrade() {
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
@@ -22,7 +22,7 @@ export const appStyle = style({
opacity: `var(--affine-noise-opacity, 0)`, opacity: `var(--affine-noise-opacity, 0)`,
backgroundRepeat: 'repeat', backgroundRepeat: 'repeat',
backgroundSize: '50px', backgroundSize: '50px',
// todo: figure out how to use vanilla-extract webpack plugin to inject img url // TODO(@Peng): figure out how to use vanilla-extract webpack plugin to inject img url
backgroundImage: `var(--noise-background)`, backgroundImage: `var(--noise-background)`,
}, },
}, },
@@ -57,8 +57,8 @@ export const mainContainerStyle = style({
borderRadius: 6, borderRadius: 6,
margin: '8px', margin: '8px',
overflow: 'hidden', overflow: 'hidden',
// todo: is this performance intensive? // TODO(@Peng): is this performance intensive?
// TODO: not match with design's shadow, theme missing // TODO(@catsjuice): not match with design's shadow, theme missing
filter: 'drop-shadow(0px 0px 4px rgba(66,65,73,.14))', filter: 'drop-shadow(0px 0px 4px rgba(66,65,73,.14))',
'@media': { '@media': {
print: { print: {
@@ -18,7 +18,7 @@ export const useAllPageListConfig = () => {
const shareDocs = useLiveData(shareDocService.shareDocs?.list$); const shareDocs = useLiveData(shareDocService.shareDocs?.list$);
useEffect(() => { useEffect(() => {
// TODO: loading & error UI // TODO(@eyhn): loading & error UI
shareDocService.shareDocs?.revalidate(); shareDocService.shareDocs?.revalidate();
}, [shareDocService]); }, [shareDocService]);
@@ -4,7 +4,7 @@ import { useSWRConfig } from 'swr';
export function useMutateCloud() { export function useMutateCloud() {
const { mutate } = useSWRConfig(); const { mutate } = useSWRConfig();
return useCallback(async () => { return useCallback(async () => {
// todo: should not mutate all graphql cache // TODO(@eyhn): should not mutate all graphql cache
return mutate(key => { return mutate(key => {
if (Array.isArray(key)) { if (Array.isArray(key)) {
return key[0] === 'cloud'; return key[0] === 'cloud';
@@ -69,7 +69,7 @@ export function useRegisterBlocksuiteEditorCommands() {
const preconditionStrategy = () => const preconditionStrategy = () =>
PreconditionStrategy.InPaperOrEdgeless && !trash; PreconditionStrategy.InPaperOrEdgeless && !trash;
// TODO: add back when edgeless presentation is ready // TODO(@Peng): add back when edgeless presentation is ready
// this is pretty hack and easy to break. need a better way to communicate with blocksuite editor // this is pretty hack and easy to break. need a better way to communicate with blocksuite editor
// unsubs.push( // unsubs.push(
@@ -134,7 +134,7 @@ export function useRegisterBlocksuiteEditorCommands() {
}) })
); );
// todo: should not show duplicate for journal // TODO(@Peng): should not show duplicate for journal
unsubs.push( unsubs.push(
registerAffineCommand({ registerAffineCommand({
id: `editor:${mode}-duplicate`, id: `editor:${mode}-duplicate`,
@@ -12,7 +12,7 @@ const useReactiveAdapter = (adapter: WorkspacePropertiesAdapter) => {
// hack: delay proxy creation to avoid unnecessary re-render + render in another component issue // hack: delay proxy creation to avoid unnecessary re-render + render in another component issue
const [proxy, setProxy] = useDebouncedState(adapter, 0); const [proxy, setProxy] = useDebouncedState(adapter, 0);
useEffect(() => { useEffect(() => {
// todo: track which properties are used and then filter by property path change // TODO(@Peng): track which properties are used and then filter by property path change
// using Y.YEvent.path // using Y.YEvent.path
function observe() { function observe() {
setProxy(getProxy(adapter)); setProxy(getProxy(adapter));
@@ -127,7 +127,7 @@ export const useAppUpdater = () => {
if (updateReady) { if (updateReady) {
setAppQuitting(true); setAppQuitting(true);
apis?.updater.quitAndInstall().catch(err => { apis?.updater.quitAndInstall().catch(err => {
// TODO: add error toast here // TODO(@Peng): add error toast here
console.error(err); console.error(err);
}); });
} }
@@ -18,7 +18,7 @@ function defaultNavigate(to: To, option?: { replace?: boolean }) {
}, 100); }, 100);
} }
// todo: add a name -> path helper in the results // TODO(@eyhn): add a name -> path helper in the results
export function useNavigateHelper() { export function useNavigateHelper() {
const navigate = useContext(NavigateContext) ?? defaultNavigate; const navigate = useContext(NavigateContext) ?? defaultNavigate;
@@ -111,7 +111,7 @@ export function useQueryInfinite<Query extends GraphQLQuery>(
const loadingMore = size > 0 && data && !data[size - 1]; const loadingMore = size > 0 && data && !data[size - 1];
// todo: find a generic way to know whether or not there are more items to load // TODO(@Peng): find a generic way to know whether or not there are more items to load
const loadMore = useCallback(() => { const loadMore = useCallback(() => {
if (loadingMore) { if (loadingMore) {
return; return;
@@ -20,7 +20,7 @@ export type SearchCallbackResult =
action: 'insert'; action: 'insert';
}; };
// todo: move command registry to entity as well // TODO(@Peng): move command registry to entity as well
export class QuickSearch extends Entity { export class QuickSearch extends Entity {
constructor( constructor(
private readonly docsService: DocsService, private readonly docsService: DocsService,
@@ -320,7 +320,7 @@ export const usePageCommands = () => {
]); ]);
}; };
// todo: refactor to reduce duplication with usePageCommands // TODO(@Peng): refactor to reduce duplication with usePageCommands
export const useSearchCallbackCommands = () => { export const useSearchCallbackCommands = () => {
const quickSearch = useService(QuickSearchService).quickSearch; const quickSearch = useService(QuickSearchService).quickSearch;
const workspace = useService(WorkspaceService).workspace; const workspace = useService(WorkspaceService).workspace;
@@ -415,7 +415,7 @@ export const collectionToCommand = (
}; };
export const useCollectionsCommands = () => { export const useCollectionsCommands = () => {
// todo: considering collections for searching pages // TODO(@eyhn): considering collections for searching pages
const collectionService = useService(CollectionService); const collectionService = useService(CollectionService);
const collections = useLiveData(collectionService.collections$); const collections = useLiveData(collectionService.collections$);
const quickSearch = useService(QuickSearchService).quickSearch; const quickSearch = useService(QuickSearchService).quickSearch;
@@ -200,7 +200,7 @@ export const CMDKContainer = ({
onValueChange={setValue} onValueChange={setValue}
loop loop
> >
{/* todo: add page context here */} {/* TODO(@Peng): add page context here */}
{inputLabel ? ( {inputLabel ? (
<div className={styles.pageTitleWrapper}> <div className={styles.pageTitleWrapper}>
<span className={styles.pageTitle}>{inputLabel}</span> <span className={styles.pageTitle}>{inputLabel}</span>
@@ -71,7 +71,7 @@ export class FindInPage extends Entity {
constructor() { constructor() {
super(); super();
// todo: hide on navigation // TODO(@Peng): hide on navigation
} }
findInPage(searchText: string) { findInPage(searchText: string) {
@@ -152,7 +152,7 @@ export const pageItemLabel = style({
textAlign: 'left', textAlign: 'left',
selectors: { selectors: {
'[aria-selected="true"] &': { '[aria-selected="true"] &': {
// TODO: wait for design // TODO(@catsjuice): wait for design
color: cssVar('primaryColor'), color: cssVar('primaryColor'),
}, },
}, },

Some files were not shown because too many files have changed in this diff Show More