1
0
mirror of https://github.com/avinal/nikki.git synced 2026-07-03 21:40:09 +05:30
Commit Graph

13 Commits

Author SHA1 Message Date
avinal 8c15660fce Add media upload, clickable links, tables, comments, share
Media upload:
- Android file picker via ActivityResultContracts.GetContent
- Upload attachment API (base64 content to /api/v1/attachments)
- Uploaded attachments linked to memo via CreateMemoRequest.attachments
- Upload status shown in compose card ("uploading...", "N attachment(s) ready")

Markdown improvements:
- Clickable links: URLs and [text](url) open in browser via LinkAnnotation
- Table rendering: pipe-delimited markdown tables with header row
- Fixed underscore italic (_text_) and bold (__text__) variants

Comments:
- Comments section at bottom of MemoDetailScreen
- List existing comments via /api/v1/memos/{id}/comments
- Add new comments with text input + send button
- Comments rendered with full markdown

Share:
- "share" option in memo long-press context menu
- Android share intent with memo content as plain text

Also:
- Task toggle now works in memo feed (onTaskToggle callback wired)
- Tag clicks in explorer filter memos page
- Search from explorer filters memos page instead of navigating
- All three filter types (date/tag/search) shown as banner with "clear"

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 18:24:45 +05:30
avinal 70910f7788 Add project metadata and Gradle wrapper
- PLAN.md: architecture design document
- .idea/: Android Studio project configuration
- Gradle wrapper: v9.4.1 with daemon JVM properties

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:12:08 +05:30
avinal 5f2c1c02b2 Add tasks pivot and Metro settings screen
Tasks screen:
- Group by: Due Date, List/Topic, Priority, Source Memo, Status
- Sort by: Due Date, Priority (within groups)
- Collapsible groups with count badges
- Accent-colored checkboxes with content-based task identification
- Task detail bottom sheet: edit due date, priority, open source memo
- Completed tasks in collapsed group at bottom

Settings screen:
- Metro-style large section headers (24sp Light)
- Accent color picker: grid of 20 WP8 color circles
- Theme toggle: dark / light / amoled
- Account info display, sign-out with confirmation

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:11:42 +05:30
avinal 9b5e18939b Add memo screens: panorama feed, detail, editor, explorer
MainScreen: WP Panorama-style navigation with parallax-scrolling pivot
headers (explore/memos/tasks/settings). Headers drift at 50% of swipe
speed. Active title in accent color, inactive fades with distance.

MemoListScreen: cardless feed with inline compose bar (expandable text
field, + insert menu, visibility picker, accent "post" button).
Pull-to-refresh, date-based filtering from explorer calendar.

MemoDetailScreen: full content view with markdown rendering, attachment
display, reactions. Back link, retry on load failure.

MemoEditorScreen: Metro-style editor with 32sp Light title, accent
underline text field, dirty state tracking, discard confirmation dialog.

ExplorerPage: activity calendar (month heatmap with navigation arrows),
search bar, tag list with counts. Calendar dates link to memos page
with date filter instead of opening detail screen.

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:11:03 +05:30
avinal 0377095eaa Add navigation and Metro-style login screen
Navigation:
- Type-safe routes: Login, Main, MemoDetail, MemoEditor
- Slide + fade transitions (300ms) for forward/back navigation
- Login uses fade-only transition
- Auth-gated start destination (isLoggedIn flow)

Login screen (Metro design):
- "sign in" title in 54sp Light weight, left-aligned
- Underline-only text fields with accent color focus indicator
- Solid accent-colored sign-in button
- PAT-based authentication against any Memos server URL

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:10:39 +05:30
avinal 3b4e45484f Add shared UI components: markdown, memo card, attachments, reactions
MarkdownText: custom Compose renderer supporting headings, bold (**/__),
italic (*/_), strikethrough (~~), inline code with accent background,
fenced code blocks with syntax highlighting (keywords/strings/comments/numbers),
task checkboxes, bullet lists, blockquotes, links, bare URLs, #tag pills.
All text colors respect theme (onBackground/onSurfaceVariant).

MemoCard: chrome-free content block with parallax-aware layout.
Long-press context menu (Metro AlertDialog style): pin, edit, copy, archive, delete.
Inline editing with accent-colored text field and visibility picker.
Compact mode with "show more/less" for long memos.

