Skip to content
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

Manual tagging of files – single-level tags #377

Open
wants to merge 35 commits into
base: tagging-of-files
Choose a base branch
from

Conversation

aince42
Copy link
Contributor

@aince42 aince42 commented Jan 7, 2025

Readiness checklist

  • I added/updated tests.
  • I ensured that the PR title is good enough for the changelog.
  • I labeled the PR.
  • I self-reviewed the PR.

Manual tagging of files

The following is currently possible

  • Loading tag collections from assets
  • Manual tagging of files
  • Editing and deleting tags
  • Display tags in the FileScreen

Still needs to be implemented

  • Tags of files where I am not the owner can not be edited/changed
  • If the last link in a tag chain has not been selected, it can still be succeeded
  • If a tag chain already exists and it is deleted, the tag container should be displayed again (An empty list should be treated in exactly the same way as a null value)
  • UI must be adapted as soon as Figma has been updated

Below you can see screenshots of the currently implemented UI.

It doesn't look good, especially with longer tags.

IMG_0061
IMG_0060

@aince42 aince42 added the enhancement New feature or request label Jan 7, 2025
@Siolto
Copy link
Contributor

Siolto commented Jan 7, 2025

Could you please also add, what is still open after this PR.

@Siolto
Copy link
Contributor

Siolto commented Jan 8, 2025

Remove the second input field in the upload file bottom sheet. This was a temporary solution
image

@Siolto
Copy link
Contributor

Siolto commented Jan 8, 2025

while uploading a file I get a error about the tagCollection:

════════ Exception caught by widgets library ═══════════════════════════════════
LateInitializationError: Field '_tagCollection@3348467827' has not been initialized.
The relevant error-causing widget was:
    FileDetailScreen FileDetailScreen:file:///Users/simoncoen/Projekte/enmeshed/app/apps/enmeshed/lib/main.dart:335:32

return displayNames[currentLocale]!;
}

return displayNames['en']!;
Copy link
Contributor

Choose a reason for hiding this comment

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

probably a comment is helpful that 'en' is always the fallback

@@ -127,6 +127,7 @@ class _FilesScreenState extends State<FilesScreen> {
accountId: widget.accountId,
fileRecord: _filteredFileRecords[index],
trailing: const Icon(Icons.chevron_right),
reload: _loadFiles,
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need the reload again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why do we need the reload again?

So that the FilesScreen is also updated as soon as an update has been made to the file.
If you navigate back and then click on the file again, the “fileReferenceAttribute” is passed directly from the FilesScreen.
If this is not up-to-date, the current tags are not displayed in the FileDetailScreen either.

@aince42 aince42 requested a review from Siolto January 8, 2025 14:10
Copy link
Contributor

@Siolto Siolto left a comment

Choose a reason for hiding this comment

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

second input field in file upload sheet is still there

],
),
),
if (_loading) const ModalLoadingOverlay(text: 'Dokument wird gespeichert...', isDialog: false),
Copy link
Contributor

Choose a reason for hiding this comment

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

translation

_tags = widget.fileReferenceAttribute?.tags;

if (_fileDVO == null) _load();
_load();
Copy link
Contributor

Choose a reason for hiding this comment

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

why always load?


@override
Widget build(BuildContext context) {
if (tags == null) {
Copy link
Contributor

@Siolto Siolto Jan 9, 2025

Choose a reason for hiding this comment

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

do this check in the file details screen. When there are no tags just display this controller, otherwise display the selected tags

if (selectedTags.isEmpty) return (tagsMap: currentLevel, currentPath: '');

var currentPath = '';
for (final tag in selectedTags) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@aince42 I have simplified this logic. Please double check if it is still working as intended

@jkoenig134
Copy link
Member

I'll put this back to draft, as it is not matching the new design.

@jkoenig134 jkoenig134 marked this pull request as draft January 23, 2025 14:14
@aince42 aince42 requested a review from Siolto January 27, 2025 08:40
@aince42 aince42 marked this pull request as ready for review January 27, 2025 08:40
@aince42
Copy link
Contributor Author

aince42 commented Jan 27, 2025

This PR covers single-level tagging of files.
It is possible to assign multiple tags and edit them.

@aince42 aince42 changed the title Manual tagging of files Manual tagging of files – single-level tags Feb 3, 2025
Comment on lines 34 to 35
late FileDVO? _fileDVO;
late LocalAttributeDVO? _fileReferenceAttribute;
Copy link
Member

Choose a reason for hiding this comment

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

late and ? is a VERY bad combination. Please explain here why you have chosen that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

late and ? is a VERY bad combination. Please explain here why you have chosen that.

You are right, in this case it is useless and causes confusion.

@aince42 aince42 requested a review from jkoenig134 February 4, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants