Skip to content

ProfileScreen rework: visual refresh, edit UX overhaul, settings expansion#26

Merged
FLAiRistaken merged 3 commits into
developfrom
profile-rework-16082256131629205559
Apr 30, 2026
Merged

ProfileScreen rework: visual refresh, edit UX overhaul, settings expansion#26
FLAiRistaken merged 3 commits into
developfrom
profile-rework-16082256131629205559

Conversation

@FLAiRistaken

@FLAiRistaken FLAiRistaken commented Apr 30, 2026

Copy link
Copy Markdown
Owner

ProfileScreen rework: visual refresh, edit UX overhaul, settings expansion

This PR implements the requested ProfileScreen redesign and functionality changes:

  • Edit UX Overhaul: Removed the old tap-to-edit toggle in favor of always-editable TextInputs for name, occupation, and goal. Added localized conditional "Save" buttons.
  • Keyboard Handling: Wrapped the screen in a KeyboardAvoidingView with an inner ScrollView and programmatic scrolling to ensure inputs remain visible when focused.
  • Visual Refresh: Updated section headers to use the primary color with newly added corresponding icons. Increased the avatar size to 80x80 with a primary color ring, and added left accent borders to all cards for a cohesive look.
  • Behaviour Section: Introduced a new BEHAVIOUR section containing a "Default log context" toggle ('None', 'Work', 'Personal'). The value updates profile.default_context and pre-selects context dynamically in LogModal.
  • Expanded Account Settings: Refactored the account section to include "Export my data" and "Delete account" options alongside the sign out functionality.
  • Data Model Migration: Included the required default_context column definition in UserProfile (src/lib/types.ts).

Fixes all code review feedback including preserving addCategory input visibility post-add, fixing missing TS typings, setting the correct avatar internal size, and optimizing state comparison checks.


PR created automatically by Jules for task 16082256131629205559 started by @FLAiRistaken

Summary by CodeRabbit

  • New Features

    • Added two new UI icons for use across the app.
    • Profile now supports a default logging context and can be set from Behaviour controls.
    • New data export and account deletion actions on the Account section.
  • Refactor

    • Profile editing converted to always-visible inputs with contextual save buttons and improved keyboard handling.
    • Log modal now respects the profile's default context during resets and saves.
  • Chores

    • CI now verifies TypeScript compilation on main.

@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings April 30, 2026 20:31
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 16a7ded4-876a-43ab-ba54-14ecaf6c10f1

📥 Commits

Reviewing files that changed from the base of the PR and between f43e99b and c0e3e0a.

