Skip to content

Add Notes / Resources Linking#25

Merged
alexdremov merged 8 commits into
mainfrom
linking
Mar 3, 2026
Merged

Add Notes / Resources Linking#25
alexdremov merged 8 commits into
mainfrom
linking

Conversation

@alexdremov

@alexdremov alexdremov commented Feb 22, 2026

Copy link
Copy Markdown
Owner

Closes #22

Copilot AI review requested due to automatic review settings February 22, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive linking functionality to the note-taking app, enabling users to create clickable links that can either reference other notes internally (via UUID) or point to external URLs. The implementation includes a new LinkItem canvas element with its own rendering system, a floating window viewer for linked content, and a full UUID-based indexing system to support persistent note-to-note references.

Changes:

  • Adds LinkItem model with serialization, rendering, and canvas integration
  • Implements UUID-based note identification and indexing for reliable internal linking
  • Creates floating window UI for viewing linked notes and external URLs in-app
  • Adds NotePickerActivity for browsing and selecting link targets

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
LinkItem.kt New canvas item model for clickable links with label, target, type, and styling
LinkRenderer.kt Renders link items as styled capsules with icons
InsertLinkDialog.kt Dialog for creating/editing links with internal/external type selection
CanvasContextMenu.xml Adds "Link" button to canvas context menu
FloatingWindowView.kt Draggable/resizable floating window for viewing linked content
NotePickerActivity.kt Activity for browsing and selecting notes to link to
CanvasActivity.kt Handles link activation, resolution, and floating window management
MainActivity.kt Adds picker mode for note selection with project locking
StorageProvider.kt Implements ensureUuid() for assigning UUIDs to existing notes
FileIndexManager.kt Adds UUID-to-path mapping for fast link resolution
InfiniteCanvasModel.kt Integrates LinkItem into canvas data model
CanvasSerializer.kt Serialization support for LinkItem
SerializationModels.kt Proto models for LinkItemData and UUID fields
Logger.kt Changes debug logging behavior (unconditional)
ZipUtils.kt Adds debug logging and size-matching for incremental zips
Various drawables/layouts UI resources for link icons, dialogs, and floating windows
Comments suppressed due to low confidence (1)

app/src/main/java/com/alexdremov/notate/ui/OnyxCanvasView.kt:288

  • There's no UI for editing an existing LinkItem after it's placed. When a user taps on a TextItem in select mode, it opens the text editor (lines 285-287), but there's no equivalent for LinkItem. Users can move and delete links via selection, but cannot edit the label, target, or type. Consider adding an edit dialog that opens when a LinkItem is long-pressed or double-tapped in select mode, similar to how text editing works.
                                if (currentTool.type == ToolType.TEXT) {
                                    if (item is TextItem) {
                                        showTextEditor(item)
                                    } else {
                                        showTextEditor(null, worldX, worldY)
                                    }
                                    return@launch
                                } else if (currentTool.type == ToolType.SELECT && item is TextItem) {
                                    showTextEditor(item)
                                    return@launch
                                }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/alexdremov/notate/CanvasActivity.kt
Comment thread app/src/main/java/com/alexdremov/notate/CanvasActivity.kt
Comment thread app/src/main/java/com/alexdremov/notate/util/LinkRenderer.kt
Comment thread app/src/main/java/com/alexdremov/notate/ui/controller/CanvasControllerImpl.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/data/CanvasSerializer.kt
Comment thread app/src/main/java/com/alexdremov/notate/data/StorageProvider.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/util/LinkRenderer.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/util/Logger.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/data/FileIndexManager.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/data/StorageProvider.kt Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/alexdremov/notate/data/StorageProvider.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/data/StorageProvider.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/data/StorageProvider.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/model/LinkItem.kt
Comment thread app/src/main/java/com/alexdremov/notate/data/FileIndexManager.kt
@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown

Code Coverage Report

Overall Project 23.05% -7.04% 🍏
Files changed 6.81% 🍏

