Commit Graph

2228 Commits

Author SHA1 Message Date
Saul-Mirone
7e4af90c03 refactor(editor): cleanup dead code (#12049)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Refactor**
  - Removed internal utilities related to connector management and tree structure traversal. No changes to user-facing features or functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-29 07:51:11 +00:00
donteatfriedrice
83670ab335 feat(editor): add experimental feature citation (#11984)
Closes: [BS-3122](https://linear.app/affine-design/issue/BS-3122/footnote-definition-adapter-适配)
Closes: [BS-3123](https://linear.app/affine-design/issue/BS-3123/几个-block-card-view-适配-footnote-态)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced a new citation card component and web element for displaying citations.
  - Added support for citation-style rendering in attachment, bookmark, and linked document blocks.
  - Enabled citation parsing from footnote definitions in markdown for attachments, bookmarks, and linked docs.
  - Added a feature flag to enable or disable citation features.
  - Provided new toolbar logic to disable downloads for citation-style attachments.

- **Improvements**
  - Updated block models and properties to support citation identifiers.
  - Added localization and settings for the citation experimental feature.
  - Enhanced markdown adapters to recognize and process citation footnotes.
  - Included new constants and styles for citation card display.

- **Bug Fixes**
  - Ensured readonly state is respected in block interactions and rendering for citation blocks.

- **Documentation**
  - Added exports and effects for new citation components and features.

- **Tests**
  - Updated snapshots to include citation-related properties in block data.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-29 06:59:27 +00:00
doodlewind
be28038e94 perf(editor): fallback to placeholder for canvas text (#12033)
### TL;DR

For canvas elements, this PR adds placeholders during zooming operations to improve performance.

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lEGcysB4lFTEbCwZ8jMv/8c8daea8-1eb4-419b-a4f4-2a8847f40b7b.png)

### What changed?

- Implemented placeholder rendering during zooming operations in the canvas renderer, but not only DOM.
- Added a `forceFullRender` property to the `GfxCompatibleInterface` to allow elements to opt out of placeholder rendering
- Set `forceFullRender = true` for connectors to ensure they always render properly, even during zooming
- Connected the turbo renderer to the viewport's zooming state to automatically switch between full and placeholder rendering

### Why make this change?

Rendering complex elements during zooming operations can cause performance issues and make the UI feel sluggish. Rendering connector label also leads to high cost DOM `set font` delays.

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lEGcysB4lFTEbCwZ8jMv/961fb847-24b4-4a7f-b9dc-21b0a5edaaa1.png)

The turbo renderer improves performance by displaying simple placeholders for elements during zooming, while still rendering critical elements like connectors fully. This creates a smoother user experience while maintaining essential visual information.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced a feature-flag-controlled "turbo" rendering mode that displays placeholder graphics during zooming for improved performance.
  - Added the ability to override placeholder rendering for specific elements, ensuring full rendering when required.

- **Bug Fixes**
  - Enhanced rendering logic to ensure connectors always render fully, even during zoom operations.

- **Documentation**
  - Updated API documentation to reflect new properties related to rendering behavior.

- **Tests**
  - Improved tests to verify correct rendering behavior for connectors.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-29 03:05:17 +00:00
Saul-Mirone
4e201ede17 feat(editor): viewport overlay widget extension (#12035)
Closes: BS-3360

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced a new viewport overlay widget, making it available as part of the workspace and enabling its integration into supported pages.

- **Refactor**
  - Updated internal imports and exports to utilize the new viewport overlay widget package.
  - Streamlined widget registration and extension mechanisms for improved modularity.

- **Chores**
  - Added configuration and project references to support the new viewport overlay widget package in the build system.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-28 14:38:26 +00:00
akumatus
cf5574caf6 refactor(core): use the websearch parameters passed in by the front-end (#11989)
Support [AI-60](https://linear.app/affine-design/issue/AI-60).

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Refactor**
  - Updated naming conventions for the web search tool to ensure consistency across AI chat features.
  - Simplified internal handling of web search tool options for a more streamlined experience.
  - Unified parameter naming from "mustSearch" to "webSearch" across AI chat inputs and actions.
- **Chores**
  - Removed unused configuration options related to web search from prompt settings.
  - Added support for enabling or disabling web search via new parameters in chat requests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-28 16:26:56 +08:00
EYHN
08d1b8dcbf fix(core): better search result (#12015)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Refactor**
	- Simplified search menu logic by removing unnecessary filtering and parameters from menu item generation. No changes to visible functionality.
- **Bug Fixes**
	- Improved search index matching to retrieve all relevant entries, enhancing search accuracy.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-28 03:55:45 +00:00
fundon
e9003dec9e feat(editor): add blobState$ to BlobEngine (#11756)
Closes: [BS-3137](https://linear.app/affine-design/issue/BS-3137/在-bs-添加-blobstate-接口)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced real-time status tracking for file upload and download operations, allowing users to monitor progress and errors more effectively.
- **Improvements**
  - Enhanced icon display for attachments, providing a refreshed visual experience.
  - Improved update frequency and accuracy for file synchronization status indicators.
- **Bug Fixes**
  - Refined internal logic for filtering status updates, ensuring more precise feedback during file operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-28 10:46:46 +08:00
Saul-Mirone
d7b1819149 refactor(editor): move transcription block model to ai (#12010)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Refactor**
	- Updated and reorganized import paths for transcription block models and types to improve module structure and maintainability.
- **Chores**
	- Removed deprecated transcription block schema and related exports from core libraries.
	- Registered transcription block schema directly within the workspace schema for improved schema management.
- **Bug Fixes**
	- Ensured consistent registration and availability of transcription block features across relevant modules.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-27 13:13:07 +00:00
Saul-Mirone
81b439c4e1 feat(editor): add gfx pointer extension (#12006)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced a new pointer graphics module with tools and quick tool integration for edgeless surfaces.
  - Added a quick tool button for pointer interactions in edgeless mode.
  - Exposed new extension points for pointer graphics and effects.

- **Improvements**
  - Integrated pointer graphics as a dependency into related packages.
  - Enhanced toolbar context to support additional surface alignment modes.
  - Added conditional clipboard configuration registrations for edgeless contexts across multiple block types.

- **Removals**
  - Removed legacy tool and effect definitions and related quick tool exports from edgeless components.
  - Streamlined extension arrays and removed unused exports for a cleaner codebase.
  - Deleted obsolete utility functions and component registrations.

- **Chores**
  - Updated workspace and TypeScript project references to include the new pointer graphics module.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-27 04:46:44 +00:00
akumatus
0da5ef28d6 feat(core): add button supports uploading images (#11943)
Close [AI-81](https://linear.app/affine-design/issue/AI-81).

![截屏2025-04-24 16.09.19.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/ace2f896-b652-450d-be86-fb0365d5b2bc.png)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for uploading and handling multiple images in the AI chat interface, with a maximum image limit enforced.
  - Chat assistant avatar now visually indicates different statuses, including a transmitting animation.

- **Improvements**
  - Enhanced file upload experience by allowing batch image uploads and clearer notifications for files exceeding size limits.
  - Stronger status handling for chat assistant messages, improving reliability and user feedback.
  - Unified image count limit across chat input components using a shared constant.

- **Bug Fixes**
  - Improved consistency in how image limits are enforced across chat components.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-25 02:51:21 +00:00
CatsJuice
4c5e3a875e feat(core): calendar integration setting (#11882)
close AF-2503
2025-04-25 02:37:52 +00:00
CatsJuice
f5ac0aee97 feat(core): events list in journal calendar (#11873)
close AF-2505

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced calendar event integration in the journal detail page, allowing users to view and interact with calendar events for a selected date.
  - Added the ability to create new linked documents from calendar events directly within the journal interface.
- **Improvements**
  - Enhanced calendar integration with support for all-day and timed events, improved event grouping by date, and real-time updates.
  - Added new English localization entries for calendar event labels.
- **Bug Fixes**
  - Improved URL handling for calendar subscriptions, ensuring better compatibility and error feedback.
- **Style**
  - Added new styles for calendar event components to ensure a consistent and user-friendly appearance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-25 02:37:52 +00:00
CatsJuice
4b7fddc32c feat(core): web-clipper integration entrance (#11883)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced a new "Web Clipper" integration, allowing users to import web pages into AFFiNE via a direct link to the Chrome Web Store.
- **Improvements**
  - Integration cards can now display as clickable links or settings panels, depending on the integration.
- **Localization**
  - Added English translations for the "Web Clipper" integration name and description.
- **Style**
  - Improved card styling to ensure consistent text color, including for visited links.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-25 02:09:20 +00:00
akumatus
3d2f0e7b5b feat(core): chat-panel buttons ui (#11942)
Close [AI-7](https://linear.app/affine-design/issue/AI-7).

![截屏2025-04-23 23.29.32.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/a984a28f-0ccf-4e8d-ba2d-239ad03f2998.png)
2025-04-24 14:32:55 +00:00
akumatus
807cba03ee feat(core): add reasoning icon button (#11941)
Close [AI-58](https://linear.app/affine-design/issue/AI-58).

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced a toggleable AI reasoning feature in the chat interface, allowing users to enable or disable advanced reasoning during AI chat interactions.
  - Added a new reasoning button to the chat input for quick access and control.
- **Enhancements**
  - Improved chat configuration options to include reasoning settings, providing more flexibility for AI responses.
  - Streamlined network search and image upload interactions for a smoother user experience.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 14:32:54 +00:00
akumatus
a603c06fab feat(core): add web search tool and reasoning params (#11912)
Close [AI-60](https://linear.app/affine-design/issue/AI-60).

### What changed?
- Add Exa web search tool
- Add reasoning params
2025-04-24 12:23:06 +00:00
forehalo
4ffa37d1c3 chore: proxy image preview in frontend (#11957)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
	- Images and icons in bookmark cards are now loaded through an image proxy for improved reliability and consistency.
	- Embed blocks for GitHub, Loom, and YouTube now display banner and creator images via an image proxy service for enhanced image loading.

- **Refactor**
	- Simplified backend URL handling and proxy logic for images, resulting in more efficient processing and reduced complexity.
	- Consolidated image proxy middleware and services into a shared adapter module for streamlined imports and improved maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 10:23:25 +00:00
EYHN
eaa1bc6bf1 refactor(core): adjust effect api (#11935) 2025-04-24 10:06:12 +00:00
darkskygit
5d76be6736 feat(server): adapt 4o image (#11956)
fix AI-88

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for the new image generation model "gpt-image-1" in both backend and frontend.
  - Updated available prompt options to include "gpt-image-1" for image creation actions.

- **Improvements**
  - Set a 5-minute timeout for image generation requests to improve reliability.

- **Tests**
  - Expanded test coverage to validate image generation using the new "gpt-image-1" prompt.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 09:04:29 +00:00
pengx17
814dfab0df fix(core): ai affine label alignment (#11952)
before
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/39355c1c-a25e-4697-97aa-20a3b180d7c7.png)

after
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/5abe900c-cd8e-43ff-bdf8-2314ccad541f.png)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Style**
  - Updated the visual structure of the assistant avatar for a cleaner appearance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 04:31:30 +00:00
Saul-Mirone
2200bd7b70 feat(editor): text gfx extension (#11951)
Closes: BS-3213
2025-04-24 03:21:54 +00:00
EYHN
4df75ec5d0 fix(core): subscribe search not unsubscribe (#11929) 2025-04-23 13:56:58 +00:00
pengx17
e501e35d3d fix(core): audio job submittion timeout too short (#11918)
fix AF-2556
2025-04-23 09:34:59 +00:00
Saul-Mirone
16831e8c0e feat(editor): reference, mention and latex inline extension (#11914)
Closes: BS-3215
Closes: BS-3218
Closes: BS-3217
2025-04-23 09:22:16 +00:00
CatsJuice
200015a811 feat(core): calendar integration storage (#11788)
close AF-2501, AF-2504
2025-04-23 07:57:23 +00:00
CatsJuice
af69154f1c feat(core): sub-page for setting panel (#11678)
**setting panel sub-page impl, with cascading pages support.**

## Usage
```tsx
// inside setting content
const island = useSubPageIsland();
const [open, setOpen] = useState(false);

if (!island) {
  return null;
}

return (
  <SubPageProvider
    island={island}
    open={open}
    onClose={() => setOpen(false)}
    backText="Back"
  />
);
```

### Preview

![CleanShot 2025-04-14 at 16.56.30.gif](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/LakojjjzZNf6ogjOVwKE/c042300d-c442-4708-a07a-54cd9f044abf.gif)
2025-04-23 07:57:23 +00:00
L-Sun
27ff9ab9f4 refactor(core): move actions to footer of notification card (#11894)
This PR move all actions button to the footer of `NotificationCard`. There are some example as following:

### No Changes
![CleanShot 2025-04-22 at 20.02.58@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/1207cbfb-6033-48f4-8a7b-b7b024f16881.png)

![CleanShot 2025-04-22 at 20.03.42@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/6da27303-06c3-4f40-b3f9-3cf88759f685.png)

![CleanShot 2025-04-22 at 20.03.57@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/a53d2bdf-a103-4275-9833-a55387af6f09.png)

### Changes
### Before
![CleanShot 2025-04-22 at 20.07.40@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/d785b12b-480c-4b9d-bb0b-d93dd18939a2.png)

#### After
![CleanShot 2025-04-22 at 20.05.51@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/242a9956-6a68-46a7-865a-454117ee997c.png)
2025-04-23 05:41:14 +00:00
CatsJuice
9b2cf5cafa feat(core): new async global state storage impl (#11794) 2025-04-23 05:28:21 +00:00
Saul-Mirone
b1aecfc1c4 feat(editor): link inline extension (#11910)
Closes: BS-3216
2025-04-23 04:42:24 +00:00
Saul-Mirone
730ed16fc5 refactor(editor): remove old specs (#11909) 2025-04-23 02:57:01 +00:00
Saul-Mirone
2510e7a9a4 feat(editor): inline footnote extension (#11908)
Closes: BS-3219
2025-04-23 01:40:49 +00:00
Saul-Mirone
24edfc75bd feat(editor): table extension (#11906)
Closes: BS-3205
2025-04-23 01:16:08 +00:00
Saul-Mirone
e57222b89a feat(editor): surface ref extension (#11902)
Closes: BS-3203
2025-04-23 01:16:07 +00:00
L-Sun
020c1a7598 fix(editor): lit change-in-update warning (#11904)
This PR fixed that lit change-in-update warning. Related #9446

### Before

![CleanShot 2025-04-23 at 02.18.16@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/e1205c41-7890-4de8-ba14-99a88f66a9ac.png)

### After
![CleanShot 2025-04-23 at 02.18.42@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/45bff6e5-a56f-43ac-abe9-6da9b75baca5.png)
2025-04-22 20:25:54 +00:00
Saul-Mirone
45b6cbe8d7 refactor(editor): cleanup dead code (#11893) 2025-04-22 15:51:23 +00:00
Saul-Mirone
43966a6c6b feat(editor): use store extension manager (#11891)
Closes: BS-3284
2025-04-22 15:51:23 +00:00
Saul-Mirone
99ad4e871e feat(editor): use migrated extensions (#11886)
Closes: BS-3283
2025-04-22 15:51:22 +00:00
darkskygit
597b27c22f feat(server): enable web search for 4.1 (#11825) 2025-04-22 14:49:46 +00:00
pengx17
c17c335f9b feat(core): add actions to transcription block (#11896) 2025-04-22 14:06:12 +00:00
pengx17
ab2d0b5485 fix(core): should not limit the number of docs of at menu (#11889)
fix AF-2544
2025-04-22 10:33:24 +00:00
Saul-Mirone
6d6504e2af feat(editor): replace spec provider with extension manager (#11861)
Closes: BS-3273
2025-04-22 07:40:41 +00:00
EYHN
e4d6833296 refactor(core): rename explorer to navigation-panel (#11876) 2025-04-22 12:47:35 +08:00
fundon
824e66df58 fix(core): improve EdgelessCopilotPanel position (#11814)
Closes: [AF-2101](https://linear.app/affine-design/issue/AF-2101/ai-panel-的输入框menu定位错误,menu-应该出现在输入框下方)

[Screen Recording 2025-04-18 at 20.51.01.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/8ypiIKZXudF5a0tIgIzf/67410349-b056-40a7-b1e6-6de5a5137789.mov" />](https://app.graphite.dev/media/video/8ypiIKZXudF5a0tIgIzf/67410349-b056-40a7-b1e6-6de5a5137789.mov)
2025-04-21 14:08:24 +00:00
Saul-Mirone
846410cdb6 feat(editor): note extension (#11856)
Closes: BS-3200
Closes: BS-3201
2025-04-21 13:18:35 +00:00
yoyoyohamapi
e9dab04990 fix(core): chat user message margin & max-width (#11854)
### TL;DR

Fix chat panel user message css: `margin-left` & `max-width`
2025-04-21 11:15:18 +00:00
yoyoyohamapi
fe03292346 fix(core): ai images are not right-aligned (#11850)
### TL;DR

Fix ai images are not right-aligned.

> CLOSE BS-3131
2025-04-21 11:15:18 +00:00
L-Sun
a2b40fea20 feat(editor): insertion and duplication actions for embed synced doc (#11852)
Close [BS-3068](https://linear.app/affine-design/issue/BS-3068/在edgeless-的embed-doc-block上,增加-insert-into-page的选项,类似frame)
Close [BS-3069](https://linear.app/affine-design/issue/BS-3069/edgeless下的-embed,覆盖现在的edit行为-,暂定叫做duplicate-into-a-note,复制一个-note)
2025-04-21 11:01:04 +00:00
Saul-Mirone
7c79b1f024 feat(editor): latex and list extensions (#11851)
Closes: BS-3198
Closes: BS-3199
2025-04-21 10:29:31 +00:00
Saul-Mirone
df6e17b82f feat(editor): frame and image extensions (#11849)
Closes: BS-3196
Closes: BS-3197
2025-04-21 10:29:30 +00:00
Saul-Mirone
92ac8e3cad feat(editor): embed extension (#11848)
Closes: BS-3195
2025-04-21 09:22:12 +00:00