⛔ Files ignored due to path filters (1)
  • Build_plan.md is excluded by !**/*.md
📒 Files selected for processing (5)
  • src/components/LogModal.tsx
  • src/components/icons/GearIcon.tsx
  • src/components/icons/TargetIcon.tsx
  • src/lib/types.ts
  • src/screens/ProfileScreen.tsx

📝 Walkthrough

Walkthrough

Adds a profile-level default_context, updates UI to surface and persist it, refactors ProfileScreen to always-on inputs and keyboard-aware layout, makes LogModal derive its initial/reset context from the profile, adds two SVG icon components, and introduces a CI workflow that runs tsc --noEmit.

Changes

Cohort / File(s) Summary
CI Workflow
.github/workflows/main.yml
New GitHub Actions workflow: triggers on main push and PRs, sets up Node.js v22, runs npm install, installs TypeScript globally, and executes tsc --noEmit.
Type System
src/lib/types.ts
UserProfile extended with optional `default_context?: LogContext
Icons
src/components/icons/GearIcon.tsx, src/components/icons/TargetIcon.tsx
Added two new React Native SVG icon components (GearIcon, TargetIcon) with configurable size and color.
Log Modal
src/components/LogModal.tsx
selectedContext now initialises/resets from profile?.default_context via useProfile(); reset effect depends on profile?.default_context to apply profile default consistently.
Profile Screen
src/screens/ProfileScreen.tsx
Large refactor: always-visible TextInput fields (name/occupation/goal) with draft state and save buttons shown conditionally; keyboard-aware ScrollView/KeyboardAvoidingView handling; new "BEHAVIOUR" controls to set default_context (None/Work/Personal); added ACCOUNT rows for export/delete and adjusted sign-out styling.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ProfileScreen
  participant API as Profile API
  participant LogModal

  User->>ProfileScreen: change default_context and tap "Save"
  ProfileScreen->>API: updateProfile({ default_context })
  API-->>ProfileScreen: 200 OK (updated profile)
  ProfileScreen-->>User: UI reflects saved profile
  Note right of LogModal: Later when creating a log
  User->>LogModal: open modal
  LogModal->>ProfileScreen: read profile (useProfile)
  ProfileScreen-->>LogModal: returns profile with default_context
  LogModal->>LogModal: initialise selectedContext = profile.default_context
  LogModal-->>User: modal shows preselected context
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped and nudged a profile seed,
Default context planted like a deed,
Targets, gears in icon light,
Inputs cosy, keyboard tight,
Saved and snug — a happy feed!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the three main changes: visual refresh, edit UX overhaul, and settings expansion, which directly align with the PR objectives and file modifications.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-rework-16082256131629205559

Review rate limit: 8/10 reviews remaining, refill in 11 minutes and 8 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/main.yml:
- Around line 3-7: Update the GitHub Actions trigger under the on: block so PRs
targeting develop also run this workflow: add "develop" to the branches arrays
for pull_request (and optionally push if you want pushes to develop to trigger
too), i.e., modify the existing pull_request.branches (and push.branches if
desired) entries so they include both main and develop to ensure the TypeScript
gate runs for PRs into develop as well.
- Around line 14-18: Update the GitHub Actions steps to use the latest
maintained action versions: replace uses: actions/checkout@v2 with
actions/checkout@v6 and replace uses: actions/setup-node@v2 with
actions/setup-node@v4, keeping the existing node-version input (node-version:
'22.x') or adjusting it to a supported LTS if desired; ensure the two step
identifiers (uses: actions/checkout and uses: actions/setup-node) are updated
exactly so the workflow uses the newer releases.

In `@src/components/icons/GearIcon.tsx`:
- Line 22: The inner gear SVG path in the GearIcon component is malformed: the
Path element's d attribute (the cubic Bézier that defines the center circle)
ends at the wrong coordinates and uses an incorrect control point; update the
Path d string in GearIcon (the <Path ... /> line) so the final cubic segment
returns to (12,15) and uses (10.3431,15) instead of (10.3431,12), effectively
correcting the last C segment so the center circle closes properly.

In `@src/components/icons/TargetIcon.tsx`:
- Around line 22-23: The inner target Path in TargetIcon (the <Path d="M12
17C14.7614 17 17 14.7614 17 12C17 9.23858 14.7614 7 12 7C9.23858 7 7 9.23858 7
12C7 14.7614 9.23858 12 12 17Z" /> string) has a wrong y-coordinate on the
second control point; update that final cubic Bézier control point from
(9.23858, 12) to (9.23858, 17) so the inner ring closes as a proper circle
inside the TargetIcon component.

In `@src/components/LogModal.tsx`:
- Around line 39-50: The modal's selectedContext is only initialised and synced
in the "close-on-hide" effect but that effect's dependency array is missing
profile?.default_context, so if the user changes default context while the modal
is closed selectedContext won't update; update the effect that calls resetState
(which sets setSelectedContext(profile?.default_context ?? undefined)) to
include profile?.default_context in its dependency array so resetState runs when
the profile default context changes while the modal is hidden.

In `@src/lib/types.ts`:
- Line 28: Change the type of the default_context field to reuse the existing
LogContext type instead of repeating the union; update the declaration for
default_context to use LogContext (e.g., default_context?: LogContext | null) so
it stays aligned with LogEntry.context and avoids drift between definitions.

In `@src/screens/ProfileScreen.tsx`:
- Around line 77-80: Move the inline style object { flex: 1 } on the
KeyboardAvoidingView into the component stylesheet: create a styles object via
StyleSheet.create (e.g., add styles.container = { flex: 1 }) and replace the
inline style prop on KeyboardAvoidingView with style={styles.container}; update
any import/usage if necessary and ensure KeyboardAvoidingView still uses
behavior prop as before.
- Around line 121-126: The onPress handlers (e.g., the PillButton that calls
updateProfile({ name: nameDraft.trim(), occupation: occupationDraft.trim() }))
are fire-and-forget and may reject; update each handler (profile save, goal
save, category archive, default-context handlers referenced by updateProfile and
similar calls) to await the promise or attach a .catch, handle errors by setting
component error state or showing a user-visible toast/alert, and ensure you
clear/disable any "saving" flags appropriately to avoid unhandled promise
rejections and to surface failures to the user; locate functions named
updateProfile (and the goal/category/default-context save handlers) and wrap
their invocation in try/catch or promise.catch to implement this behavior.
- Line 94: Replace all hardcoded design tokens in ProfileScreen (e.g., the
PersonIcon size={38} and any other numeric literals and colour hexes reported at
ranges 174,198,283,400-410,425-430,466-467,588-645) with the corresponding
exports from src/constants/theme.ts; locate usages inside the ProfileScreen
component and styles (e.g., PersonIcon, Avatar, Text elements, buttons) and swap
raw numbers (38, 80, 12, 14, 20, etc.) and hex colours like "#C0392B" for theme
constants such as theme.sizes.avatar, theme.spacing.small/medium,
theme.fontSizes.body*, theme.colors.danger (or the exact names exported in
theme.ts), updating imports to include the theme values and ensuring no literal
design values remain.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e2060110-4160-413b-b259-0d4301e93e6e

📥 Commits

Reviewing files that changed from the base of the PR and between 1233a48 and f43e99b.

⛔ Files ignored due to path filters (1)
  • Build_plan.md is excluded by !**/*.md
