Turn realtime page into a section#2772
Conversation
WalkthroughThis pull request restructures the Realtime API documentation by introducing a nested navigation hierarchy. It adds a new parent navigation item for Realtime with multiple child documentation pages covering authentication, channels, custom endpoints, payload structure, queries, and subscription methods. The main realtime documentation page is simplified to focus on basic examples. Additionally, the sidebar navigation logic is updated to support parent items, import paths for sidebar components are corrected, and a new REST documentation layout is introduced. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan for PR comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/routes/docs/apis/realtime/`+layout.svelte:
- Around line 10-54: Add the missing "Limitations" nav entry to the navigation
tree by updating the navigation constant (NavTree) in +layout.svelte: add an
item with label "Limitations" and href "/docs/apis/realtime/limitations" into
the appropriate section (e.g., under Concepts or wherever similar pages live) so
the newly created limitations/+page.markdoc is discoverable in the sidebar;
modify the navigation array defined as navigation: NavTree to include this new
object in the items list.
In `@src/routes/docs/apis/realtime/channels/`+page.markdoc:
- Around line 165-167: Replace the inconsistent placeholder in the
documentation: change the example using Channel.execution(ID) to the same quoted
placeholder style used elsewhere (e.g., Channel.execution('<EXECUTION_ID>') or
Channel.execution('<ID>')) so it matches entries like `executions.<ID>` and
`'<FUNCTION_ID>'`/`'<EXECUTION_ID>'`; update the `Channel.execution(ID)`
occurrence to use the quoted placeholder format to maintain consistency across
examples.
In `@src/routes/docs/apis/realtime/payload/`+page.markdoc:
- Around line 26-28: The example timestamp for the "timestamp" field uses a
space-separated datetime ("2023-01-19 18:30:04.051") but the description claims
ISO 8601; either update the example to a valid ISO 8601 UTC string (e.g.
"2023-01-19T18:30:04.051Z") so it matches the description, or change the
description for the timestamp field to explicitly state the server returns a
space-separated format (e.g. "YYYY-MM-DD HH:mm:ss.SSS in UTC") and keep the
example as-is; edit the "timestamp" entry and the example value accordingly.
- Line 11: Update the sentence "The payload from the subscription will contain
following properties:" by inserting the missing article "the" so it reads "The
payload from the subscription will contain the following properties:"; locate
this exact string in the +page.markdoc content and make the one-word addition.
In `@src/routes/docs/apis/realtime/subscribe/`+page.markdoc:
- Around line 120-124: The Dart example is missing a terminating semicolon after
the subscription.stream.listen(...) statement; update the snippet where
subscription.stream.listen((response) { print(response); }) is shown to include
a trailing semicolon so the call becomes a complete statement (i.e., add ";"
after the closing parenthesis of subscription.stream.listen). Ensure you modify
the block containing subscription.stream.listen to reflect this change.
- Around line 200-204: The Dart example is missing a terminating semicolon after
the subscription.stream.listen(...) call; update the code snippet that uses
subscription.stream.listen((response) { ... }) to add a semicolon immediately
after the closing parenthesis so the statement becomes a valid Dart expression
(i.e., place a semicolon after the listen(...) call).
- Around line 40-44: The Dart example is missing a terminating semicolon on the
subscription.stream.listen call; update the example so the listener invocation
ends with "});" instead of "})" (i.e., add the semicolon after the closing brace
of subscription.stream.listen callback) to produce a valid Dart statement for
the subscription.stream.listen((response) { ... }); invocation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1ccf4bc9-fe11-4169-b577-e568b74964bc
📒 Files selected for processing (12)
src/routes/docs/Sidebar.sveltesrc/routes/docs/apis/graphql/+layout.sveltesrc/routes/docs/apis/realtime/+layout.sveltesrc/routes/docs/apis/realtime/+page.markdocsrc/routes/docs/apis/realtime/authentication/+page.markdocsrc/routes/docs/apis/realtime/channels/+page.markdocsrc/routes/docs/apis/realtime/custom-endpoint/+page.markdocsrc/routes/docs/apis/realtime/limitations/+page.markdocsrc/routes/docs/apis/realtime/payload/+page.markdocsrc/routes/docs/apis/realtime/queries/+page.markdocsrc/routes/docs/apis/realtime/subscribe/+page.markdocsrc/routes/docs/apis/rest/+layout.svelte
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/routes/docs/apis/realtime/subscribe/`+page.markdoc:
- Around line 259-271: The Apple Realtime snippet creates a Realtime from an
unconfigured Client and uses a non‑idiomatic response.toString(), making it
non‑runnable and inconsistent; update the example to import AppwriteModels,
configure the Client with setEndpoint(...) and setProject(...), keep
Realtime(client) and the subscribe call using Channel.files(), and replace
response.toString() with print(String(describing: response)) so the snippet is
copy‑paste runnable and matches other Apple examples.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 300dc2f1-b3fb-4f21-9830-5282cff85c11
📒 Files selected for processing (6)
src/routes/docs/apis/realtime/+page.markdocsrc/routes/docs/apis/realtime/channels/+page.markdocsrc/routes/docs/apis/realtime/custom-endpoint/+page.markdocsrc/routes/docs/apis/realtime/payload/+page.markdocsrc/routes/docs/apis/realtime/queries/+page.markdocsrc/routes/docs/apis/realtime/subscribe/+page.markdoc
🚧 Files skipped from review as they are similar to previous changes (4)
- src/routes/docs/apis/realtime/payload/+page.markdoc
- src/routes/docs/apis/realtime/queries/+page.markdoc
- src/routes/docs/apis/realtime/channels/+page.markdoc
- src/routes/docs/apis/realtime/custom-endpoint/+page.markdoc
Summary by CodeRabbit
Documentation
New Features