Skip to content

Commit 60b672d

Browse files
committed
claude: Add a few small instructions based on experience with 1942
1 parent 9f12e11 commit 60b672d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.claude/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Each route binding follows a consistent pattern:
2020
}) {
2121
```
2222

23+
The function name exactly matches the slug in the API docs URL, converted to camel case.
24+
2325
2. **Doc comment** with a link to the Zulip API docs: `/// https://zulip.com/api/create-saved-snippet`
2426

2527
3. **Calls `connection.get`/`.post`/`.patch`/`.delete`** with:
@@ -28,7 +30,7 @@ Each route binding follows a consistent pattern:
2830
- The URL path (relative to `/api/v1/`)
2931
- A `Map<String, dynamic>?` of parameters
3032

31-
4. **Parameters are encoded** via `encodeParameters()`: values are JSON-encoded unless wrapped in `RawParameter(...)`, which passes the string through as-is. String parameters that shouldn't be double-quoted use `RawParameter`. Optional params are included conditionally with `if (x != null)`.
33+
4. **Parameter encoding**: values are automatically JSON-encoded (via `encodeParameters()`) unless wrapped in `RawParameter(...)`, which passes the string through as-is. String parameters that shouldn't be double-quoted use `RawParameter`. Optional params are included conditionally with `if (x != null)`.
3234

3335
5. **Server version compat**: Use `connection.zulipFeatureLevel!` to check feature levels and adapt the request (e.g., different param names for old vs new servers). Mark these with `// TODO(server-N)` comments.
3436

lib/widgets/action_sheet.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ class DraggableScrollableModalBottomSheet extends StatelessWidget {
383383
/// (Even if we did live-update the buttons, it's possible anyway that a user's
384384
/// action can race with a change that's already been applied on the server,
385385
/// because it takes some time for the server to report changes to us.)
386+
//
387+
// When defining button classes (subclasses of this class), try to
388+
// put definitions in the same order as the buttons appear in the action sheet.
386389
abstract class ActionSheetMenuItemButton extends StatelessWidget {
387390
const ActionSheetMenuItemButton({super.key, required this.pageContext});
388391

0 commit comments

Comments
 (0)