📒 Files selected for processing (6)
  • .github/workflows/main.yml
  • src/components/LogModal.tsx
  • src/components/icons/GearIcon.tsx
  • src/components/icons/TargetIcon.tsx
  • src/lib/types.ts
  • src/screens/ProfileScreen.tsx

Comment on lines +3 to +7
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Run this workflow for develop PRs too.

This job currently only runs for PRs into main, so it will not protect this PR or any other merge into develop. The new TypeScript gate is effectively bypassed on the branch you are targeting here.

Suggested change
 on:
   push:
-    branches: [ main ]
+    branches: [main, develop]
   pull_request:
-    branches: [ main ]
+    branches: [main, develop]
🧰 Tools
🪛 YAMLlint (1.38.0)

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 5-5: too many spaces inside brackets

(brackets)


[error] 5-5: too many spaces inside brackets

(brackets)


[error] 7-7: too many spaces inside brackets

(brackets)


[error] 7-7: too many spaces inside brackets

(brackets)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/main.yml around lines 3 - 7, Update the GitHub Actions
trigger under the on: block so PRs targeting develop also run this workflow: add
"develop" to the branches arrays for pull_request (and optionally push if you
want pushes to develop to trigger too), i.e., modify the existing
pull_request.branches (and push.branches if desired) entries so they include
both main and develop to ensure the TypeScript gate runs for PRs into develop as
well.

Comment on lines +14 to +18
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '22.x'

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.

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/main.yml

Repository: FLAiRistaken/firsthand

Length of output: 579


🌐 Web query:

actions/checkout v2 compatibility modern runners 2025 2026 deprecation

💡 Result:

actions/checkout@v2 remains compatible with modern GitHub-hosted runners in 2025-2026 and is not deprecated. The v2 tag points to v2.0.0 (released ~2019), which uses an older Node.js runtime (likely node16 or earlier). Modern GitHub-hosted runners (ubuntu-latest pointing to ubuntu-24.04 as of late 2024, with runner versions v2.327+ in 2025-2026 supporting Node 20/24) fully support legacy Node versions including those used by v2. No deprecation notices exist for actions/checkout@v2 in official GitHub sources; deprecations target specific other actions like actions/cache v1-v2 or OS images like ubuntu-20.04 (retired April 2025). Self-hosted runners require version v2.329.0+ (enforced for new configs from March 2026) but support all checkout versions including v2. Users should upgrade to v6 (latest as of Jan 2026, Node24 runtime, requires runner v2.327.1+) for new features like improved credential security and performance, but v2 continues to function without issues on current infrastructure.

Citations:


🌐 Web query:

actions/setup-node v2 v4 version requirements GitHub Actions runners

💡 Result:

