Skip to content

fix: align text and icon in Write NFC Tags#319

Open
shraavv wants to merge 1 commit intofossasia:mainfrom
shraavv:246-center-text-NFC-tags
Open

fix: align text and icon in Write NFC Tags#319
shraavv wants to merge 1 commit intofossasia:mainfrom
shraavv:246-center-text-NFC-tags

Conversation

@shraavv
Copy link
Copy Markdown

@shraavv shraavv commented Jan 7, 2026

Fixes #246

Changes made:

  • Added minLines: 1 so the field renders as a single-line input by default
  • Ensured the field expands to a second line only when the user types

Screenshots:

image image

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @shraavv, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@mariobehling mariobehling requested a review from Copilot February 9, 2026 17:42
@mariobehling
Copy link
Copy Markdown
Member

Small process note.

We have automatic Copilot PR reviews enabled on this repository. These reviews are only triggered if the contributor has GitHub Copilot enabled and an active license on their own account.

Please enable Copilot in your GitHub settings if you have access. In many regions, free licenses are available through educational institutions or developer programs. Enabling Copilot helps us speed up the auto review process and reduces manual review overhead for the core team.

The team will review your PR. Thank you for your contribution and cooperation.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR primarily targets a UI alignment issue in the “Write NFC Tags” screen by adjusting the behavior of the multiline text input, and it also includes a broader regeneration/update of Flutter-generated artifacts (localizations, plugin registrant) and the dependency lockfile.

Changes:

  • Adjusted the “Write NDEF Records” text field to render as single-line by default and expand up to the configured max lines.
  • Regenerated localizations to add new strings and adjust supported locale handling (notably Norwegian Bokmål locale handling).
  • Updated pubspec.lock SDK constraints/dependency classification and regenerated the macOS plugin registrant.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pubspec.lock Updates dependency lock metadata and SDK minimums (Dart/Flutter).
macos/Flutter/GeneratedPluginRegistrant.swift Regenerated macOS plugin registration list (adds mobile_scanner, removes device_info_plus).
lib/ndef_screen/widgets/nfc_write_card.dart Tweaks TextField line behavior to improve initial alignment and expansion.
lib/l10n/app_localizations.dart Adds new localization keys and updates supported locale/lookup logic.
lib/l10n/app_localizations_de.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_en.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_es.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_fr.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_he.dart Regenerated localization outputs (includes multiple updated Hebrew strings + new keys).
lib/l10n/app_localizations_hi.dart Regenerated localization outputs (includes updated Hindi strings + new keys).
lib/l10n/app_localizations_id.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_ja.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_nb.dart Regenerated localization outputs to include new keys and simplify nb locale handling.
lib/l10n/app_localizations_pt.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_ru.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_uk.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_vi.dart Regenerated localization outputs to include new keys.
lib/l10n/app_localizations_zh.dart Regenerated localization outputs to include new keys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/ndef_screen/widgets/nfc_write_card.dart Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

lib/ndef_screen/widgets/nfc_write_card.dart:342

  • PR description mentions fixing multiline hint alignment via alignLabelWithHint: true, but this TextField only uses hintText (no labelText) and doesn't set alignLabelWithHint. If alignment is still an issue, either update the PR description to match the actual change, or adjust the relevant InputDecoration/TextField properties that affect hint/prefix icon vertical alignment (since alignLabelWithHint won't have any effect here).
    return TextField(
      onChanged: onChanged,
      maxLines: maxLines,
      minLines: 1,
      obscureText: obscureText,
      style: const TextStyle(fontSize: 14),
      decoration: InputDecoration(
        hintText: hintText,
        hintStyle: TextStyle(color: Colors.grey[500], fontSize: 14),
        prefixIcon: Icon(prefixIcon, color: colorAccent, size: 20),
        border: OutlineInputBorder(

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shraavv
Copy link
Copy Markdown
Author

shraavv commented Feb 12, 2026

@mariobehling
I have made the requested changes, could you please review this?

Copy link
Copy Markdown

@rahul31124 rahul31124 left a comment

Choose a reason for hiding this comment

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

Hello @shraavv, I have reviewed and tested the changes the UI looks good! However, please revert the following files: GeneratedPluginRegistrant.swift and pubspec.lock.

Additionally, could you please revert the localization files? They don't seem necessary for this specific fix. If there is an actual issue with the localizations, please open a separate issue and PR so we can address it there.

@shraavv
Copy link
Copy Markdown
Author

shraavv commented Apr 16, 2026

@rahul31124 I really appreciate the review, thanks! The files you mentioned do not need changes, I missed it. I shall be updating the PR soon.

@shraavv shraavv force-pushed the 246-center-text-NFC-tags branch from d143dfb to 5d35691 Compare April 16, 2026 17:59
Copilot AI review requested due to automatic review settings April 16, 2026 17:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 321 to 324
@override
Widget build(BuildContext context) {
final appLocalizations = AppLocalizations.of(context)!;
var imgLoader = context.watch<ImageLoader>();
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

appLocalizations is now declared as a local variable inside build(), but this file still references appLocalizations in other methods (e.g. _exportXbmFiles() and _showRefreshModeInfoDialog()), which will be out of scope and cause compilation errors. Make appLocalizations a late final/field set in didChangeDependencies(), add a getter that returns AppLocalizations.of(context)!, or replace those references to use AppLocalizations.of(context)! within each method.

Copilot uses AI. Check for mistakes.
import 'package:magicepaperapp/constants/color_constants.dart';
import 'package:magicepaperapp/l10n/app_localizations.dart';
import '../util/app_logger.dart';
import 'package:magicepaperapp/provider/getitlocator.dart';
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

getitlocator.dart is imported but no longer used in this file after removing the global getIt.get<AppLocalizations>() call. This will trigger an unused import warning (and may fail CI if analysis treats warnings as errors); remove the import or reintroduce its usage intentionally.

Suggested change
import 'package:magicepaperapp/provider/getitlocator.dart';

Copilot uses AI. Check for mistakes.
Comment thread lib/view/image_editor.dart Outdated

@override
Widget build(BuildContext context) {
final appLocalizations = AppLocalizations.of(context)!;
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

There is an extra leading space before final appLocalizations = ... which makes indentation inconsistent with the surrounding code and will be caught by dart format. Run the formatter or fix the indentation so it matches the rest of the file.

Suggested change
final appLocalizations = AppLocalizations.of(context)!;
final appLocalizations = AppLocalizations.of(context)!;

Copilot uses AI. Check for mistakes.
Comment thread pubspec.yaml Outdated
environment:
sdk: ">=3.3.4 <4.0.0"
flutter: '3.38.9'
flutter: '3.41.6'
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The PR description says it fixes #246 by adjusting the Write NFC Tags input (minLines/maxLines behavior), but this diff only updates the pinned Flutter version and localizes a few strings in image_editor.dart. As-is, it doesn't modify the NFC write UI (e.g. lib/ndef_screen/widgets/nfc_write_card.dart) where the reported alignment/line-wrapping issue lives, so it likely won't resolve #246. Either include the intended NFC UI changes in this PR or update the title/description to match what is actually being changed.

Copilot uses AI. Check for mistakes.
@shraavv shraavv force-pushed the 246-center-text-NFC-tags branch from 5d35691 to 2921089 Compare April 16, 2026 18:28
Copilot AI review requested due to automatic review settings April 16, 2026 18:31
@shraavv shraavv force-pushed the 246-center-text-NFC-tags branch from 2921089 to e782793 Compare April 16, 2026 18:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@rahul31124 rahul31124 left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Center text in Write NFC Tags

4 participants