Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: assign todos #7297

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/backend/server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function createApp() {

app.use(
graphqlUploadExpress({
// TODO: dynamic limit by quota
// TODO(@darksky): dynamic limit by quota maybe?
maxFileSize: 100 * 1024 * 1024,
maxFiles: 5,
})
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/server/src/core/auth/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class AuthController {
@Public()
@Get('/challenge')
async challenge() {
// TODO: impl in following PR
// TODO(@darksky): impl in following PR
return {
challenge: randomUUID(),
resource: randomUUID(),
Expand Down
1 change: 0 additions & 1 deletion packages/backend/server/src/core/quota/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class QuotaManagementService {
};
}

// TODO: lazy calc, need to be optimized with cache
async getUserUsage(userId: string) {
const workspaces = await this.permissions.getOwnedWorkspaces(userId);

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/server/src/core/user/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class UserResolver {
): Promise<typeof UserOrLimitedUser | null> {
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);

// return empty response when user not exists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export class UserFeaturesInit1698652531198 {

// revert the migration
static async down(_db: PrismaClient) {
// TODO: revert the migration
// noop
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export class MailService {
};
}
) {
// TODO: use callback url when need support desktop app
const buttonUrl = this.url.link(`/invite/${inviteId}`);
const workspaceAvatar = invitationInfo.workspace.avatar;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class CopilotWorkflowService {
return workflow;
}

// todo: get workflow from database
// TODO(@darksky): get workflow from database
private async getWorkflow(graphName: string): Promise<WorkflowGraph> {
const graph = WorkflowGraphs.find(g => g.name === graphName);
if (!graph) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class WorkflowNode {
private async evaluateCondition(
_condition?: string
): Promise<string | undefined> {
// todo: evaluate condition to impl decision block
// TODO(@darksky): evaluate condition to impl decision block
return this.edges[0]?.id;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class S3StorageProvider implements StorageProvider {
// metadata
ContentType: metadata.contentType,
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,
})
);
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/src/app-config-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Storage<T extends object> {
}
} else {
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)) {}
return fullConfig[key];
}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/src/atom/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function setupEditorFlags(docCollection: DocCollection) {
});

// 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);
} catch (err) {
logger.error('syncEditorFlags', err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export function checkWorkspaceCompatibility(
return MigrationPoint.BlockVersion;
}

// TODO: Catch compatibility error from blocksuite to show upgrade page.
// Temporarily follow the check logic of blocksuite.
if ((docCollection.meta.docs?.length ?? 0) <= 1) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export const InviteModal = ({
}}
onConfirm={handleConfirm}
>
{/*TODO: check email & add placeholder*/}
<AuthInput
disabled={isMutating}
placeholder="email@example.com"
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/component/src/index.ts
Original file line number Diff line number Diff line change
@@ -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 './styles';
export * from './ui/avatar';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const listeners: Set<PortalListener> = new Set();

export function createLitPortalAnchor(callback: (event: PortalEvent) => void) {
const id = nanoid();
// todo: clean up listeners?
// todo(@Peng): clean up listeners?
listeners.add(event => {
if (event.target.portalId !== id) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const inputStyle = style({
});
export const popperStyle = style({
boxShadow: cssVar('shadow2'),
// TODO: for menu offset, need to be optimized
// TODO(@catsjuice): for menu offset, need to be optimized
marginTop: '16px',
background: cssVar('backgroundOverlayPanelColor'),
borderRadius: '12px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface WeekDatePickerProps
handleRef?: ForwardedRef<WeekDatePickerHandle>;
}

// TODO: i18n
// TODO(catsjuice): i18n
const weekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
// const weekDays = ['日', '一', '二', '三', '四', '五', '六'];
const format = 'YYYY-MM-DD';
Expand Down
11 changes: 0 additions & 11 deletions packages/frontend/component/src/ui/layout/wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion packages/frontend/component/src/ui/menu/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const menuTrigger = style({
color: cssVar('textDisableColor'),
pointerEvents: 'none',
},
// TODO: wait for design
// TODO(@catsjuice): wait for design
'&.error': {
// borderColor: 'var(--affine-error-color)',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/component/src/ui/modal/confirm-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const ConfirmModalProvider = ({ children }: PropsWithChildren) => {
value={{ openConfirmModal, closeConfirmModal, modalProps }}
>
{children}
{/* TODO: multi-instance support(unnecessary for now) */}
{/* TODO(@catsjuice): multi-instance support(unnecessary for now) */}
<ConfirmModal {...modalProps} onOpenChange={onOpenChange} />
</ConfirmModalContext.Provider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function actionToStream<T extends keyof BlockSuitePresets.AIActions>(
docId: host.doc.id,
workspaceId: host.doc.collection.id,
} as Parameters<typeof action>[0];
// @ts-expect-error todo: maybe fix this
// @ts-expect-error TODO(@Peng): maybe fix this
stream = action(options);
if (!stream) return;
yield* stream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function actionToStream<T extends keyof BlockSuitePresets.AIActions>(
Object.assign(options, data);
}

// @ts-expect-error todo: maybe fix this
// @ts-expect-error TODO(@Peng): maybe fix this
stream = action(options);
if (!stream) return;
yield* stream;
Expand Down Expand Up @@ -253,7 +253,7 @@ function actionToStream<T extends keyof BlockSuitePresets.AIActions>(
workspaceId: host.doc.collection.id,
} as Parameters<typeof action>[0];

// @ts-expect-error todo: maybe fix this
// @ts-expect-error TODO(@Peng): maybe fix this
stream = action(options);
if (!stream) return;
yield* stream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ declare global {
): 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 {
sessionId: string;
tokens: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/core/src/blocksuite/presets/ai/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type ActionEventType =
* To use it, downstream (affine) has to provide AI actions implementation,
* user info etc
*
* todo: breakdown into different parts?
* TODO: breakdown into different parts?
*/
export class AIProvider {
static get slots() {
Expand Down Expand Up @@ -124,7 +124,7 @@ export class AIProvider {
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] = (
...args: Parameters<BlockSuitePresets.AIActions[T]>
) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/core/src/commands/affine-updates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function registerAffineUpdatesCommands({
preconditionStrategy: () => !!store.get(updateReadyAtom),
run() {
apis?.updater.quitAndInstall().catch(err => {
// TODO: add error toast here
// TODO(@JimmFly): add error toast here
console.error(err);
});
},
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/core/src/commands/registry/command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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 {
Always,
InPaperOrEdgeless,
Expand Down Expand Up @@ -52,11 +52,11 @@ export interface AffineCommandOptions {
title: 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;
// we use https://github.com/jamiebuilds/tinykeys so that we can use the same keybinding definition
// for both mac and windows
// todo: render keybinding in command palette
// TODO(@Peng): render keybinding in command palette
keyBinding?: KeybindingOptions | string;
run: () => void | Promise<void>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const renderInput = (
<Input type="number" value={value} onChange={onChange} />
</div>
);
//TODO: add more types
// TODO(@JimmFly): add more types
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ const imageMap = new Map([
[
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,
},
],
[
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,
},
],
]);

/**
* TODO: Unify with NotFoundPage.
* TODO(@eyhn): Unify with NotFoundPage.
*/
export const ErrorDetail: FC<ErrorDetailProps> = props => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ErrorDetail } from '../error-basic/error-detail';
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 => {
const { error } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface AffineErrorBoundaryProps extends PropsWithChildren {
}

/**
* TODO: Unify with SWRErrorBoundary
* TODO(@eyhn): Unify with SWRErrorBoundary
*/
export const AffineErrorBoundary: FC<AffineErrorBoundaryProps> = props => {
const fallbackRender: FallbackRender = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface SliderProps<T> extends HTMLAttributes<HTMLDivElement> {
}

/**
* TODO: extract to @affine/ui
* TODO(@catsjuice): extract to @affine/ui
* @returns
*/
export const Slider = <T,>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const OAuthProviderMap: Record<
},

[OAuthProviderType.OIDC]: {
// TODO: Add OIDC icon
// TODO(@catsjuice): Add OIDC icon
icon: <GoogleDuotoneIcon />,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const useSendEmail = (emailType: AuthPanelProps['emailType']) => {
callbackUrl = 'verify-email';
break;
}
// TODO: add error handler
// TODO(@eyhn): add error handler
return trigger({
email,
callbackUrl: `/auth/${callbackUrl}?isClient=${
Expand Down Expand Up @@ -152,7 +152,7 @@ export const SendEmail = ({
const { loading, sendEmail } = useSendEmail(emailType);

const onSendEmail = useAsyncCallback(async () => {
// TODO: add error handler
// TODO(@eyhn): add error handler
await sendEmail(email);

notify.success({ title: hint });
Expand All @@ -164,7 +164,7 @@ export const SendEmail = ({
}, [setAuthState]);

if (!passwordLimits) {
// TODO: loading & error UI
// TODO(@eyhn): loading & error UI
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const SignInWithPassword: FC<AuthPanelProps> = ({
notify.error({
title: 'Failed to send email, please try again.',
});
// TODO: handle error better
// TODO(@eyhn): handle error better
}
setSendingEmail(false);
}, [sendingEmail, verifyToken, authService, email, challenge, setAuthState]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const SignIn: FC<AuthPanelProps> = ({
} catch (err) {
console.error(err);

// TODO: better error handling
// TODO(@eyhn): better error handling
notify.error({
title: 'Failed to send email. Please try again.',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const SyncAwarenessInnerLoggedIn = () => {
'user',
{
name: account.label,
// todo: add avatar?
// TODO(@eyhn): add avatar?
}
);

Expand Down Expand Up @@ -42,7 +42,7 @@ const SyncAwarenessInner = () => {
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 = () => {
return (
<Suspense>
Expand Down
Loading
Loading