AttachmentGrid: full-width image rendering via Coil with FillWidth scaling.
ReactionBar: grouped emoji display with count badges.
RelativeTimestamp: "just now", "5m ago", "yesterday", "Jan 15" formatting.

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:10:00 +05:30
avinal 3b1d996574 Add Windows Phone Metro theme system
Color system:
- Dark (#1F1F1F bg), Light (white bg), AMOLED (pure black bg)
- All 20 WP8 accent colors (Lime through Taupe)
- User-selectable accent color persisted in DataStore
- Default: Cobalt (#0050EF)

Typography (WP scale):
- 54sp Light for page titles, 32sp Light for pivot headers
- 24sp Light for section headers, 17sp body, 15sp normal, 14sp small
- SemiBold for emphasis, Light for large display text

Flat surfaces only — no elevation, no tonal surfaces, no Material chrome.

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:09:37 +05:30
avinal d64ffded84 Add Todoist-style task parser
Extract tasks from memo markdown content:
- Checkbox syntax: - [ ] / - [x] detection
- Due dates: @today, @tomorrow, @yesterday, YYYY-MM-DD format
- Priorities: p1, p2, p3 as standalone tokens
- Labels: @word (excluding date keywords)
- Lists: #word (first letter must be alpha)
- Stable task IDs via content hash (survives line reordering)
- Content-based line matching for safe toggle/edit operations
- reconstructLine() rebuilds task line after metadata edits

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:09:20 +05:30
avinal 5759ab3738 Add dependency wiring, token storage, and app entry points
- AppDependencies: manual DI container with lazy singletons
- TokenStore: DataStore-backed persistence for server URL, access token,
  theme preference, and accent color selection
- DataStoreFactory: multiplatform DataStore creation
- LocalAppDependencies: CompositionLocal for DI access in composables
- App.kt: root composable with theme + Coil ImageLoader (Ktor engine)
- MainActivity: creates AppDependencies, provides via CompositionLocal
- Coil configured with authenticated Ktor HttpClient for private images

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:08:37 +05:30
avinal e842355a6b Add Room database with multiplatform support
- MemoEntity with JSON-serialized attachments and reactions columns
- MemoDao: observe all/by-id, upsert, delete operations via Flow
- Entity-domain mappers with JSON serialization for nested data
- DatabaseFactory: expect/actual pattern for platform-specific builders
- Android: Room.databaseBuilder with context
- iOS: Room.databaseBuilder with NSHomeDirectory path
- BundledSQLiteDriver for consistent cross-platform SQLite
- Destructive migration fallback for schema changes

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:08:18 +05:30
avinal b65673093a Add data layer: Memos API client, domain models, repository
API client (Ktor):
- Auth via Bearer token HttpSend interceptor
- CRUD endpoints: listMemos, getMemo, createMemo, updateMemo, deleteMemo
- PATCH uses updateMask as query parameter (gRPC-Gateway format)
- Reaction upsert/delete endpoints
- ApiResult sealed class for error handling

Domain models:
- Memo with string IDs (Memos uses short UUIDs, not integers)
- Attachment, Reaction, User, Task, MemoVisibility
- MemoRepository: offline-first with Room cache, 5-min TTL
- AuthRepository: PAT login, token validation

DTOs match actual Memos API JSON (camelCase, no @SerialName needed).

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:07:50 +05:30
avinal f685856b9e Add module build configs and platform expect/actual stubs
- composeApp/build.gradle.kts: KMP targets (android + iOS), all dependencies
- androidApp/build.gradle.kts: Android app with compose compiler
- Platform.kt expect/actual for Android and iOS
- Android resources: launcher icons, themes, manifest

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:06:41 +05:30
avinal 8dd6c10320 Initialize Compose Multiplatform project with AGP 9
Set up two-module structure for AGP 9 compatibility:
- composeApp: KMP shared library (com.android.kotlin.multiplatform.library)
- androidApp: Thin Android app shell (com.android.application)

Configure all dependencies in version catalog: CMP 1.11.0, Kotlin 2.3.21,
Ktor 3.4.3, Room 2.8.4, Coil 3.4.0, kotlinx-serialization/datetime/coroutines,
AndroidX Navigation 2.9.2, Lifecycle 2.10.0, DataStore 1.2.1, WorkManager 2.11.1.

Co-Authored-By: Claude Opus 4.6 (1M context)

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-05-19 17:01:51 +05:30