-
Notifications
You must be signed in to change notification settings - Fork 6
RC-T40 Chat Fixes #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
RC-T40 Chat Fixes #267
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| @import 'tailwindcss/theme.css' layer(theme); | ||
| @import 'tailwindcss/preflight.css' layer(base); | ||
| @import 'tailwindcss/utilities.css'; | ||
| @import 'nativewind/theme'; | ||
|
|
||
| @import './theme-tokens.css'; | ||
|
|
||
| /* Web dark mode: the .dark class GluestackUIProvider puts on <html> (see index.web.tsx). It is | ||
| always present — explicit modes set .dark/.light directly, and system mode sets one from the | ||
| media query — so the class alone is authoritative. Matching prefers-color-scheme here as well | ||
| would make an explicit Light choice render dark utilities on a dark-themed OS. */ | ||
| @custom-variant dark (&:where(.dark, .dark *)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| { | ||
| "tailwind": { | ||
| "config": "tailwind.config.js", | ||
| "css": "global.css" | ||
| }, | ||
| "app": { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import React from 'react'; | ||
| import { Platform } from 'react-native'; | ||
|
|
||
| /** | ||
| * Android field metrics, applied from JS because the class layer cannot express them correctly. | ||
| * | ||
| * Measured on device, each case a real Input/InputField: | ||
| * - the class `h-full` (height: 100%) resolves taller than the fixed-height parent on Android, and | ||
| * the parent's overflow-hidden then clips the top of the glyphs; | ||
| * - an explicit pixel height matching the parent renders correctly; | ||
| * - overriding only the lineHeight, at either the class or the style layer, does not help; | ||
| * - lineHeight 0 (what iOS uses) hides Android text completely, and a later `undefined` does not | ||
| * clear the value the size class sets. | ||
| * | ||
| * So Android gets a concrete height plus a lineHeight near the font size, and drops the extra font | ||
| * padding. iOS keeps the zero lineHeight that upstream applied through `ios:leading-[0px]`; that class | ||
| * is gone from the base style so the value can be chosen per platform here. | ||
| */ | ||
| const ANDROID_FIELD_METRICS: Record<string, { height: number; lineHeight: number }> = { | ||
| sm: { height: 36, lineHeight: 18 }, | ||
| md: { height: 40, lineHeight: 20 }, | ||
| lg: { height: 44, lineHeight: 22 }, | ||
| xl: { height: 48, lineHeight: 25 }, | ||
| }; | ||
|
|
||
| export const useTextFieldVerticalFix = (size: string | undefined) => | ||
| React.useMemo(() => { | ||
| if (Platform.OS === 'ios') { | ||
| return { lineHeight: 0 } as const; | ||
| } | ||
| if (Platform.OS === 'android') { | ||
| const metrics = ANDROID_FIELD_METRICS[size ?? 'md'] ?? ANDROID_FIELD_METRICS.md; | ||
| return { height: metrics.height, lineHeight: metrics.lineHeight, includeFontPadding: false, textAlignVertical: 'center' } as const; | ||
| } | ||
| return undefined; | ||
| }, [size]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /** | ||
| * Native stylesheet entry. Pairs with theme-styles.web.ts, which loads global.web.css instead. | ||
| * | ||
| * The two entries exist because the `dark:` variant cannot be shared: native drives it from the | ||
| * colour-scheme media query (it has no theme class, and adding one to the app-wide wrapper View | ||
| * breaks native scrolling), while web drives it from the .dark class on <html>. Tokens are shared | ||
| * via theme-tokens.css. | ||
| */ | ||
| import '../../global.css'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * Web stylesheet entry. Pairs with theme-styles.ts, which loads global.css on native. | ||
| * | ||
| * Web keys the `dark:` variant off the .dark class GluestackUIProvider maintains on <html>, so an | ||
| * explicit Light choice stays light on a dark-themed OS. | ||
| */ | ||
| import '../../global.web.css'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Resgrid/Unit
Length of output: 26294
🏁 Script executed:
Repository: Resgrid/Unit
Length of output: 7121
🏁 Script executed:
Repository: Resgrid/Unit
Length of output: 3320
🏁 Script executed:
Repository: Resgrid/Unit
Length of output: 150
Use a typed
ResourceIncidentViewResultfixture for these mocked responses.Construct the result with
new ResourceIncidentViewResult()and assignDataandStatus. This preserves validation of the inheritedBaseV4Requestfields and theDatatype instead of bypassing them withas any. Apply this at lines 337, 346, 363, and 383.🤖 Prompt for AI Agents
Source: Coding guidelines