Since the filename is used as part of the heuristics for the asset button, we don't need to display the filename in a separate column.
While going through the list of columns to generate the visible columns, as soon as we see the filename or the asset column, we should add the asset column to the visible column.
In compact contexts, we should hide the md5 and sha256 metadata columns.
Related to the heuristics for picking a "row display key" (the self-link in compact),
We should deprioritize simple keys made of md5 and sha256.
If the picked key was an asset (or asset filename), we should display it as an asset download button, not a self-link.
Related to the heuristics for picking a key for rowname,
We should deprioritize simple fkeys (similar to the "row display key" logic)
Simple keys made of asset metadata should be deprioritized (URL, filename, md5, sha256)
Fix how we're comparing the column positions as part of heuristics for sorting keys or related entities. Previously I was blindly comparing arrays which was basically a string comparison. Now we're properly checking the values.
given that the values are already sorted, manually comparing them
is simple.
Apart from making these changes, I refactored the code and added extra APIs to make it easier to read. I also had to add more test cases and modify the existing ones, given that the heuristics have been changed.
Summary of changes:
page_markdown_pattern
changes described here.given that the values are already sorted, manually comparing them is simple.
Apart from making these changes, I refactored the code and added extra APIs to make it easier to read. I also had to add more test cases and modify the existing ones, given that the heuristics have been changed.
I also ran the chaise test cases on this branch, and it passed.
related issues: #858, #824