File Coverage
ZipUtils.kt 72.22% 🍏
CanvasRepository.kt 68.78% -11.1% 🍏
RegionStorage.kt 66.61% -1.63% 🍏
RegionManager.kt 64.72% -2.84% 🍏
Logger.kt 59.82% 🍏
CanvasSerializer.kt 57.54% -30.51% 🍏
SerializationModels.kt 55.35% -8.57% 🍏
InfiniteCanvasModel.kt 47.68% -2.83% 🍏
StrokeRenderer.kt 45.11% -4.94% 🍏
PenInputHandler.kt 33.66% -31.02% 🍏
CanvasControllerImpl.kt 31.3% -13.72% 🍏
LinkItem.kt 23.02% -76.98% 🍏
PreferencesManager.kt 19.47% -8.75% 🍏
StorageProvider.kt 0% -28.37% 🍏
FileIndexManager.kt 0% -23.13% 🍏
ProjectRepository.kt 0% -18.89% 🍏
FloatingWindowView.kt 0% 🍏
SimplePdfView.kt 0% 🍏
CanvasActivity.kt 0% -32.33% 🍏
NotePickerActivity.kt 0% 🍏
MainActivity.kt 0% -24.27% 🍏
FileGridItem.kt 0% -1.28% 🍏
ViewportInteractor.kt 0% -22.65% 🍏
InsertLinkDialog.kt 0% 🍏
CanvasContextMenu.kt 0% -17.03% 🍏
FileBrowserScreen.kt 0% -1.93% 🍏
OnyxCanvasView.kt 0% -17.96% 🍏
CanvasController.kt 0% 🍏
UriUtils.kt 0% 🍏
LinkRenderer.kt 0% 🍏
HomeViewModel.kt 0% -3.64% 🍏

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

app/src/main/java/com/alexdremov/notate/MainActivity.kt:334

  • FileBrowserScreen now has an isReadOnly flag to disable long-press actions, but MainScreen never passes it. In picker mode this means users can still open the manage dialog (rename/duplicate/delete) while picking a note. Pass isReadOnly = isPickerMode (or otherwise disable onItemDelete/rename/duplicate) when isPickerMode is true.
                    FileBrowserScreen(
                        items = browserItems,
                        breadcrumbs = breadcrumbs,
                        allTags = tags,
                        disabledItemUuid = disabledItemUuid,
                        onBreadcrumbClick = { viewModel.loadBrowserItems(it.path) },
                        onItemClick = { item ->
                            when (item) {
                                is ProjectItem -> {
                                    viewModel.loadBrowserItems(item.path)
                                }

                                is CanvasItem -> {
                                    if (isPickerMode && onFilePicked != null) {
                                        onFilePicked(item)
                                    } else {
                                        val intent =
                                            Intent(context, CanvasActivity::class.java).apply {
                                                putExtra("CANVAS_PATH", item.path)
                                            }
                                        context.startActivity(intent)
                                    }
                                }
                            }
                        },
                        onItemDelete = { viewModel.deleteItem(it) },
                        onItemRename = { item, newName -> viewModel.renameItem(item, newName) },
                        onItemDuplicate = { item -> viewModel.duplicateItem(item) },
                        onSetFileTags = { item, newTags -> viewModel.setFileTags(item, newTags) },
                    )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/alexdremov/notate/data/ProjectRepository.kt
Comment thread app/src/main/java/com/alexdremov/notate/data/CanvasRepository.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/data/StorageProvider.kt
Comment thread app/src/main/java/com/alexdremov/notate/data/StorageProvider.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/ui/view/SimplePdfView.kt Outdated
Comment thread app/src/main/java/com/alexdremov/notate/CanvasActivity.kt

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 41 out of 41 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/alexdremov/notate/data/FileIndexManager.kt
Comment thread app/build.gradle.kts
Comment thread app/src/main/java/com/alexdremov/notate/data/StorageProvider.kt
@alexdremov alexdremov enabled auto-merge March 3, 2026 23:49
@alexdremov alexdremov merged commit e288034 into main Mar 3, 2026
4 checks passed
@alexdremov alexdremov deleted the linking branch March 3, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linking between different resources

2 participants