Skip to content

feat(frontend): add schedule workflows - #131

Merged
gac0812 merged 4 commits into
1024XEngineer:MVPfrom
gac0812:codex/frontend-schedule-workflows
Aug 1, 2026
Merged

feat(frontend): add schedule workflows#131
gac0812 merged 4 commits into
1024XEngineer:MVPfrom
gac0812:codex/frontend-schedule-workflows

Conversation

@gac0812

@gac0812 gac0812 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add schedule repository, cache, service, conflict handling, and mutation orchestration
  • add month and agenda views, schedule detail, manual create/edit flows, and date/time pickers
  • add saved-location editing and Baidu map picking for web and native
  • cover schedule transport, domain ordering, editor behavior, location utilities, and screens

Why

Schedule behavior now lives behind feature-owned application and data boundaries instead of being embedded in the legacy home screen. The UI can create, update, complete, delete, and resync schedules through the WebSocket transport.

Dependency

Validation

  • npm run check (32 suites, 154 tests)
  • npx expo export --platform android --output-dir ../export-schedule

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I found four issues that should be addressed before this workflow is usable:

  • frontend/App.tsx still renders only HomeScreen; the new SessionProvider, OverlayProvider, ScheduleProvider, and ScheduleScreen are never composed, so the schedule workflow is not reachable from the shipped app.
  • The inline findings below cover native session initialization, location-only schedule visibility, and unsafe HTML construction for the native map.

Validation note: static review completed; the repository checkout does not contain installed frontend dependencies, so lint/typecheck/tests could not be run.

// Expo Go and a custom Expo runtime expose the legacy module under this
// name. The lookup is static and Metro-visible; there is no hidden import
// or optional JS package that can silently disappear from a release bundle.
return requireOptionalNativeModule<ExpoFileSystemLike>('ExponentFileSystem');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Add the native storage dependency or a concrete injected implementation. On native builds this calls requireOptionalNativeModule('ExponentFileSystem'), but frontend/package.json does not declare expo-file-system. createDeviceIdStore() will therefore throw, leaving SessionProvider without a device ID and preventing every native session/WebSocket connection from starting.

timeSchedules.push(item);
}

const date = scheduleDate(item);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Preserve location-only schedules in a rendered collection. These schedules have start_time === null, so this continue excludes them from byDateKey; MonthView only renders schedulesOnDate(...), and locationSchedules is not consumed anywhere else. A valid location reminder will consequently disappear from the schedule UI and cannot be opened or edited.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6afc271. MonthView now renders undated location reminders in a dedicated 地点提醒 section, with open and toggle actions, without assigning them a fake calendar date. Added a regression test. All 156 tests pass.

<script>
(function () {
var bridge = window.ReactNativeWebView;
var center = ${centerJson};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Escape serialized data before embedding it in the generated <script>. center can contain user-controlled address/name text, and JSON.stringify does not escape the < in a </script> sequence. A crafted saved location can terminate this script and execute arbitrary JavaScript inside the WebView; serialize with HTML-safe escaping (at least </>/&) before interpolation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6afc271. Initial location and center data now use HTML-safe inline-script serialization for <, >, &, U+2028, and U+2029. Added a malicious closing-script regression test. All 156 tests pass.

@gac0812
gac0812 merged commit 0df92e9 into 1024XEngineer:MVP Aug 1, 2026
1 check passed
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.

1 participant