The actions/setup-node action requires GitHub Actions runners that support the Node.js runtime version specified in its action.yml 'runs.using' field. v2 (https://github.com/actions/setup-node/tree/releases/v2): Likely uses 'node16' (common for older versions), compatible with runners from ~v2.280+ that support node16. v4 (latest release v4.4.0): Uses 'node20' runtime. Compatible with GitHub-hosted runners (all current ones) and self-hosted runners v2.317.0+ (when Node 20 became default). Earlier runners may require ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true for node16 fallback if pinned to older checkout/setup actions. Newer versions (v5+, v6): Use 'node24' runtime (action.yml main branch), requiring runner v2.327.1+ explicitly stated in README: "Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release." For self-hosted runners without pre-installed Node.js, setup-node@v4+ may fail as it runs using the runner's Node.js (issue #1287). GitHub-hosted runners always have compatible Node versions pre-installed. Current GitHub-hosted runners (ubuntu-latest etc., as of 2026-04-30) support all versions v2-v6.

Citations:


Upgrade GitHub Actions to more recent versions for improved security and performance.

actions/checkout@v2 and actions/setup-node@v2 remain compatible with current runners, but upgrading to v4 (or v6 for checkout) brings improved security features, better performance, and modern Node.js runtime support.

Suggested change
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Use Node.js
-      uses: actions/setup-node@v2
+      uses: actions/setup-node@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '22.x'
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
🧰 Tools
🪛 actionlint (1.7.12)

[error] 14-14: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


[error] 16-16: the runner of "actions/setup-node@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/main.yml around lines 14 - 18, Update the GitHub Actions
steps to use the latest maintained action versions: replace uses:
actions/checkout@v2 with actions/checkout@v6 and replace uses:
actions/setup-node@v2 with actions/setup-node@v4, keeping the existing
node-version input (node-version: '22.x') or adjusting it to a supported LTS if
desired; ensure the two step identifiers (uses: actions/checkout and uses:
actions/setup-node) are updated exactly so the workflow uses the newer releases.

Comment thread src/components/icons/GearIcon.tsx Outdated
Comment thread src/components/icons/TargetIcon.tsx Outdated
Comment thread src/components/LogModal.tsx
Comment thread src/lib/types.ts Outdated
Comment on lines +77 to 80
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
style={{ flex: 1 }}
>

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.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Move this static container style into StyleSheet.create().

{ flex: 1 } is fixed, so it should live in styles rather than inline.

As per coding guidelines, "Use StyleSheet.create() instead of inline styles in React Native components".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/screens/ProfileScreen.tsx` around lines 77 - 80, Move the inline style
object { flex: 1 } on the KeyboardAvoidingView into the component stylesheet:
create a styles object via StyleSheet.create (e.g., add styles.container = {
flex: 1 }) and replace the inline style prop on KeyboardAvoidingView with
style={styles.container}; update any import/usage if necessary and ensure
KeyboardAvoidingView still uses behavior prop as before.

<View style={styles.headerSection}>
<View style={styles.avatarCircle}>
<PersonIcon size={36} color={Colors.primary} />
<PersonIcon size={38} color={Colors.primary} />

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.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Replace the newly added raw design values with theme tokens.

This rework introduces hardcoded sizes, spacing, and colour literals (38, 80, 12, 14, 20, #C0392B, etc.), which breaks the design-system contract and will drift from the rest of the app.

As per coding guidelines, "All design constants (colours, fonts, sizes, spacing) must be imported from src/constants/theme.ts; never hardcode colours, fonts, sizes, or spacing values".

Also applies to: 174-174, 198-198, 283-283, 400-410, 425-430, 466-467, 588-645

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/screens/ProfileScreen.tsx` at line 94, Replace all hardcoded design
tokens in ProfileScreen (e.g., the PersonIcon size={38} and any other numeric
literals and colour hexes reported at ranges
174,198,283,400-410,425-430,466-467,588-645) with the corresponding exports from
src/constants/theme.ts; locate usages inside the ProfileScreen component and
styles (e.g., PersonIcon, Avatar, Text elements, buttons) and swap raw numbers
(38, 80, 12, 14, 20, etc.) and hex colours like "#C0392B" for theme constants
such as theme.sizes.avatar, theme.spacing.small/medium, theme.fontSizes.body*,
theme.colors.danger (or the exact names exported in theme.ts), updating imports
to include the theme values and ensuring no literal design values remain.

Comment thread src/screens/ProfileScreen.tsx

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

⛔ CodeRabbit does not have permission to push changes to this repository. Please ensure CodeRabbit has Contents: Read and write permission.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

⛔ CodeRabbit does not have permission to push changes to this repository. Please ensure CodeRabbit has Contents: Read and write permission.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

⛔ CodeRabbit does not have permission to push changes to this repository. Please ensure CodeRabbit has Contents: Read and write permission.

@FLAiRistaken FLAiRistaken merged commit 4ad0e88 into develop Apr 30, 2026
2 checks passed
@FLAiRistaken FLAiRistaken deleted the profile-rework-16082256131629205559 branch April 30, 2026 22:03
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.

2 participants